Help with trigger to capture a random list.

Posted by Gaznox on Sat 26 May 2007 10:48 PM — 3 posts, 15,962 views.

#0
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.

USA #1
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.
Amended on Sat 26 May 2007 11:16 PM by Shaun Biggs
#2
Wow, thank you very much. It works beautifully!