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.
Entire forum
➜ MUSHclient
➜ General
➜ Multiline trigger and shopkeepers
Multiline trigger and shopkeepers
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1 2
Posted by
| John
Australia (13 posts) Bio
|
Date
| Wed 27 Apr 2005 12:20 AM (UTC) Amended on Wed 27 Apr 2005 12:21 AM (UTC) by John
|
Message
| I want to have the inventory of a shopkeeper be in a notepad, so how would I do this? The shopkeeper screen looks like this:
The man has the following to sell:
01) a beads for 450 obsidian coins.
02) a braided headband for 683 obsidian coins.
(with numerous other items).
I've got the multi-line ticked (and the value has 100 as a shopkeeper is unlikely to have more then that), and I have "append to notepad", but I still can't get it to work. A shopkeeper lists his inventory on the command "list".
Thanks | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #1 on Wed 27 Apr 2005 01:08 AM (UTC) |
Message
| Suggest stop using a multiline trigger, and start using a series of triggers.
One to start:
^The (wo)?man has the following to sell:$
which turns on the next two, one being an item:
^(\d{2})\) (.*) for (\d+) obsidian coins?\.$
and the other being something to end it:
(if there's anything that always ends the list, if not, then a general line that has a higher sequence as the second).
And the first one turns on the second two, and the third turns off the last two (first one stays on, so you can get another list).
And of course, the first two (and possibly the third) send to the notepad window.
There are a couple of examples of this already in the forum (somewhere) but I couldn't find any of them with a bit of searching, perhaps you'll be more fruitful if you need further examples. |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| John
Australia (13 posts) Bio
|
Date
| Reply #2 on Wed 27 Apr 2005 02:33 AM (UTC) Amended on Wed 27 Apr 2005 05:36 AM (UTC) by John
|
Message
| Thanks Flannel (seems to be you always answering my questions ;)).
I am having trouble activating the second and third script. Here is what I've done:
First script activates and sends this code to "Script":
EnableTrigger "a", 0
EnableTrigger "End_Shopkeeper", 0
(tried it with)
EnableTrigger "[a]", 0
EnableTrigger "[End_Shopkeeper]", 0
It does activate (because I get it to omit the string that causes it to do so), but it doesn't enable the second and third trigger. Those scripts are called "a" and "End_Shopkeeper" by placing those values in "Label" (without the " ") field. They are unique. Scripting is enabled (I had no script, then I placed "default.vbs").
The second (and apparently third) scripts do work (I don't see why the third one does).
I just spent half an hour searching for ways to fix it. I can't.
[EDIT]: Fixed typo | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #3 on Wed 27 Apr 2005 03:49 AM (UTC) |
Message
| To enable, you need to have it be:
EnableTrigger "name", 1
not 0. And it's just a simple string (no fancy brackets or anything)
So if you had a trigger labeled 'MiddleTrigger' then your line would be:
EnableTrigger "MiddleTrigger", 1
to enable, and
EnableTrigger "MiddleTrigger", 0
to disable (as in, EnableTrigger True, and EnableTrigger False)
And they aren't case sensitive.
And it would enable the triggers, not the scripts (correct terminology will prevent lots of confusion later, if not now).
And you don't need a script file, just enabled (of course, this doesn't matter). |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| John
Australia (13 posts) Bio
|
Date
| Reply #4 on Wed 27 Apr 2005 05:37 AM (UTC) Amended on Wed 27 Apr 2005 05:41 AM (UTC) by John
|
Message
| Thanks a lot again, you're a big help. That did it :) And now to complicate it further, how do I have two different triggers send to the same notepad file? | Top |
|
Posted by
| Flannel
USA (1,230 posts) Bio
|
Date
| Reply #5 on Wed 27 Apr 2005 06:30 AM (UTC) |
Message
| Ummm, well, since you're currently using send to script (right?) and you're using SendToNotepad to send to the notepad (right?, if not, how are you doing it? Send_to=notepad and then a script file? far too complicated).
You just use the same notepad name in both SendToNotepad lines.
So yeah, if you're doing it any other way, you might as well use SendTo:Script (because it keeps you from having to open/edit/save your script file every 5 minutes) and then SendtoNotepad (and EnableTrigger, of course). |
~Flannel
Messiah of Rose
Eternity's Trials.
Clones are people two. | Top |
|
Posted by
| John
Australia (13 posts) Bio
|
Date
| Reply #6 on Wed 27 Apr 2005 01:59 PM (UTC) |
Message
| It works now :) As for how I did it, I wasn't using a script, so the first thing I did was that.
I was having the middle screen send to a notepad (by having it "Send to" Notepad, rather then, Script). I then wanted the string that starts the first trigger to be placed in the same notepad window, so I created a second trigger that worked on the same string and sent that to a notepad window, only it did so to a unique window (not the same one as the middle trigger).
Thanks again :) | Top |
|
Posted by
| Vallick
USA (14 posts) Bio
|
Date
| Reply #7 on Thu 30 Nov 2006 12:40 AM (UTC) |
Message
| Hey guys, This gave me a idea when I was browsing, making a lore file that through the use of a programmer friend of mine, I want him to design a program that searches through this, in pre-empting his questions, I was wondering if I can use this send to notepad to send something from the mud that looks like this
You feel informed:
Object 'axe vallenwood handle'
Item Type: WEAPON
Mat Class: metal Material: iron
Weight : 3 Value : 50
Affects : HITROLL by 1
Affects : skill axes by +3
Item is : MAGIC
Class : hand_axe
Damage : 4D3
I get the idea of muiltiple triggers (but seriosly at a loss of yet as to how to do it, but Im working on that) how do I figure out how to tell it when to stop if every lored item is going to have a differant last line? here's a few more examples if it helps:
You feel informed:
Object 'band stone granite'
Item Type: ARMOR
Mat Class: natural Material: stone
Weight : 5 Value : 75
Affects : HITROLL by 1
Affects : INT by -1
Effects : DETECT_INVISIBLE
Item is : GLOW MAGIC
Apply : 4
You feel informed:
Object 'mace black fluted'
Item Type: WEAPON
Mat Class: metal Material: bronze
Weight : 8 Value : 12
Item is : ANTI_GOOD
Class : mace
Damage : 2D5
If its to complicated, is there a way to use a typed command such as "loreon" to turn on a sendo trigger that captures everything until I type loreoff again? this sounds allot easier for my primitive knowledge.
Thanks a million and one. |
Vallick Arc'Haven,
Member of the Solamnic Knighthood,
Krynn, Anaslon
(longuriel@yahoo.com) | Top |
|
Posted by
| Nick Gammon
Australia (23,100 posts) Bio
Forum Administrator |
Date
| Reply #8 on Thu 30 Nov 2006 04:57 AM (UTC) |
Message
| A single multi-line trigger might work for you. Here is one that worked on what you posted here:
<triggers>
<trigger
enabled="y"
group="Multi Line"
lines_to_match="50"
keep_evaluating="y"
match="You feel informed:\nObject '.*'\nItem Type: .*\nMat Class: .* Material: .*\nWeight : .* Value : .*\n\n([A-Za-z0-9 ]+ : .*\n)*\n\Z"
multi_line="y"
regexp="y"
send_to="2"
sequence="100"
>
<send>%0</send>
</trigger>
</triggers>
For this to work properly you need something to "anchor" the start and the end of the multi-line set. I have used "You feel informed:" to indicate the start, and a blank line to indicate the end. This example just sends to the output window, but you could send to notepad, or use scripting to break the text down further. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Vallick
USA (14 posts) Bio
|
Date
| Reply #9 on Thu 30 Nov 2006 08:01 AM (UTC) |
Message
| Ummm K, where do I put this so I can use it? do I make a text file and save it somewhere as something? |
Vallick Arc'Haven,
Member of the Solamnic Knighthood,
Krynn, Anaslon
(longuriel@yahoo.com) | Top |
|
Posted by
| Nick Gammon
Australia (23,100 posts) Bio
Forum Administrator |
Date
| Reply #10 on Thu 30 Nov 2006 06:35 PM (UTC) |
Message
| |
Posted by
| Vallick
USA (14 posts) Bio
|
Date
| Reply #11 on Fri 01 Dec 2006 05:19 AM (UTC) |
Message
| I did the paste feature, then got this message:
Line 7: Attribute not used: lines_to_match="50" (trigger)
Line 10: Attribute not used: multi_line="y" (trigger)
Any idea? (havent messed with the send to notepad yet) |
Vallick Arc'Haven,
Member of the Solamnic Knighthood,
Krynn, Anaslon
(longuriel@yahoo.com) | Top |
|
Posted by
| Nick Gammon
Australia (23,100 posts) Bio
Forum Administrator |
Date
| Reply #12 on Fri 01 Dec 2006 05:24 AM (UTC) |
Message
| What version of MUSHclient do you have? Multi-line triggers were introduced quite a while back. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Vallick
USA (14 posts) Bio
|
Date
| Reply #13 on Fri 01 Dec 2006 07:59 AM (UTC) |
Message
| vrs 3.42 this one old? |
Vallick Arc'Haven,
Member of the Solamnic Knighthood,
Krynn, Anaslon
(longuriel@yahoo.com) | Top |
|
Posted by
| Vallick
USA (14 posts) Bio
|
Date
| Reply #14 on Fri 01 Dec 2006 09:46 AM (UTC) |
Message
| Ok, I downloaded the new version, I must have been running a really old one or something, the new one deffinetly looks clearer, now Im trying to figure out how to send it to notepad, or where its sending it to atm, what its capturing exc. |
Vallick Arc'Haven,
Member of the Solamnic Knighthood,
Krynn, Anaslon
(longuriel@yahoo.com) | 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.
50,429 views.
This is page 1, subject is 2 pages long: 1 2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top