Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Ka0s
Newbie


Joined: 05 Feb 2003
Posts: 7
Location: India

PostPosted: Tue Mar 23, 2004 11:59 am   

Triggers Based on Text Color
 
I've been trying to capture the room names from the MUD Output based on the color code of the text. This works when the room name appears on a new line.

Consider the following two snippets from the MUD. The name of the room is "The Yellow Shield's Inn". It is colored in Cyan on a black background. No other text received from the MUD is in this color.

- = - = - = - = - = -

* HP:Healthy MV:Winded >
The Yellow Shield's Inn
[ obvious exits: D ]
An elegant Domani lady stands here looking at you.
A tall Domani man is standing here, stroking his moustache.
An elite guard of Bandar Eban is standing here, looming over all others.
The innkeeper bustles about, helping guests into rooms.

- = - = - = - = - = -

But it doesn't work when the room name appears on the same line as the prompt. I.e.

- = - = - = - = - = -

* HP:Healthy MV:Winded > The Yellow Shield's Inn
[ obvious exits: D ]
An elegant Domani lady stands here looking at you.
A tall Domani man is standing here, stroking his moustache.
An elite guard of Bandar Eban is standing here, looming over all others.
The innkeeper bustles about, helping guests into rooms.

- = - = - = - = - = -

Any suggestions ?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Tue Mar 23, 2004 1:01 pm   
 
So, what trigger have you been using?
Reply with quote
Ka0s
Newbie


Joined: 05 Feb 2003
Posts: 7
Location: India

PostPosted: Tue Mar 23, 2004 2:51 pm   
 
I just basically created a trigger using the wizard that matched (*) with the "trigger on line color" option checked, and the color set to cyan.

This equates to:

#TRIGGER {(*)$} {@roomname = %1} {line=3}
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Tue Mar 23, 2004 4:36 pm   
 
First there is an error in your trigger fix it by removing the @
#TRIGGER {(*)$} {roomname = %1} {line=3}

Since the Line color starts with the color of the prompt and not Cyan add a second Ansi pattern trigger like this
#TRIGGER {> %e[0;36m(*)$} {roomname=%1} "" {color}
Reply with quote
Ka0s
Newbie


Joined: 05 Feb 2003
Posts: 7
Location: India

PostPosted: Wed Mar 24, 2004 7:06 am   
 
Okay thanks Nexela, got it to work :)

Had to make some small modifications to it first though, had to add pattern matching for black text as well for some reason.

#TRIGGER {> %e[36m(*)%e[0m(*)$} {roomname=%1} "" {color}
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Wed Mar 24, 2004 7:23 am   
 
Nice to know I shoved I mean showed you on the right path to take :P

Highlight a room name then open your settings editor goto the trigger erase everything but > and a space then Shift-Ins or CTR-V paste and it should paste the exact color codes you need. then just delete the roomname and repalce it with (*) close the settings and check and see if it works.

If that doesn't work then (don't see why it wouldn't)

#Debug junk.txt colorcode.txt
move into a room
#Debug

open the colorcode.txt file in your zmud folder find your room title and it will have the ansi codes ya need in front of it
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Wed Mar 24, 2004 7:49 am   
 
Ohh I think I have a guess as to what the problem might be though :P

$ End of line is getting reset back to black :P And with the end of the line not being cyan it doesn't match so removing the $ should fix it or just adding a simple %e[0m$ to the end should fix it. the (*) shouldn't be needed at all
Reply with quote
Ka0s
Newbie


Joined: 05 Feb 2003
Posts: 7
Location: India

PostPosted: Thu Mar 25, 2004 6:50 am   
 
Yup I think you hit the nail on the head. I sorta figured that myself last night while I was folling around with the trigger. Thx :)
Reply with quote
Yoggin
Beginner


Joined: 12 Mar 2004
Posts: 14
Location: Sweden

PostPosted: Sun Mar 28, 2004 2:54 am   
 
read some of this but got hard to see how it works..Is there away to capture what color there is on a line? would like to be able to catch this

Blaha tells you 'green'

In red, is there anyway to make a script that

tell blaha 'green'

in the same color as he told me it in?

Would appriciate an answer if this is possible or not and if possible some help in doing it.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Mar 28, 2004 5:22 am   
 
Oh, nice hijack attempt. [V]

This topic is concentrating on how to detect room names. Please use a separate topic for anti-bot-detection questions (yes, I know you've already posted one).
Reply with quote
bossmant
Beginner


Joined: 29 Mar 2004
Posts: 11

PostPosted: Mon Mar 29, 2004 8:12 pm   
 
Heh this isn't really a hijack, but i guess my question is, what if you don't know what line it is, or the room name changes color?

Like ex. The Dragon Inn how could you configure that to capture in another window?
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net