Sending several lines to notepad triggered from one line

Posted by ErockMahan on Thu 11 Aug 2005 03:43 PM — 2 posts, 17,425 views.

#0
I've tried to research other posts as much as I could, but I couldn't find anything I could make heads or tails of, so please forgive me if this is a repeat post than you're tired of answering.

It will often happen where someone will send a block of information to a group (most commonly, the stats of an item) which is spread across several lines. I want to have this posted to the notepad, if I could, along with other "tells" that I get.

Sending information to the notepad is not my problem. I think I've got a good handle on how to do that. "* tells you *" Send %1 tells you %2 to notepad.

The trick is that each item description doesn't have the same beginning at the start of the line (what I would mark as *) for easy triggering. It looks like this:

Erock explains an item to the group
You discover something from the item.
Object 'blue potion unique', Item type: POTION
Can be worn on :TAKE
Item is: MAGIC SHATTERPROOF !RENT LIMITED
Weight: 1, Value: 10000
Level 80 spells of:
recover mana
recover mana
level limit: 0


Now, it makes sense that the trigger would activate on:
* explains an item to the group

and it could somehow end on the "level limit: *", but because each item has different lengths (different number of lines explaining it), I don't have a clue how this could be done. I hope this has been helpful!
USA #1
You'll need to create a few triggers (three, if you have a constant start and stop, * explains.... and level limit * will do nicely). One is the start, one is the end, and one is simply a wildcard (in otherwords, it will match on everything).

You'll need to name all three triggers, the last two (middle and end) will start disabled. All three will send to script (and inside that script, appendtonotepad). The first one will also enable the second two (EnableTrigger "name", 1) the last one will disable the second one and itself (EnableTrigger "name", 0).

Thats basically it.

You really should look into regular expressions, since they'll make your triggers more flexible (especially with some of your other questions, like that healing shindig).

Some references (explained in more detail):
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4142
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=5485
In this one Ked has actually created a plugin, you'll obviously need to take the triggers from it, or just use them as examples:
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=4170

Edit:
Actually, Scotty posted a good example recently:
http://www.gammon.com.au/forum/bbshowpost.php?bbsubject_id=5778&page=999999
Except he uses trigger groups instead of individual triggers. I personally prefer individual triggers because it gives me more control, but that's up to you.
Oh, and he's omitting from a log instead of sending to a notepad, but the theory is the same.