Sample script?

Posted by Whelk on Fri 04 Nov 2011 03:04 AM — 2 posts, 15,676 views.

#0
I'm trying to figure out how to set up a simple "do x, wait, do y" script. For instance, I'd like a script to do the following:

wear shield
butcher bear
(at this point the game will send "Roundtime: X seconds" - I would like to be able to capture the numerical value for X, and then wait that number of seconds before proceeding)
remove shield
#1
You could use a trigger to capture the number of seconds and use put DoAfter() in the same trigger to do a specified action after a time.

For example:

Trigger:

^Roundtime\: (\d+) seconds$

Script:

DoAfter(tonumber("%1"), [[REMOVE SHIELD]])

and so on. That's the general idea, you'll need some setup to avoid removing the shield everytime you see that roundtime line.