Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Eyeless
Wanderer


Joined: 02 Dec 2001
Posts: 80
Location: Canada

PostPosted: Thu Jan 22, 2004 4:07 pm   

Possible bug, or problem with my coding?
 
trigger 1:

#co red,bold
#if (@countorb <1) {#var countorb 1}
#if (@countorb >5) {#var countorb 1}
#if (@countorb = 5) {
#alarm (+@blah) {
prepare es
#wait 1000
focus my orb
}
} {cho}
#add countorb 1

Trigger #2:

#co red,bold
#alarm (+@blah) {
#wait 1000
cast
}

Trigger #3:

#co red,bold
charge orb 3

Alias cho:

#alarm (+@blah) {
#wait 1000
charge orb 3
}

Now this is supposed to create a loop that will (until stoped) just keep Charging this orb and casting a spell... but for some reason it runs through once or twice and then an alarm seems to get stuck in triggers (where alarms go when fired) that never ever fires... and until I delete this alarm, the 'script' wont work.

Any help on what Im doing wrong... I have same problem on a few others like this
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Thu Jan 22, 2004 9:42 pm   
 
#WAIT is probably causing problems. There's an article on the Support Library page, written by Zugg, titled Timers, Alarms, and the WAIT Command. In it, he explains why using #WAIT in triggers is a bad idea. For now, let me just repeat the same warning that's been stated over and over in this forum:
DON'T USE #WAIT IN TRIGGERS
This also includes aliases which are called by triggers.

You can easily modify the alarms which start with #WAIT to add the second to the alarm-time instead. The one which has #WAIT in the middle will need a second alarm. You'll have to fill in the trigger patterns yourself since you didn't bother to put them in your question. For now I've just used your numbers as the patterns.

#TR {1} {#CO red,bold
#IF (@countorb < 1) {#VAR countorb 1}
#IF (@countorb > 5) {#VAR countorb 1}
#IF (@countorb = 5) {
#ALA (+@blah) {
prepare es
#ALA +1 {focus my orb}
}
} {cho}
#ADD countorb 1}

#TR {2} {#CO red,bold
#ALA +%eval( @blah + 1) {cast}}

#TR {3} {#CO red,bold
charge orb 3}

#AL cho {#ALA +%eval( @blah + 1) {charge orb 3}}
Reply with quote
Eyeless
Wanderer


Joined: 02 Dec 2001
Posts: 80
Location: Canada

PostPosted: Fri Jan 23, 2004 2:15 pm   
 
Your way works much smoother, thanks.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net