Register forum user name Search FAQ

Gammon Forum

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.
 Entire forum ➜ MUSHclient ➜ General ➜ Trigger to take numbers and send

Trigger to take numbers and send

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Wimbley   (10 posts)  Bio
Date Mon 07 Sep 2015 04:52 PM (UTC)
Message
So I want the trigger to match Enemy 1: 2, 8, 19

and to send - lock 2, 8, 19

the coordinates and enemy name will be changing.

Thank you for any help!
Top

Posted by Helpless   (48 posts)  Bio
Date Reply #1 on Tue 08 Sep 2015 04:26 AM (UTC)

Amended on Tue 08 Sep 2015 04:27 AM (UTC) by Helpless

Message
its been my past experience on these forums that they usually want you to show your own attempt at making this. my experience is pretty limited on these forums though (less than 50 posts)

edit: i've no idea what you are really wanting but im not a very good coder anyway.
Top

Posted by Nick Gammon   Australia  (23,121 posts)  Bio   Forum Administrator
Date Reply #2 on Tue 08 Sep 2015 08:59 AM (UTC)
Message
There are quite a few informational posts and videos in the "Getting Started" section:

http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=120

It would indeed help to at least try to make such a trigger, and post what you came up with. Otherwise if we just write if for you, you haven't learned anything.

It seems on the face of it that a simple trigger with one or two wildcards would do it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Wimbley   (10 posts)  Bio
Date Reply #3 on Thu 10 Sep 2015 12:37 AM (UTC)
Message
My appologies, didn't want to seem like a freeloader. So, I am still experimenting now with the guides and stuff but haven't been able to get the wild cards to work, or the trigger part reliably.

^. \d \d \d \d$ is what I am focused around for the trigger portion. The first part(the name of target) will change depending on the persons name. The Next part of it is where I am becoming confused. it may have 1 number to identify the target or none at all, then the 3 digit coordinate. I don't need to send it back with commas.

For the send portion I have:
lock %1 %2 %3

but since I am struggling with part 1, I can't really begin to test the wildcards properly. Any hints/fingers in the right direction would be appreciated. Thank you.
Top

Posted by Nick Gammon   Australia  (23,121 posts)  Bio   Forum Administrator
Date Reply #4 on Fri 11 Sep 2015 06:33 AM (UTC)
Message
OK, post what you have tried.

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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Donecce   (16 posts)  Bio
Date Reply #5 on Sat 12 Sep 2015 05:35 PM (UTC)

Amended on Sun 13 Sep 2015 03:54 PM (UTC) by Donecce

Message
Maybe something like this...


^(.+?)(?: (\d*))?\: (\d+)\, (\d+)\, (\d+)$



Using your example of "Enemy 1: 2, 8, 19" the captures would be


%1 Enemy
%2 1
%3 2
%4 8
%5 19



Using example "Anything: 2, 8, 19" the captures would be


%1 Anything
%2 would be an empty string, ""
%3 2
%4 8
%5 19


Then you might send


lock %3, %4, %5
Top

Posted by Wimbley   (10 posts)  Bio
Date Reply #6 on Sat 12 Sep 2015 11:16 PM (UTC)

Amended on Sat 12 Sep 2015 11:20 PM (UTC) by Wimbley

Message
Thank you for the help! it is working with the test function, and now I will need to put it through some testing and see if it screws up on anything. it was my lack of understanding with the () and other spacers that was throwing it off from me getting it working.
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.


20,981 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.