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 ➜ Tips and tricks ➜ Sending several lines to notepad triggered from one line

Sending several lines to notepad triggered from one line

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


Posted by ErockMahan   (81 posts)  Bio
Date Thu 11 Aug 2005 03:43 PM (UTC)
Message
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!
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #1 on Thu 11 Aug 2005 08:25 PM (UTC)

Amended on Thu 11 Aug 2005 08:37 PM (UTC) by Flannel

Message
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.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
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.


13,835 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.