Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Mar 17, 2010 4:28 pm |
You should store %lastinput into a local variable and then use it in your #WAITFOR step. Also store the Door value into a local variable because this trigger might fire more than once with different matching door values. Because remember that while #WAITFOR is waiting, other commands, scripts, MUD input, etc can all be processed and by the time the #WAITFOR trigger fires, the %lastinput might have changed. If you use local variables and only read (not change) global variables, then there is no problem using #WAITFOR. So something like this:
Code: |
Pattern: ^The (%w) seems to be closed.$
Script:
$door = %1
$lastinput = %lastinput
open %1 $lastinput
#WAITFOR {It seems to be locked.$} 1000 {
unlock $door $lastinput
#WAITFOR {~*Click~*$} 1000 {
open $door $lastinput
#SEND $lastinput
}
} {#SEND $lastinput} |
|
|