|
Deneir Beginner
Joined: 14 Feb 2003 Posts: 19 Location: USA
|
Posted: 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.... |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: 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 |
|
|
|
Deneir Beginner
Joined: 14 Feb 2003 Posts: 19 Location: USA
|
Posted: 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
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: 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 |
|
|
|
Deneir Beginner
Joined: 14 Feb 2003 Posts: 19 Location: USA
|
Posted: Fri Feb 14, 2003 1:06 pm |
Okies got all that thanks again :)
|
|
|
|
Deneir Beginner
Joined: 14 Feb 2003 Posts: 19 Location: USA
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: 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 |
|
|
|
|
|