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
➜ Lua
➜ triggering my target variable?
|
triggering my target variable?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| MReece199D
(11 posts) Bio
|
| Date
| Sun 04 Aug 2013 08:51 PM (UTC) |
| Message
| 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! | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Sun 04 Aug 2013 10:27 PM (UTC) |
| Message
| Match on something like: @target hits you
and check "Expand variables". |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| MReece199D
(11 posts) Bio
|
| Date
| Reply #2 on Mon 05 Aug 2013 08:36 AM (UTC) |
| Message
| 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. | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #3 on Mon 05 Aug 2013 10:11 PM (UTC) |
| Message
|
Quote:
Okay I tried that and it's not working either.
Show the "that".
 |
For advice on how to copy aliases, timers or triggers from within MUSHclient, and paste them into a forum message, please see Copying XML.
|
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| MReece199D
(11 posts) Bio
|
| Date
| Reply #4 on Mon 05 Aug 2013 10:24 PM (UTC) |
| Message
|
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? | | Top |
|
| Posted by
| MReece199D
(11 posts) Bio
|
| Date
| Reply #5 on Mon 05 Aug 2013 10:41 PM (UTC) |
| Message
| | just to clarify, my target variable is "target" | | Top |
|
| Posted by
| MReece199D
(11 posts) Bio
|
| Date
| Reply #6 on Mon 05 Aug 2013 10:44 PM (UTC) |
| Message
| <triggers>
<trigger
custom_colour="16"
enabled="y"
expand_variables="y"
ignore_case="y"
make_underline="y"
match="@target"
sequence="100"
>
</trigger>
</triggers>
| | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #7 on Tue 06 Aug 2013 09:18 AM (UTC) |
| Message
| | And what are you trying to match on? Copy and paste an example line. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| MReece199D
(11 posts) Bio
|
| Date
| Reply #8 on Tue 06 Aug 2013 12:19 PM (UTC) Amended on Wed 07 Aug 2013 04:49 AM (UTC) by Nick Gammon
|
| Message
| 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? | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #9 on Wed 07 Aug 2013 04:51 AM (UTC) |
| Message
| | 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. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| MReece199D
(11 posts) Bio
|
| Date
| Reply #10 on Wed 07 Aug 2013 01:48 PM (UTC) |
| Message
| 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 | | Top |
|
| Posted by
| Fiendish
USA (2,558 posts) Bio
Global Moderator |
| Date
| Reply #11 on Thu 08 Aug 2013 01:37 PM (UTC) |
| Message
| See:
https://code.google.com/p/aardwolfclientpackage/wiki/Triggers#I_tried_making_a_trigger_but_it_isn%27t_firing._What_did_I_do |
https://github.com/fiendish/aardwolfclientpackage | | 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.
42,755 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top