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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Help with trigger to capture a random list.

Help with trigger to capture a random list.

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


Posted by Gaznox   (6 posts)  Bio
Date Sat 26 May 2007 10:48 PM (UTC)
Message
Hey, I just started using MushClient and am having troubles reprogramming my ZMudd scripts. I am trying to create a trigger that goes off when it sees:
List of names:

Which it should then store:
name1, name2, name3, name4, name5, name6, name7, name8, name9, name10, name11, name12, name13, name14, name15, name16, name17, name18, name19

into a variable or an array splicing the commas (assuming you can use * or something to capture it all). It should cut off when it sees:
Total:

My problem is that I cannot figure out how to get the trigger to capture the next random amount of lines and stop capturing at Total:

This is what the trigger would be looking at:

List of names:
name1, name2, name3, name4, name5, name6, name7, name8, name9, name10, name11, name12, name13, name14, name15, name16, name17, name18, name19
Total: 385

Any help would be appreciated.

Top

Posted by Shaun Biggs   USA  (644 posts)  Bio
Date Reply #1 on Sat 26 May 2007 11:15 PM (UTC)

Amended on Sat 26 May 2007 11:16 PM (UTC) by Shaun Biggs

Message
Have one trigger match="List of names:" which uses EableTrigger() to turn on the next two triggers and SetVariable to make an empty string. The first of these will match="Total: *" with a sequence=1, which will turn off the two secondary triggers. The last trigger will match="*" and have a sequence=2. That's the easy part to answer...

The harder part depends on your scripting language, but since Lua is the default and the one I like the most, I'll use that as an example. Making a string of these items is quite easy. Just have SetVariable( "list", GetVarable( "list" ).."%0" ) in that last trigger. This will give you a variable with the whole list in one long string as shown in the who listing.

It is much easier to fight for one's ideals than to live up to them.
Top

Posted by Gaznox   (6 posts)  Bio
Date Reply #2 on Sun 27 May 2007 12:16 AM (UTC)
Message
Wow, thank you very much. It works beautifully!
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.


12,304 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.