|
Wilderop Newbie
Joined: 05 Jun 2001 Posts: 5 Location: USA
|
Posted: Sat Dec 01, 2001 6:35 am
Problem with #wait |
This is a script to continue fishing and every so often put your fish in your basket.
It was working until I had to add the second wait statement to put a delay on how often you put your fish away. Can anyone make a suggestion on how to get it to work?
#CLASS {fish}
#VAR fish {0}
#VAR waitingtoputaway {1}
#TRIGGER {{Your line gets tangled during the cast!|The fish breaks away from your line!|You catch|You try to set the hook, but it escapes.}} {
#wait %random( 500, 8000)
fish
#var fish {1}
}
#TRIGGER "%if(@fish)" (@fish = 1) {
#var fish 0
#if (@waitingtoputaway = 0) {
#var waitingtoputaway {1}
#wait %random( 300000, 600000)
put all.fish basket
#var waitingtoputaway {0}
}
}
#CLASS 0
Where there is a Wilderop there is a way |
|
|
|
WarChild Novice
Joined: 15 Jul 2001 Posts: 31 Location: USA
|
Posted: Sat Dec 01, 2001 9:32 am |
Ok I'm not that good with zmud, I admit.. but, I put both those
in, to see if I could stumble on what was going on.
Here's what I found.
When I echoed the 'Your line gets snagged', it worked. It did the command fish
and waitingtoputaway = 0
So that fails it. Since waitingtoputaway is sticking at 0 UNLESS you echo @fish = 1 (which by the way, will actually come up 1=1)
THEN waitingtoputaway goes to 1 and it does in fact then do 'put all.fish'
Looks like you need something that echoes @fish = 1 to budge your waitingtoput |
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Sun Dec 02, 2001 11:06 pm |
WarChild's right. the pattern for the second trigger probably never comes up while your fishing. i recomend starting a while loop that looks something like this:
#while 1 {
#wait %random( 30000, 60000)
#if @fish {put all.fish basket;fish = 0}
}
and then just stopping the loop manually with the escape key when your done fishing.
|
|
|
|
Darker GURU
Joined: 24 Sep 2000 Posts: 1237 Location: USA
|
Posted: Mon Dec 03, 2001 3:29 pm |
#wait is bad. #wait should not be used. Use #alarm instead. #wait will not be supported in future versions of zMUD, because it does bad things.
Didja know that a #wait prevents zMUD from handling other triggers/processing until the #wait is done? Baaaad.
zMUD 6 Online Help: All the power you'll ever need. |
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Mon Dec 03, 2001 8:58 pm |
um, thats awful news for me. just about every script i write has #wait in it. since most of my alias's need feedback from the mud to make decisions, i find it #wait an excellent way to hang the alias while buffers are zinging back and forth. also, your statements a little misleading, because #wait doesnt prevent other triggers from firing, just halts the execution of whatever trigger its placed in. the version #wait is taken out of is the version i'm going to have to stop upgrading at, i guess
|
|
|
|
|
|