Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Tips and tricks ➜ Target triggers for PKing

Target triggers for PKing

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Vincent   (4 posts)  Bio
Date Tue 29 Apr 2003 08:04 PM (UTC)
Message
Hello,
I used to use GMud, and a bit of Zmud, just that Zmud is slow, which is why I decided to switch to Mushclient which is supposedly much better.
I'm trying to use a script to which allows me to 1. target at people ( targ Bill), but it will also allow me to chase well, such as when I go north (by typing n), it will make me go one north as well as doing a skill/ spell (eg
ca 'hellstream' Bill.)
Normally, what I do is simply copy and paste ca 'hellstream
Bill into my aliases n, e, s, w. But then it takes me ages to change it if I want to change a spell or something. I tried modifying Nick's code for targetting, but I couldnt change it. :(
Any help?

Thanks
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 30 Apr 2003 02:37 AM (UTC)
Message
First, this alias will set up the target for you:


<aliases>
  <alias
   match="targ *"
   enabled="y"
   variable="target"
   send_to="9"
   sequence="100"
  >
  <send>%1</send>
  </alias>
</aliases>


As for the other thing you describe, it seems you want to go north/south etc. *and* do something (like ca 'hellstream' Bill).

What I suggest is an "extra" thing which could be stored in another variable, let's call it 'extra' like this:


<aliases>
  <alias
   match="^extra(.*?)$"
   enabled="y"
   variable="extra"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>SetVariable &quot;extra&quot;, trim (&quot;%1&quot;)
Note &quot;Extra thing is now: %1&quot;</send>
  </alias>
</aliases>


Thus you might type:


extra ca 'hellstream' Bill


This defines the extra thing you want to do when you go north/south etc. To do nothing, just type:


extra


Then you need a movement alias that will pick up the movement commands (this will pick up the numeric keypad as well), and do the extra bit, like this:


<aliases>
  <alias
   match="^(n|north|s|south|e|east|w|west|up|down)$"
   enabled="y"
   expand_variables="y"
   regexp="y"
   sequence="100"
  >
  <send>%1
@extra</send>
  </alias>
</aliases>



This uses a regular expression to match on "north", "n" and so on, and resends it (%1, the first wildcards) and then sends @extra on new line, with expand variables checked, it will be whatever the "extra" variable has in it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #2 on Wed 30 Apr 2003 02:38 AM (UTC)
Message
You can copy and paste the aliases above directly into the alias configuration window.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Vincent   (4 posts)  Bio
Date Reply #3 on Wed 30 Apr 2003 06:32 AM (UTC)
Message
Hi Mr. Gammon
Thanks for the reply. I am sure it will work and help, just that I do not know where to paste the scripts you just wrote. You said into the alias configuration window, but I do not see a place to put the script in apart from the "SEND" space, which is probably not right.

Again, sorry for my stupid questions, but what do I do?
Top

Posted by Magnum   Canada  (580 posts)  Bio
Date Reply #4 on Wed 30 Apr 2003 07:02 AM (UTC)
Message
Yes, put it in the Send space, but below, use the Send To: drop down box and select Script.

You must have scripting turned on for this functionality to work. Press SHIFT-CTRL-6 to bring up the scripting configuration interface, and check the box named Enable script. (You may also need to indicate the scripting language. Almost all examples here are Visual Basic Script.)

Get my plugins here: http://www.magnumsworld.com/muds/

Constantly proving I don't know what I am doing...
Magnum.
Top

Posted by Vincent   (4 posts)  Bio
Date Reply #5 on Wed 30 Apr 2003 07:45 AM (UTC)
Message
Sorrry again, to Magnum and Nick for asking these questions but its the first time I really do scripting. I usually use Gmud..

Okay, I guess we can forget about the target trigger since we have the nice extra and movement one. Now what I do not get it:

1. The 'extra'( refer above) is to be placed under an alias . I paste that little script into the Send box, and for Send To: Scripts. What is the name I put for the alias though. ( the first slot). To use this 'extra' I just type
extra <skill> person?

2. For the movement alias, what is the name of the alias going to be when I create it, or does it go with the 'extra' alias. And again, I just paste the script into a send box and so forth?

My problem is that everytime i type extra something, it goes Huh?

Thanks a lot guys!
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #6 on Wed 30 Apr 2003 08:09 AM (UTC)

Amended on Wed 30 Apr 2003 08:12 AM (UTC) by Nick Gammon

