Targets

Posted by Kresslack on Tue 29 Apr 2008 12:52 AM — 17 posts, 74,114 views.

#0
What targeting system is used with Mush, or does it automaticly recognize and use internal targets for each mud? For instance, I play a mud where to target something, you type TT <target> and then any aliases you have set to act towards your current target will fire off as you initate them. Some clients require special targetting scripts however.
Australia Forum Administrator #1
See http://mushclient.com/faq points 21 and 22.
#2
doesn't seem to be working. Can you walk me through how I would set up a system for @target, where everytime I type t <target> it will adjust and show up on my status bar and accutally recognize the target?
Australia Forum Administrator #3
Try searching the forum for something like "target alias" - this sort of question comes up every few months. This post, for example, show setting a target, and notifying you of what it is:

http://www.gammon.com.au/forum/bbshowpost.php?id=7357

Quote:

doesn't seem to be working


Well can you copy and paste what you have done, rather than just saying that some unspecified attempt doesn't work in a way which that you don't say.

See: http://mushclient.com/copying for how to do that.
#4
Ok, I followed the steps in FAQ 21 and 22, I imported those settings, and got this error:

[string "Alias: "]:1: '=' expected near '@'

I am just trying to figure out how to set up a simple target script that will let me type TT <target>, then hit my jab jab alias which is J > jj !1.

!1 is the in game variable used for targets, but the client doesn't recognize it.
Australia Forum Administrator #5
That FAQ item shows how to do that. You have two aliases, right? You would have if you followed the FAQ. Can you copy what you have and paste it here, like I asked?

See: http://mushclient.com/copying for how to do that.

Can you tell me what script language you are using? See world configuration -> scripting tab.
#6
Language is Lua

It only gave me one alias:

Target * Sequence:100 Send: %1

The trigger is:

@target Sequence: 100 Send: @target
#7
There's a better way to show us what your aliases/triggers look like. Highlight the alias/trigger from the Aliases window, and click copy. Then paste the XML format of your alias/trigger here. This will give everyone a complete look at what you're doing and will help everyone help you in a more expedient fashion. Like Nick mentioned, take a look at http://mushclient.com/copying to see how to do this.

Just looking at the error, it would seem to me as though you don't have 'Expand variables' checked in your alias. MUSHclient doesn't know what the heck the @ is for, so it's returning an error. Try checkmarking 'Expand variables'.

Amended on Sat 10 May 2008 10:18 AM by Orangeist
#8
<aliases>
<alias
match="j"
enabled="y"
send_to="12"
sequence="100"
>
<send>jj @target</send>
</alias>
</aliases>

this is what I have, I don't know what variable I am supposed to be using, I imported the ones in the FAQ 20 &21. Expanding variables still doesn't work, i get this error:

[string "Alias: "]:1: '=' expected near '@'
USA #9
It doesn't look like you copied the alias exactly. In particular, what is your "send_to" value and why is it different from what the alias has on the FAQ?
#10
Sent To is set to Script, and I don't know why it is differant from the FAQ, copied it straight from there. :\
USA #11
I'm not sure why either, but in any case you don't want to send that to script, you want to send it to the MUD with variables expanded.
Australia Forum Administrator #12
Whereabouts in the FAQ did it have send to script?

FAQ #21 had send to "9" which is variables, for setting the targetting variable. FAQ #22 did not have a send-to field, which means it defaults to sending to the world.

This should work, you need "expand variables" checked, after all "target" is a variable, and send to world, not send to script.


<aliases>
  <alias
   match="j"
   enabled="y"
   expand_variables="y"
   sequence="100"
  >
  <send>jj @target</send>
  </alias>
</aliases>


Once again, you need to use the method described in http://mushclient.com/copying to copy the above into the client, don't just copy and paste individual lines.
#13
Ok, due to your extreme patience with my noobness, I have it figured out and it works! If I wanted to set it to where I could just type T <target> and have that work, instead of having to spell out Target, for speed purposes, how would I do that?
#14
Try changing your match line to something like this:

^t(arget)? (.*?)$


with Regular Expression checked.
Australia Forum Administrator #15
In FAQ 21, where the alias does a match on "target *", that is where it looks for the word "target" (the asterisk is a wildcard which is the name of your target).

So, just change that to "t *".
#16
Ok, this is what I did, changed Send from this:

<aliases>
<alias
match="j"
enabled="y"
expand_variables="y"
sequence="100"
>
<send>jj @target</send>
</alias>
</aliases>


to this:

<aliases>
<alias
match="j"
enabled="y"
expand_variables="y"
sequence="100"
>
<send>jj @t</send>
</alias>
</aliases>


and changed the Target * to T *

seems to be working, thanks for your help. :)