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
fisban_Regner
Beginner


Joined: 05 Nov 2020
Posts: 14

PostPosted: Fri Nov 13, 2020 5:44 pm   

alise that waits
 
I'm sure this has been asked before but i cant seem to find it.
i want to create an alias that waits for a variable input before it continues to the next step.
i have a trigger that sets balance to 1

alias fly
command 1
#var balance 0
wait for balance to = 1
command 2
#var balance 0
wait for balance = 1
command 3
#var balance 0
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Fri Nov 13, 2020 8:49 pm   
 
An alias is fine to start this, but you want an expression trigger to finish it.

commandList=command 1|command 2|command 3

#TR {@balance=1} {#EXEC %pop(commandList);balance=0}

Make sure you change the type of the trigger to expression in the GUI or it won't work.
_________________
Discord: Shalimarwildcat
Reply with quote
fisban_Regner
Beginner


Joined: 05 Nov 2020
Posts: 14

PostPosted: Fri Nov 13, 2020 10:42 pm   
 
ok i think i understand this please correct me if I'm wrong. sorry i don't have syntax memorized i still use the gui to create triggers.
so i make an alias
fly
command 1
balance = 0
commandlist = command2|command3|command4


i make a trigger
you recover balance
balance = 1
#exec %pop(commandlist)
balance = 0




so the %pop removes the first item in the list while it being executed
causing the trigger to step through the list
now i could even go further and use other aliases to add items to this list using %push(@commandlist,"stand") ? //edited
if that is written correctly then %additem(@commandlist,"stand") would add it to the end?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Fri Nov 13, 2020 10:58 pm   
 
Yes, that is correct.
_________________
Discord: Shalimarwildcat
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