|
Kakeidos Newbie
Joined: 20 Aug 2008 Posts: 2
|
Posted: Wed Aug 20, 2008 12:45 pm
Getting the room title as a variable after a trigger fires. |
Okay, so the mud I play, I can make pills that teleport me to the location I was in when I made them.
So I want to make something that keeps track of each pill's ID and where I made it.
I have everything except the room name. I can't reliably get the room name.
The process:
I make the pill, the output from that enables the class that contains the trigger that tries to get the room name by sending look then grabbing the first line that appears. But occasionally other outputs will appear and it'll grab those instead.
Now, the room titles are a different colour than anything else the mud outputs, so is there a way to have it send look, then wait 'til the line with the correct colour outputs and capture that? |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Wed Aug 20, 2008 4:11 pm |
Yes there is. When you edit the trigger, go to options and specify that it's an ANSI color trigger. This will zMUD to also match the ansi codes (in this case we're interested in the color ones) for the room.
The easiest way to capture the ansi codes is copy line with the colored room name into the pattern field ANSI trigger, and it will now include the ANSI color codes as well. You can the edit the pattern to suit your needs. |
|
_________________ Asati di tempari! |
|
|
|
Kakeidos Newbie
Joined: 20 Aug 2008 Posts: 2
|
Posted: Fri Aug 22, 2008 5:47 am |
It works perfectly.
Thank you. |
|
|
|
|
|