Message
What I meant was, if you copy from <alias> to <aliases> and then go to the alias configuration - the initial screen with the list of aliases - there is a "paste" button that should be active if it detects an alias on the clipboard.

Just hit "paste". Repeat for the other ones.

You need a reasonably recent version that supports inline scripting, and as Magnum says, make sure that "enable script" is checked in the script configuration section.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Vincent   (4 posts)  Bio
Date Reply #7 on Wed 30 Apr 2003 09:32 AM (UTC)
Message
Thanks so much
Now I see what you mean,
and it works!

Top

Posted by Pker   (1 post)  Bio
Date Reply #8 on Wed 30 Apr 2003 12:58 PM (UTC)
Message
Thats actually a really nice script, I knod of have the same one..
The only problem I have is that I just can't seem to make the targetting trigger work. What I mean is this, I usually have my macros set up so F1= extra dirt bob F2= extra bash bob.....

This makes it easy for me to pk Mr. BOB. The only thing I cant do is to kill more than one person quickly, that is if Bob dies and Tom comes in, I have to change all my macros to Tom which takes too long. I tried making a target trigger and then type extra dirt @target, doesnt work.

So, the floor is yours ! :)

PS. You guys are just.. great
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #9 on Thu 01 May 2003 01:01 AM (UTC)
Message
What I would do in this case is make the "extra" alias tack on the name of the person who you are trying to get. Then you can make all of your function keys just "extra dirt", "extra bash", "extra kick" and so on.

The alias would look like this:


<aliases>
  <alias
   match="^extra(.*?)$"
   enabled="y"
   variable="extra"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>SetVariable &quot;extra&quot;, trim (&quot;%1&quot;) &amp; _
            &quot; &quot; &amp; GetVariable (&quot;target&quot;)
Note &quot;Extra thing is now: &quot; &amp; GetVariable (&quot;extra&quot;)</send>
  </alias>
</aliases>


It pulls in the "target" variable and adds it to the end of what you have after "extra".

Then what you would do is type: "targ Bob" to set Bob as the target, and then "extra kick". You then see this:


Extra thing is now: kick Bob



Now make your function keys F2 and so on just have the "extra X" in them.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Zain   (2 posts)  Bio
Date Reply #10 on Thu 01 May 2003 07:05 AM (UTC)
Message
Hi,
I was looking at these aliases and all and they seemed very interesting to me.
I actually tried out the last one you put, and it works. Just that the target one doesnt seem to work. So what I did was I copied off some of the script on your extra and and put it into the target alias, like this :

<aliases>
<alias
match="targ *"
enabled="y"
variable="target"
send_to="12" <------ changed here from 9 to 12
sequence="100" changed the send part
>
<send>SetVariable &quot;target&quot;, trim (&quot;%1&quot;)
Note &quot;Target is now: %1&quot;</send>

</alias>
</aliases>

Okay, now I can target and the last extra alias script works. Just that when I want to stop the extra, I type extra <blank>, and but it still inputs my target into it.

So, targ Jim, extra kick...
When I stop it--> (extra <blank> and type n)--> n, Jim

What should I do?
If this is too much trouble, just dont reply.. :)
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #11 on Thu 01 May 2003 07:11 AM (UTC)

Amended on Thu 01 May 2003 07:26 AM (UTC) by Nick Gammon

Message
Good point. You need to test for an empty "extra" thing, and if it is empty, don't append the name. Like this:


<aliases>
  <alias
   match="^extra(.*?)$"
   enabled="y"
   variable="extra"
   regexp="y"
   send_to="12"
   sequence="100"
  >
  <send>if trim (&quot;%1&quot;) &lt;&gt; &quot;&quot; then
  SetVariable &quot;extra&quot;, trim (&quot;%1&quot;) &amp; _
              &quot; &quot; &amp; GetVariable (&quot;target&quot;)
  Note &quot;Extra thing is now: &quot; &amp; GetVariable (&quot;extra&quot;)
else
  SetVariable &quot;extra&quot;, &quot;&quot;
  Note &quot;Extra thing is now empty.&quot;
end if</send>
  </alias>
</aliases>


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Zain   (2 posts)  Bio
Date Reply #12 on Thu 01 May 2003 07:44 AM (UTC)
Message
Hey, thanks a lot Nick,
It works, you are a genius! I just cant see how people can learn to script/ program so well. The most I know is coding in HTML :(

Thanks again
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


33,012 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.