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
Dunec
Newbie


Joined: 12 Jul 2009
Posts: 2

PostPosted: Sun Jul 12, 2009 10:57 pm   

Problem with ;'s being captured into variables
 
Heres one of the triggers I'm trying to use..

#TRIGGER {^(%w) guildtalks '(*)'$} {#IF %trigger=@CurrentCaptureLine {} {#IF (%ismember(%1,%names)) {} {#gvar CurrentCaptureLine %trigger;#WIN Comm %ansi( high, green)~[@char~]~:%ansi( high, cyan)%1 guildtalks '%2' %ansi( high, cyan)%time( "h:nn:ss AM/PM")}}}

Which in a COMM window would display

[Jaxxon]:Creemore guildtalks 'hiya' 5:49:29 PM

Works great, if I have multiple characters on, it only captures it once, if it comes from one of my Alts it ignores it (It would Capture the "You guildtalk" into the comm window instead of the "Alt Guildtalks" since the triggering phrase would be different.

One issue I have is if something is captured with a ; in it, it will break out of the IF check and process the commands directly as if I typed them

You guildtalk 'This is a test of the gold;gold;gold; system'
gold
gold
system' 5:54:13 PM

[Honovi] 1461/1925hp 0/0mp 610/610mv |1000|Y|| New Darkhaven 4,868,124gc (836/999) () ()You have 4,868,124 gold pieces.

[Honovi] 1461/1925hp 0/0mp 610/610mv |1000|Y|| New Darkhaven 4,868,124gc (836/999) () ()You have 4,868,124 gold pieces.

[Honovi] 1461/1925hp 0/0mp 610/610mv |1000|Y|| New Darkhaven 4,868,124gc (836/999) () ()Huh?

And the Comm window displays the fragment up to the first ;

[Honovi]:You clantalk 'This is a test of the gold

I've played with "'s ()'s []'s {}'s in all sorts of configurations, and even tried using %replace to strip out the ;, but I am Fail.
Reply with quote
Dunec
Newbie


Joined: 12 Jul 2009
Posts: 2

PostPosted: Fri Jul 17, 2009 3:19 am   
 
Fixed it, apparently I didn't play with the right combo of "'s. Surrounding %2 did the trick

#TRIGGER {^(%w) guildtalks '(*)'$} {#IF %trigger=@CurrentCaptureLine {} {#IF (%ismember(%1,%names)) {} {#gvar CurrentCaptureLine %trigger;#WIN Comm %ansi( high, green)~[@char~]~:%ansi( high, cyan)%1 guildtalks '"%2"' %ansi( high, cyan)%time( "h:nn:ss AM/PM")}}}
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