Page 1 of 1

Lobby scripting thread

Posted: 05 Aug 2009, 19:24
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()

Re: Lobby scripting thread

Posted: 15 Aug 2009, 04:01
by SinbadEV
sweet... now people won't have to put any effort into spamming the lobby...

Re: Lobby scripting thread

Posted: 15 Aug 2009, 04:05
by aegis
scripting has been around for over a year :P

Re: Lobby scripting thread

Posted: 15 Aug 2009, 12:45
by [TS]Lollocide
Time to scripting being disabled:

23:59:57.
23:59:56.
23:59:55.
...

Re: Lobby scripting thread

Posted: 15 Aug 2009, 23:32
by aegis
nah, we can just ban abusers... so it's all good.

Re: Lobby scripting thread

Posted: 09 Mar 2010, 06:55
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()

Re: Lobby scripting thread

Posted: 09 Mar 2010, 10:21
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

Re: Lobby scripting thread

Posted: 09 Mar 2010, 10:58
by Neddie
I've never used any custom scripts, on you or otherwise. I don't even use TASC.

Re: Lobby scripting thread

Posted: 09 Mar 2010, 11:52
by Auswaschbar
Springlobby has auto-reconnect :roll:

Re: Lobby scripting thread

Posted: 09 Mar 2010, 11:55
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?

Re: Lobby scripting thread

Posted: 09 Mar 2010, 14:45
by slogic
Auswaschbar wrote:Springlobby has auto-reconnect :roll:
It's buggy under Windows: http://www.springlobby.info/issues/1161

Re: Lobby scripting thread

Posted: 09 Mar 2010, 15:23
by Satirik
Auswaschbar wrote:Springlobby has auto-reconnect :roll:
tasclient has internet 8)

Re: Lobby scripting thread

Posted: 09 Mar 2010, 15:29
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

Re: Lobby scripting thread

Posted: 09 Mar 2010, 15:34
by Beherith
Hit reset layout.

Re: Lobby scripting thread

Posted: 09 Mar 2010, 15:59
by Satirik
Beherith wrote:Hit reset layout.
or show them back using Options -> View

Re: Lobby scripting thread

Posted: 12 Mar 2010, 18:31
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.

Re: Lobby scripting thread

Posted: 12 Mar 2010, 18:53
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.

Re: Lobby scripting thread

Posted: 12 Mar 2010, 19:58
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).

Re: Lobby scripting thread

Posted: 12 Mar 2010, 21:10
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).