Targetswitching

Posted by Orvan on Wed 24 Jan 2007 01:39 AM — 7 posts, 26,485 views.

#0
I'm using the targetting script on the script page and have to say I love it. However I have a question. I've created a monk in achaea and would like to be able to string together a full combo by using triggers. I've tried a few different things but haven't been able to figure it out. I'm guessing I would have to send the trigger to the target switching script. Is this correct? If so could you help me figure out how to do so? I haven't been able to so far.
Australia Forum Administrator #1
It helps if you paste the triggers (and code) you are using so we have an idea of what you are doing, even if it doesn't work perfectly. That way we can see the general drift of your design.

Quote:

I'm guessing I would have to send the trigger to the target switching script. Is this correct?


This part puzzles me, do you mean, if the trigger fires you want to call a script?
#2
- <muclient>
- <plugin name="TargetSwitch" author="Nick Gammon" id="2adec0ac37689537f9e3daf2" language="VBscript" purpose="Demonstrates switching targets" save_state="y" date_written="2002-11-06 09:20:06" requires="3.23" version="1.0">
- <description trim="y">
- <![CDATA[ Demonstrates how you can switch targets with a couple of aliases.

Usage
-----

t1 = person   (set target 1)
t2 = person   (set target 2)
t3 = person   (set target 3)  ... and so on up to 9 ...

t1            (choose target 1)
t2            (choose target 2)
t3            (choose target 3) ... and so on up to 9 ...

punch         (punch target)
kick          (kick target)

eg.

t1=Bill        (target 1 is Bill)
t2=Benjamin    (target 2 is Benjamin)
t1             (choose Bill)
kick           (kick Bill)
t2             (choose Benjamin)
kick           (kick Benjamin)
t1             (choose Bill again)
punch          (punch Bill)
kick           (kick Bill)
t2             (choose Benjamin again)
punch          (punch Benjamin)
kick           (kick Benjamin)


TargetSwitch:help  <-- this help

  ]]> 
  </description>
  </plugin>
- <!--   Aliases  
  --> 
- <aliases>
  <alias script="SetTarget" match="^t([1-9])\s*\=\s*(.+)$" enabled="y" regexp="y" /> 
  <alias script="ChooseTarget" match="^t([1-9])$" enabled="y" regexp="y" /> 
- <alias match="^(sdk|ucp|bbt)" enabled="y" expand_variables="y" regexp="y">
  <send>%1 @target</send> 
  </alias>
  </aliases>
- <!--   Script  
  --> 
- <script>
- <![CDATA[ sub SetTarget (sName, sLine, wildcards)
dim which, to_whom
  which = wildcards (1)
  to_whom = wildcards (2)
  world.SetVariable "target" & which, to_whom
  world.ColourNote "moccasin", "darkgreen", _
                   "Target " & CStr (which) & " now '" & to_whom & "'"
end sub

sub ChooseTarget (sName, sLine, wildcards)
  world.SetVariable "target", _
                    world.GetVariable ("target" & wildcards (1))
  world.ColourNote "moccasin", "darkgreen", _
                   "Target now '" & _
                   world.GetVariable ("target") & "'"  
end sub



  ]]> 
  </script>
- <!--   Plugin help  
  --> 
- <aliases>
  <alias script="OnHelp" match="TargetSwitch:help" enabled="y" /> 
  </aliases>
- <script>
- <![CDATA[ Sub OnHelp (sName, sLine, wildcards)
  World.Note World.GetPluginInfo (World.GetPluginID, 3)
End Sub

  ]]> 
  </script>
  </muclient>


That's the targeting script, I got that from the script page here. As a monk in Achaea I can do a combo of three attacks one right after another. Sdk,ucp,ucp.

Quote:
Target 1 now 'rat'
Target now 'rat'
sdk rat
You pump out at a rat with a powerful side kick.
You connect!
ucp rat
You launch a powerful uppercut at a rat.
You miss.
ucp rat
You launch a powerful uppercut at a rat.
You miss.
Quote:


That's an example of the targetting system and using the combo.

I'd like to do be able to just type sdk, the first attack in the combo and have the combo finish itself with triggers or a script if triggers didn't work. The problem is that I use your targeting system Mr.Gammon so I'm not sure how to get a trigger to work properly to accomplish that. Does that cover everything you need?
#3
Yes but

sdk
ucp
ucp

is mostly a basic combo for hunting.

Lets say you wanted to do a few different combos and use simple keys to send those combos, such as:

"c"
sdk
ucp
ucp

"x"
mnk
spp
spp

"z"
snk
hfp
hfp

These are 3 examples of different combos that a Monk can do among several others. Can you help us out?
Australia Forum Administrator #4
I don't fully understand the question, sorry. Can you rephrase it?
#5
You have already selected a target through the target-switching system ('rat') and wish to execute three moves in succession on the same target, correct?

Here's what I would do. Set an alias for the name of the combo ('kuu' for Kick-Uppercut-Uppercut), and have the alias set like this:

sdk @target
ucp @target
ucp @target

So every time you type 'kuu', those three commands are sent to the world, to be executed on whatever target you had selected via the target-switching system.

The situation becomes harder if you have to recover your balance in between each attack, however, but your text example from the MUD does not show this.
#6
I was half-replying to the OP, sorry about that (didn't see the date).

Once you have set aliases for each combo, place those aliases in Macros, such as F1, F2, etc.