Automatically capture all mud output between two tags

Posted by Mendaloth on Sat 14 May 2011 09:46 PM — 3 posts, 17,640 views.

#0
I constantly find myself capturing between two tags. I don't think there is an easier way than creating three triggers. I wish there were.

Maybe I am missing something, but I have searched through the help files and forums and I can't find it.

Here is my example:
Say I want to capture and gag all text between {start_capture} and {end_capture}.

I need:
Trigger 1) A trigger that matches {start_capture}, and turns on trigger (2)
Trigger 2) A trigger that matches *
Trigger 3) A trigger that matches {end_capture}, and turns off trigger (2).

Do this 3 or 4 times in a plugin, and all of a sudden you have a ton of triggers that easily get confusing.

I would like to suggest that there be a function TagTriggerCapture (Crappy name) that takes the following options:

start_tag
omit_from_output y/n
match_between_tags (For me this would usually be *, but why not give the option of other matches)
script/function to the lines to
end_tag

BTW, I really love this client, and keep up the good work! This is just small issue, but figure I'd make the suggestion.




USA #1
I'm not sure it should be part of MUSHclient itself, but you could create your own TagTriggerCapture() in Lua using AddTriggerEx().
Australia Forum Administrator #2
I agree it can be a bit of a pain, and there isn't really anything at present that does it.

As Twisol said, you could probably encapsulate the functionality with a bit of scripting. Instead of the usual process of enabling/disabling triggers a script could simply add, remove them in the appropriate sequence.

Someone could make a nice library that does that.