Hi I'm pretty new to this program and I would love to get into scripting but I have no clue how. Can anyone help me? I have a specific question right off the bat. Is it possible to create a varriable in one trigger that can be used in another trigger. I.E. I'm trying to make "chase trigger".
MUSHclient scripting
Posted by AEthan on Tue 01 Sep 2009 06:23 PM — 11 posts, 43,904 views.
http://www.mushclient.com/scripting has a decent walkthrough (with old screen shots, but the content is still applicable) that can show you the basics.
http://www.gammon.com.au/forum/?id=9626 has a more current version Nick did on Youtube if you'd rather have a video walkthrough.
http://www.gammon.com.au/forum/?id=9626 has a more current version Nick did on Youtube if you'd rather have a video walkthrough.
Also a YouTube video for a targetting alias, which is similar to what you want:
Please see the forum thread: http://gammon.com.au/forum/?id=9616.
Ok now i've set up this targeting alias and everything is set now I want to follow the target and imediatly backstab the target if it flees. I just need to know if this is right. So I set up a trigger that in the "Trigger:" field it says @target walks *. then under send I have
%1
backstab @target
Will this work? I just don't know if the target variable will work with other things or just the allias. and what is the wildcard? Is it %1 or %2 since I already have a variable made?
%1
backstab @target
Will this work? I just don't know if the target variable will work with other things or just the allias. and what is the wildcard? Is it %1 or %2 since I already have a variable made?
I prefer to see the whole trigger rather than a free-format description of it.
However to answer your question about %1, each asterisk becomes a wildcard, thus "@target walks *." will make the direction %1. The variable @target is not a wildcard.
If this still doesn't work please post the whole thing (as per the link above). Stuff like whether various options are checked are relevant to the answer.
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.
However to answer your question about %1, each asterisk becomes a wildcard, thus "@target walks *." will make the direction %1. The variable @target is not a wildcard.
If this still doesn't work please post the whole thing (as per the link above). Stuff like whether various options are checked are relevant to the answer.
The trigger actually works but now I have a different question. Instead of using t * for the allias I have used kill * but I want to add to the script that sends the command kill @target. How do I do that?
Not sure I understand that question. Please post your existing alias, so I can see what you currently have.
<aliases>
<alias
match="tar *"
enabled="y"
expand_variables="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>SetVariable ("target", "%1")
ColourNote ("white", "black", "Target is now: %1")
SetStatus ("Target: %1")
</send>
</alias>
</aliases>
Ok instead of match="tar *" I want to put match="kill *" and then because that replaces the kill command I would like to after the SetVariable, ColourNote, and SetStatus have completed I wish to send the command "kill" to the world. How may I do that?
<alias
match="tar *"
enabled="y"
expand_variables="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>SetVariable ("target", "%1")
ColourNote ("white", "black", "Target is now: %1")
SetStatus ("Target: %1")
</send>
</alias>
</aliases>
Ok instead of match="tar *" I want to put match="kill *" and then because that replaces the kill command I would like to after the SetVariable, ColourNote, and SetStatus have completed I wish to send the command "kill" to the world. How may I do that?
You don't need "expand variables" now because there aren't any variables in the alias. Anyway, to send something you use Send, so the amended script part would be:
SetVariable ("target", "%1")
ColourNote ("white", "black", "Target is now: %1")
SetStatus ("Target: %1")
Send ("kill %1")
And the whole thing would look like:
<aliases>
<alias
match="kill *"
enabled="y"
send_to="12"
ignore_case="y"
sequence="100"
>
<send>
SetVariable ("target", "%1")
ColourNote ("white", "black", "Target is now: %1")
SetStatus ("Target: %1")
Send ("kill %1")
</send>
</alias>
</aliases>
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.
Thank you very much.