Target triggers for PKing

Posted by Vincent on Tue 29 Apr 2003 08:04 PM — 13 posts, 43,143 views.

#0
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
Australia Forum Administrator #1
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.
Australia Forum Administrator #2
You can copy and paste the aliases above directly into the alias configuration window.
#3
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?
Canada #4
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.)
#5
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!
Australia Forum Administrator #6
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.
Amended on Wed 30 Apr 2003 08:12 AM by Nick Gammon
#7
Thanks so much
Now I see what you mean,
and it works!

#8
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
Australia Forum Administrator #9
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.
#10
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.. :)
Australia Forum Administrator #11
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>

Amended on Thu 01 May 2003 07:26 AM by Nick Gammon
#12
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