|
dracx Beginner
Joined: 14 Oct 2000 Posts: 26 Location: USA
|
Posted: Mon Mar 18, 2002 3:33 pm
Trigger Help |
What I would do here is set up a variable on a timer. If the output occurs, use that to change the variable. Then use a timer or an alarm to perform the 'something else' action if the variable is unchanged. Lemme see if I can work something up...
#va myvar 0
#TR {output} {first response;#va myvar 1}
#alarm +5 {#IF @myvar=0 {do this} {do that}}
I just woke up, so I hope that makes sense to you.
What's happening is the alarm is going to go off and check that variable. If it's zero, that means the trigger never fired, and therefore, it needs to perform it's action.
Dracx |
|
|
|
dracx Beginner
Joined: 14 Oct 2000 Posts: 26 Location: USA
|
Posted: Mon Mar 18, 2002 4:58 pm |
What do you want to happen if the item is found?
And what if it's not found?
#AL searchfor {
#va itemfound 0
search for %1
#ALARM +5 {
#If @itemfound=1 {
put what you want to do with the item here} {
This is where you put want you want if the item Is NOT found}
#TEMP {you find a whateveritisyouarelookingfor} {
#va itemfound 1}}}}
There... I think I got the brackets correct on that. You'll need to adapt it to your particular mud's commands though.
Dracx |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Mar 18, 2002 5:40 pm |
Assuming that you want to continue searching for an item that is there, you can set a trigger to do that. If the item is present and you don't find it, the trigger will go off and you'll continue searching. Since there is no response when the item isn't in the room, the trigger won't go off when it's not there and you'll only search once. Replace the "search" command with an alias so that you can put the item being searched for in a variable.
#AL search {#VAR SearchItem %1;~search %1}
#TR {you don't find anything} {search @SearchItem}
LightBulb
All scripts untested unless otherwise noted |
|
|
|
|
|