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


Joined: 08 Feb 2004
Posts: 6

PostPosted: Fri May 21, 2004 1:06 pm   

IF's, COND's, and TEMP's, Oh my
 
okay this is for a alias named "defup3". What it should do is look and see if @splitmind is false and if it is, execute "split mind" and "def" then abort the alias, then when the message "You have recovered equilibrium." comes up run the defup3 alias again (presumablably with @splitmind=1 this time) and continue with the rather lengthy rest of the alias containing similar statments, however what happens is when the "You have recovered equilibrium." comes up, not a dang thing happens. ANY help would be greatly appreciated. Thanks. Here's the code.

#if @splitmind=0 {
split mind
#temp {You have recovered equilibrium.} {defup3}
#abort 1
} {}
#if @deathsight=0 {
deathsight
#cond {You have recovered equilibrium.} {defup3}
#abort 1
} {}
....and so on and so on
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Fri May 21, 2004 1:43 pm   
 
Try reading the article on Advanced Triggers in the Support section. Your deathsight portion is using the #COND command incorrectly, and could have adverse side affects (or more likely, no effects at all).

Some people use temp triggers for deffing up and others use multi-state triggers with #COND, but it's really a matter of personal preference, I suppose.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri May 21, 2004 7:11 pm   
 
quote:
if @splitmind is false and if it is, execute "split mind" and "def"

You have the "split mind" command but you left out the "def" command.

#CONDITION adds a state to the last trigger created. You don't want to add states to random triggers which have nothing to do with those triggers, and you also don't want to add infinite numbers of states. This alias will add a state to some trigger every time that @splitmind <> 0 and @deathsight = 0. Don't use #CONDITION unless you know what trigger it will add to.

You have a problem which is related to recursive scripting. The script of your TEMP trigger includes the ALIAS defup3. The TEMP doesn't complete its script until the ALIAS is finished, right after your ABORT command, at which time it promptly deletes itself. Since the last command in each section of your ALIAS probably includes another identical TEMP trigger, they get deleted as fast as they get made. The result is that your alias will probably only succeed in making the TEMP trigger every other time it runs.

A better solution might be a permanent trigger with a variable that tells it what to do.
#TR {You have recovered equilibrium} {#IF (@equil) {#EXEC @equil} {#NOOP}}
#AL defup4 {
#IF (@splitmind = 0) {
split mind
#VAR equil defup4
#ABORT 1
}
#IF (@deathsight = 0) {
deathsight
#VAR equil defup4
#ABORT 1
}
#VAR equil 0
}
The last command in the alias should set @equil to a null-string or 0, so you don't come back to the alias again after everything is done.
Reply with quote
Planirten
Newbie


Joined: 05 Oct 2003
Posts: 5
Location: Australia

PostPosted: Sat May 22, 2004 4:00 am   
 
I'm having trouble with the most basic of triggers, it just doesn't seem to work...


#TRIGGER {{Y|*}ou eat a goldenseal root.} {#noop}
#COND {(%d)h, (%d)m *} {GoldensealReset} {within|param=1}

Goldenseal just resets a bunch variables to 0...
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat May 22, 2004 6:59 am   
 
Please start a New Topic with your question. It has little, if any, bearing on the current topic.
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