triggering my target variable?

Posted by MReece199D on Sun 04 Aug 2013 08:51 PM — 12 posts, 43,966 views.

#0
Okay so I've decided to go ahead and start trying to learn this Lua stuff and I've hit my first snag. I'm sure if I search long enough throughout the forum I could probably find the answer I seek in another post, but I've already been reading and browsing for about 45 minutes and while I have learned a lot of other interesting and useful scripts for other needs down the road, I have yet to spot this one. Maybe I'm just suffering from sleep deprivation, or maybe I'm just blind, but it is what it is.

I am trying to create a trigger that will match whatever my target variable ("target") is currently set to. I don't need any help with what the trigger will send, I believe I've got that covered. I just can't seem to figure out how to make the trigger match on the variable.

can someone please put me out of my misery on this one?
Thanks in advance, hope to hear from you soon!
Australia Forum Administrator #1
Match on something like: @target hits you

and check "Expand variables".
#2
Okay I tried that and it's not working either.

I am trying to make a trigger that will match off my "target" variable and have it just highlight the targets name so I can easily spot my target where ever I see my targets name.

I think part of the problem is that I need it to match even if the target's name is jumbled in the middle of a line somewhere as opposed to an exact match on a line.

I'm guessing I might need to add something to my actual script or something, but I seriously just started reading up on Lua yesterday morning a few hours before I started this thread. So yeah I'm hardcore newb to this language and most scripting in general really.
Australia Forum Administrator #3
Quote:

Okay I tried that and it's not working either.


Show the "that".

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.
#4
Nick Gammon said:

Quote:

Okay I tried that and it's not working either.


Show the "that".

(copying)


trigger: @target

with the "expand variables" box checked.

I also selected the "change colour and style to:" and set it to "custom16" and checked the "Underline" box as well.

I have tested this by setting my target variable to a target I can see on the "who" list and then checking the "who" list again and it does not highlight the target as I am trying to get it to do.

So what do I need to do to make this work?
#5
just to clarify, my target variable is "target"
#6
<triggers>
<trigger
custom_colour="16"
enabled="y"
expand_variables="y"
ignore_case="y"
make_underline="y"
match="@target"
sequence="100"
>
</trigger>
</triggers>
Australia Forum Administrator #7
And what are you trying to match on? Copy and paste an example line.
#8
I'm trying to match it on the variable Target... where ever in the mud that target may be.

I.E : Lets say my target is set to "goren" then I hit "who"


- * - * - * - * - * - * - * - * - * - * - * -
The players that are online right now are:  
afk - ooc - title - - - - - name - - - race 
[ ] - [X] - Divinus Exo...- Keiran   - God  
[ ] - [X] -               - Valk     - Gobli 
[ ] - [ ] - Lord of Quest - Questron - God  
[ ] - [X] -               - Abi      - Siren  
[X] - [X] -               - Racklagon- Gobli  
[ ] - [X] - Doom Archon   - Goren    - Drao   
[ ] - [X] -               - Havok    - Dwarf  
[X] - [X] - Orderly of ...- Jargin   - Elfen  
[ ] - [ ] -               - Athine   - Gobli  
- * - * - * - * - * - * - * - * - * - * - * -


and I want it to highlight goren's name for for me. Nothing else, just "Goren" and It needs to work anywhere else it might show up as well like if I walk into a room and Goren is standing there it should highlight his name still. do you get what I'm going for here?
Amended on Wed 07 Aug 2013 04:49 AM by Nick Gammon
Australia Forum Administrator #9
Check "regular expression" and then it works. That matches then anywhere on the line. Without it, it only matches that word totally on its own.
#10
wow thanks, it works now.

Somehow I knew that was gonna turn out to be something really easy like that. Thanks for going through the issue with me. heh
USA Global Moderator #11
See:
https://code.google.com/p/aardwolfclientpackage/wiki/Triggers#I_tried_making_a_trigger_but_it_isn%27t_firing._What_did_I_do