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
Tass
Beginner


Joined: 16 Mar 2003
Posts: 10

PostPosted: Sun Mar 16, 2003 10:11 am   

Multiple line capture again
 
It may be that it's 4 am but after reading all the posts I could find on the topic and tweaking the codes I still didn't get this to work so here goes.

my problem is i couldn't find the parameters to grab the next avalible line when the text wraps. I can get the first line and gag it in my main window .. but anything else is showing up in the main window

EX:
Player {chat}: what ever they type here and if it's too long then some of it isn't caught

after trial and error what i have is because when i start trying to improve it it dosen't work at all

#tr (~{chat}~:){
#CAP chat
#GAG
}

the other one is a tell message
#trigger {(%w) telepathically contacts you with '*'} {#var tellfrom %1;#var tellmessage %concat( %1, "' ");#t+ Tells}

#trigger {(*)} {#gag
#if (!%begins( %trigger, "@tellfrom telepathically contacts you with")) {#var tellmessage %concat( @tellmessage, %replace( %trigger, %char( 34), "'"), " ")}
#if (%ends( %trigger, %char( 34))) {#win Tells @tellmessage;#t- Tells } } "Tells"

it gags everything and nothing goes to the window

Thanks in advance
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sun Mar 16, 2003 11:41 am   
 
For the chat message, is there some difference between the second line in the chat message and other lines from the MUD? Is it perhaps indented with some amount of whitespace, a specific color, or perhaps it comes right after the first line of the chat message but there is a blank line right after the last line?

As for the tells trigger, there are a few problems. However, there is no reason to make it so complex. Here is a simpler version:
#TRIGGER {%w telepathically contacts you with '*'} {#T+ Tells}
#TRIGGER {(*)} {#CAP Tells;#GAG;#IF (%ends( %trigger, %char( 39))) {#T- Tells}} "Tells"

Kjata
Reply with quote
Tass
Beginner


Joined: 16 Mar 2003
Posts: 10

PostPosted: Sun Mar 16, 2003 11:52 am   
 
the chat looks like
Rhadaz {chat}: hmm dont majere know its dangerous to sleep and idle without
tp

which is verbatum from the mud

Thanks for the tell trig .. but if the text wraps (looks the same as channels) it dosen't grab it to window.

Again thanks
Reply with quote
Tass
Beginner


Joined: 16 Mar 2003
Posts: 10

PostPosted: Wed Mar 19, 2003 2:39 am   
 
Just sticking with this thread cause there's more

#TR {^~[retro]~:} {#T+ retro}
#TRIGGER {(*)} {#CAP retro;#GA;#IF (%ends( %trigger, %char( 39))) {#T- retro}} "retro"

is what i tried and it captured te entire buffer to the new window
any suggestions?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Mar 19, 2003 1:07 pm   
 
You can't use the same method for chat and retro since they don't end with a '. What you are going to have to use for this is the fact that the other lines start with some spaces. Thus, when you receive a chat or retro, you need to start capturing each line that starts with spaces until you receive a line that does not have the spaces. This should work for the chats (you should be able to easily modify the pattern for retro):
#TRIGGER {^%w ~{chat~}:} {#CAP chat;#GAG;#T+ chats}
#TRIGGER {(*)} {#IF ("%1" =~ "%s*") {#CAP chat;#GAG} {#T- chats}} "chats"


Kjata
Reply with quote
Charbal
GURU


Joined: 15 Jun 2001
Posts: 654
Location: USA

PostPosted: Wed Mar 19, 2003 2:51 pm   
 
You may want to modify the "%s*" pattern to "^%s%*$". Otherwise, you would match any line that has a space anywhere in it.

 - Charbal
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Mar 19, 2003 4:02 pm   
 
Yes, good catch Charbal. I forgot about that.

Kjata
Reply with quote
Tass
Beginner


Joined: 16 Mar 2003
Posts: 10

PostPosted: Wed Mar 19, 2003 11:43 pm   
 
You Guys rock. Kudos
works like a dream.
tass
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