Lobby scripting thread

Lobby scripting thread

Please use this forum to set up matches and discuss played games.

Moderator: Moderators

Post Reply
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Lobby scripting thread

Post by Beherith »

Lobby scripting is AWESOME!

This all applies to TASClient ofc.

You can enable scripts in lobby, and then enable the debug window.
Scripts are in python, and should be placed in lobby/python/scripts.
Then you can load the by pressing reload.

Tasclient has a great and stable API, all detailed in lobby/python/api.txt

Example script: auto reconnect

Code: Select all

import lobbyscript
import datetime

connected=0
first=1

def onConnected():
	global connected
	connected=1
	print "Connected "+datetime.datetime.now().isoformat()
	
def onDisconnect():
	global connected
	connected=0
	print "Disconnected "+datetime.datetime.now().isoformat()
	
def timer_30():
	global first
	global connected
	if first==1:
		first-=1
	else:
		#print "tick"
		if connected==0:
			api.SocketConnect("91.121.98.29",8200)
			print "Reconnecting "+datetime.datetime.now().isoformat()
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Re: Lobby scripting thread

Post by SinbadEV »

sweet... now people won't have to put any effort into spamming the lobby...
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Lobby scripting thread

Post by aegis »

scripting has been around for over a year :P
User avatar
[TS]Lollocide
Posts: 324
Joined: 30 Nov 2007, 18:24

Re: Lobby scripting thread

Post by [TS]Lollocide »

Time to scripting being disabled:

23:59:57.
23:59:56.
23:59:55.
...
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: Lobby scripting thread

Post by aegis »

nah, we can just ban abusers... so it's all good.
User avatar
Zydox
Lobby Developer
Posts: 453
Joined: 23 May 2006, 13:54

Re: Lobby scripting thread

Post by Zydox »

Beherith wrote:Example script: auto reconnect

Code: Select all

import lobbyscript
import datetime

connected=0
first=1

def onConnected():
	global connected
	connected=1
	print "Connected "+datetime.datetime.now().isoformat()
	
def onDisconnect():
	global connected
	connected=0
	print "Disconnected "+datetime.datetime.now().isoformat()
	
def timer_30():
	global first
	global connected
	if first==1:
		first-=1
	else:
		#print "tick"
		if connected==0:
			lobbyscript.Callback().SocketConnect("91.121.98.29",8200)
			print "Reconnecting "+datetime.datetime.now().isoformat()
Tried this script yesterday, and with help from Satirik found out that api should be replaced with lobbyscript.Callback()
User avatar
Wombat
Posts: 3379
Joined: 15 Dec 2008, 15:53

Re: Lobby scripting thread

Post by Wombat »

i enjoyed how neddie was using spam script on me, some mass sentences spam from some song, each in new window, that was cool

and
[TS]Lollocide wrote:Time to scripting being disabled:

23:59:57.
23:59:56.
23:59:55.
...
lol'd
User avatar
Neddie
Community Lead
Posts: 9406
Joined: 10 Apr 2006, 05:05

Re: Lobby scripting thread

Post by Neddie »

I've never used any custom scripts, on you or otherwise. I don't even use TASC.
Auswaschbar
Spring Developer
Posts: 1254
Joined: 24 Jun 2007, 08:34

Re: Lobby scripting thread

Post by Auswaschbar »

Springlobby has auto-reconnect :roll:
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Lobby scripting thread

Post by Beherith »

Wombat wrote:i enjoyed how neddie was using spam script on me,
Care to support that accusation with anything more substantial than your word for it?
slogic
AI Developer
Posts: 626
Joined: 17 Mar 2008, 19:03

Re: Lobby scripting thread

Post by slogic »

Auswaschbar wrote:Springlobby has auto-reconnect :roll:
It's buggy under Windows: http://www.springlobby.info/issues/1161
Satirik
Lobby Developer
Posts: 1688
Joined: 16 Mar 2007, 18:27

Re: Lobby scripting thread

Post by Satirik »

Auswaschbar wrote:Springlobby has auto-reconnect :roll:
tasclient has internet 8)
User avatar
hunterw
Posts: 1838
Joined: 14 May 2006, 12:22

Re: Lobby scripting thread

Post by hunterw »

hey i used to be able to save startboxes in tasclient but not anymore

also in tasclient if u X out the windows in the battle lobby then u cant ever get them back adn it throws errors and shit
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: Lobby scripting thread

Post by Beherith »

Hit reset layout.
Satirik
Lobby Developer
Posts: 1688
Joined: 16 Mar 2007, 18:27

Re: Lobby scripting thread

Post by Satirik »

Beherith wrote:Hit reset layout.
or show them back using Options -> View
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Lobby scripting thread

Post by TradeMark »

can you make script to unspec me if there are slots free? i bet many people would like such script. also it should ready automatically so if you get a slot, others wont need to wait you to ready up when you are not watching in the lobby.
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: Lobby scripting thread

Post by Jazcash »

I can haz script too? I want one that auto spams my colour to my chosen so autohost can't choose mai colour.
SirMaverick
Posts: 834
Joined: 19 May 2009, 21:10

Re: Lobby scripting thread

Post by SirMaverick »

JAZCASH wrote:I want one that auto spams my colour to my chosen so autohost can't choose mai colour.
There are many reasons not to do it that way.

A better approach is to set set color in game (e.g. Local Team Colors).
User avatar
TradeMark
Posts: 4867
Joined: 17 Feb 2006, 15:58

Re: Lobby scripting thread

Post by TradeMark »

SirMaverick wrote:A better approach is to set set color in game (e.g. Local Team Colors).
awesome! so now i could always play with my favorite color! although i dont think its needed to change allies/enemies colors, since im using enemy spotter widget already. plus sometimes allies talk about other players by their color names.

It would be even more awesome if lobby supported this, so i could choose own color which will be sent to this widget, but others wouldnt see it. (so i dont have to edit the script file manually whenever i feel like changing color).
Post Reply

Return to “Ingame Community”