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
Lowe
Newbie


Joined: 13 Jan 2006
Posts: 3
Location: Corona Ca

PostPosted: Fri Jan 13, 2006 8:40 pm   

Help Anyone?
 
I have been looking for a fix to this problem for a couple of days and finally resorted to posting here to see if anyone knows what i'm doing wrong. Heres the script,

#ALARM {-00:20:00} {trackchange} "Temp"
#CLASS {Temp|Track1} {enable}
#TRIGGER {trackchange} {
#t- track1
#t+ track2
}
#CLASS 0
#CLASS {Temp|Track2} {disable}
#TRIGGER {trackchange} {
#t- track2
#t+ track3
}
#CLASS 0
#CLASS {Temp|Track3} {disable
#TRIGGER {trackchange} {
#t- track3
#t+ track4
}
#CLASS 0
#CLASS {Temp|Track4} {disable}
#TRIGGER {trackchange} {
#t- track4
#t+ track5
}
#CLASS 0
#TRIGGER {trackchange} {
#t- track5
#t+ track1
}
#CLASS 0

What i was trying to make was an alarm that every 20 mins would disable one class and enable the other, but instead what happens is it loops! all the triggers in the disable classes execute looping it back to the first class of track1, what am i doing wrong?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sat Jan 14, 2006 12:44 am   
 
The simple fact that when a line containing "trackchange" is received it will trigger whichever of your posted triggers is enabled, then turn off that class and turn on the next. That trigger that just became enabled is added to those to be tested, and ofcourse fires for the same text since that is what your pattern indicates, this repaeats enough times to hopefully have a loop detected by zMud causing the dialog suggesting you disable triggers.

Perhaps you should tell us what you really want to do, and we can suggest a few different method to do it.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Lowe
Newbie


Joined: 13 Jan 2006
Posts: 3
Location: Corona Ca

PostPosted: Sat Jan 14, 2006 1:56 am   
 
Each different track class is a script for tracking a different mob. What i was trying to create is a script that tracks a certain kind of monster and then after a period of time disables itself and begins to track a different monster. That is how i came up with this script, the way i wanted it to work was to have the alarm trigger the disabling of one track class to the other.Sp o would have the command "trackchange" do exactly what it says change the mob that i'm tracking. I had set up each mob to track as a class beginning with track1 and then ending in track5. So instead of having it loop i would like for everytime the alarm goes off only one track class would be disabled and then enable the next class.
Reply with quote
Vorax
Apprentice


Joined: 29 Jun 2001
Posts: 198
Location: USA

PostPosted: Sat Jan 14, 2006 7:15 am   
 
Code:
#ALARM "trackchange_alarm" {*00:20:00} {trackchange}
#VARIABLE CurrentTrack 1
#ALIAS trackchange {
  #T- track{@CurrentTrack}
  #ADD CurrentTrack 1
  #IF (@CurrentTrack = 6) {CurrentTrack = 1} {#NOOP}
  #T+ track{@CurrentTrack}
}

Off the top of my head, this might or might not work. What it does is sets the alarm to fire every 20 minutes which fires the alias "trackchange". The alias then disables the current track, increments the variable CurrentTrack, then enables the next track after checking to see if the variable is within the correct range. If it has reached the limit, it is then reset to the original value of 1. The alarm can be disabled via a "#T- trackchange_alarm" command from the command line, manually disabled, or by an alias you may want to create to control it. I hope this helps, and if not, I'm sure someone else can point out what's wrong with it and fix it for you.
The #NOOP in the #IF is just there because I don't like to leave an #IF empty.
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