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


Joined: 14 Feb 2003
Posts: 19
Location: USA

PostPosted: Fri Feb 14, 2003 10:26 am   

Help with Alias + Trigger + Vari Combo
 
Ive hit a slump ive tried a bunch of things but i cant seem to get this to work maybe it isnt possible but id say it is because its a pretty simple idea.
What im trying to do is create a trigger using an alias and using variables to set the triggers info (Somone just went HUH???) Heres what ive gotten to work:
1) I set a trigger to capture the text i want for an auto donate trigger #trigger {You get (*).} {#vari Got {You get %1.}} that works fine sets the get prompt as the @Got variable so far so good. Then i try and do this #alias AD {#prompt Donate "Whats base name of item?";#wait 200;#trigger {^@GOT} {donate @Donate} what I want it to make is a trigger that looks like this #Trigger {^You get a stale cookie.} {donate cookie} but what i get is #trigger {^@Got} {Donate @Donate} ive tried %expand and a few other things and im stumped any help would be extremely appreciated thanks.

The Shadows of the world will on day inhabit true form and dominate all your souls....
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Feb 14, 2003 12:35 pm   
 
You are going to have to use a trick with #EXEC to force expansion. Use this instead of the #TRIGGER command in the alias:
#EXEC {%concat("#TRIGGER {^", @got, "} {donate ", @donate, "}")}

Also, the #WAIT does not seem to be necessary in the alias for anything, and it is generally not recommened that it is used.


Kjata
Reply with quote
Deneir
Beginner


Joined: 14 Feb 2003
Posts: 19
Location: USA

PostPosted: Fri Feb 14, 2003 12:40 pm   
 
Excelent it worked now i have to look up what you posted so i know what excactly it did :) thank you. Ow and the #wait i put in place is because i was not sure if the Trigger would add before i typed it into the prompt so put the wait to make sure it didnt mess with the trigger

Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Feb 14, 2003 12:58 pm   
 
You don't need the wait, #PROMPT will pause the script until you enter something.

What the command I posted does is to execute whatever is returned by the %concat function just as if you had typed it into the command line. The %concat function concatenates various strings into one. In this case, it adds "#TRIGGER {^" to the value of @got with "} {donate " and the value of @donate and then adds "}" at the end. So the final string is:
"#TRIGGER {^You get a stale cookie.} {donate cookie}"

#EXEC then executes this.

Kjata
Reply with quote
Deneir
Beginner


Joined: 14 Feb 2003
Posts: 19
Location: USA

PostPosted: Fri Feb 14, 2003 1:06 pm   
 
Okies got all that thanks again :)

Reply with quote
Deneir
Beginner


Joined: 14 Feb 2003
Posts: 19
Location: USA

PostPosted: Sun Feb 23, 2003 6:32 pm   
 
#alias Test {#trigger {<@Test>} {<@Test2>}
Figured out that < and > expand variables in triggers was actually in the help file :)

Got Mud?
HTTP://www.angelfire.com/rpg/EssexClan/Necro.html
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Feb 23, 2003 6:36 pm   
 
Yes, but it does not work well inside of loops, so I tend not to use that.

Kjata
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