MUSHclient scripting

Posted by AEthan on Tue 01 Sep 2009 06:23 PM — 11 posts, 43,904 views.

#0
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".
USA #1
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.
Australia Forum Administrator #2
Also a YouTube video for a targetting alias, which is similar to what you want:

Template:post=9616
Please see the forum thread: http://gammon.com.au/forum/?id=9616.
#3
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?
Australia Forum Administrator #4
I prefer to see the whole trigger rather than a free-format description of it.

Template:copying
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.
#5
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?
Australia Forum Administrator #6
Not sure I understand that question. Please post your existing alias, so I can see what you currently have.
#7
<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?
Australia Forum Administrator #8
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")

Australia Forum Administrator #9
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>


Template:pasting
For advice on how to copy the above, and paste it into MUSHclient, please see Pasting XML.

#10
Thank you very much.