|
RobMacAF Apprentice
Joined: 09 Jun 2002 Posts: 186 Location: USA
|
Posted: Mon Jul 14, 2003 9:33 pm
Capturing a line before the current one |
When I am sneaking it works like this....
sneak e
>
Roundtime: 10 sec.
You sneak east...
I type sneak e, then it says roundtime, then that I sneak.
I have a trigger that triggers on You sneak *...
But I want it to capture the Roundtime number above it
So in this case it would trigger on You sneak *... and will save 10 to WaitTime
This is possible isn't it? |
|
|
|
Humpton Apprentice
Joined: 10 Oct 2000 Posts: 158 Location: Chicago, IL
|
Posted: Mon Jul 14, 2003 10:04 pm |
Maybe there's a cleverer way, but what I would do is capture the 'Roundtime number' everytime it goes past and then use it from a trigger on 'You sneak...' and then you could start your countdown timer (that's what you do, right?).
|
|
|
|
redmop Newbie
Joined: 14 Jul 2003 Posts: 9
|
Posted: Mon Jul 14, 2003 10:46 pm |
I can think of two ways to do it.
First, trigger on every time roundtime shows up and every time you sneak...
Code: |
#TRIGGER {Roundtime: (%d) sec.} {waittimetemp = %1}
#TRIGGER {You sneak *...} {waittime = @waittimetemp}
|
Second, use the new advanced triggers to trigger on every roundtime, then activate waittime if 'you sneak' shows up in the next 5 lines or so.
Code: |
#TRIGGER {Roundtime: (%d) sec.} {}
#COND {You sneak *...} {waittime = %t1} {Within|Param=5}
|
And if you want to get real fancy, make the triggers turn themselves off, and the sneak command turn them on if you want to minimize the number of running triggers.
Let me know how it works.
Red Mop |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Mon Jul 14, 2003 11:17 pm |
Playing on a mud with roundtime like that I would suggest you always capture it. As you get further development in your script I am sure you will find other occasion when you need to know what it is/was. The method I would suggest for capturing it would be:
#TR {^Roundtime: (%d) sec.$} {#ALARM "RTalarm" {+%1} {#NOOP}}
Then when ever your scripts need to know the current round time they can use the %alarm function. |
|
|
|
|
|