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 ➜ General ➜ Matching on undefinable text

Matching on undefinable text

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


Posted by Karl_Newbie   USA  (23 posts)  Bio
Date Thu 13 May 2004 07:49 AM (UTC)
Message
Hi, I've been fooling around with Mushclient now and have written this alias below.
Question:
I want to capture room titles as I explore the world just for my own reference.

Room titles are important and being able to group them by the region they are found in would make my experience that much easier.

Basically, I want to walk into a new room and capture the first line of text that reaches my world's output after I enter the walk command. Because the first line of output from the mud after a directional command is usually the room title

Sending it to notepad would be fine.

Sort of like this:


[e (these direction commands are just the Mushclient echo of my input)]
The School
Room description would be here
[w]
Road
[s]
Road
[s]
Grassy Patch
[e]
Wooded Patch

I would want The School, Road, Road, Grassy Patch, Wooded Patch all sent to notepad.


Problem: If the room title was in ansi colour I would know how to capture it, but unfortunately it couldn't be that simple. The Mud does not distinguish the room title from the rest of the description except by placing the room title alone on the first line of the room description.

The School
This is the training area for the mud. Many things to do here. Looking around you see lots of stuff.

I see how this alias without the "send e" captures and sends the last line to notepad. I was hoping I could do something similar here. I don't want to have to clear the output buffer of all but the first line every time I move either :)

<aliases>
<alias
match="e"
enabled="y"
send_to="12"
sequence="100"
>
<send>send &quot;east&quot;

world.AppendToNotepad &quot;roomtitles&quot;, GetLineInfo (line, 1) &amp; vbcrlf


</send>
</alias>
</aliases>
Top

Posted by Nick Gammon   Australia  (23,133 posts)  Bio   Forum Administrator
Date Reply #1 on Thu 13 May 2004 07:59 AM (UTC)
Message
The problem will be if the next thing isn't the room name, but if it usually is, this should be easy enough.

Make an alias for the direction commands (eg. a regular expression that matches "n|s|e|w" etc.) and have that alias enable a trigger matching anything ("*").

eg.

EnableTrigger "room_name", 1

When that trigger fires (ie. on the next line that arrives) it can send it to notepad or whatever, and then disable itself.

eg.

EnableTrigger "room_name", 0

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #2 on Thu 13 May 2004 08:44 AM (UTC)
Message
Hmm. I was pondering some other ways of getting the room name.

Thinking about Adjectives, Nouns, Verbs, and other grammar stuff. Important thing would be verbs.
From that, I started thinking about lengths, but that doesnt work well either.

However, capitalization might. Room names will be proper nouns. So, MOST LIKELY theyll be capitalized with the exception of prepositions.

That could be used as a secondary check, if you wanted better accuracy, and felt like taking on a bit of coding. The capitalization thing is easy enough with regexps, its just the prepositions, and then the fuzzy logic to determine if it is indeed a title.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Karl_Newbie   USA  (23 posts)  Bio
Date Reply #3 on Thu 13 May 2004 05:02 PM (UTC)

Amended on Thu 13 May 2004 05:06 PM (UTC) by Karl_Newbie

Message
Thanks Nick and Flannel. Nick's works great. Flannel, maybe next year :)
Even when I get an extra line of text after walking
(entering a dark room while holding a light source displays
Light illuminiates the surroundings.
Room name
Room desc


A trigger for that "Light illuminates the surroundings." enabling the room_names "*" trigger with a higher priority sequence # still catches the room title.
Thanks again.
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.


12,402 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.