Page 1 of 1

wrong syntax? or just plain wrong?

Posted: Wed Apr 11, 2012 8:54 am
by Reiterii
Ok, so I've tried making an alias that automatically shuts of generosity, gives (whatever), then automatically put up selfishness again.

Alias pattern: ^give (.*) to (\w+)$
Code: [show] | [select all] lua
send("generosity")
temptimer( 0.8, [[send("give ]]..matches[2]..[[ to ]]..matches[3]..[[")]])
temptimer( 1.2, [[send("selfishness")]])
but for some reason it only sends generosity.

Re: wrong syntax? or just plain wrong?

Posted: Wed Apr 11, 2012 3:25 pm
by Iocun
It's tempTimer with the second T capitalized.

Re: wrong syntax? or just plain wrong?

Posted: Wed Apr 11, 2012 8:59 pm
by tsuujin
Personal perference here, but I -never- use timers for that kind of thing. Instead of a timer, I create trigger that captures all the balance regain messages, and on each check looks to see if I'm capable of casting selfishness. If I am then it casts it and deletes the trigger.

This solves issues with lag, also with people finding out you have a timer and looking for ways to exploit it.