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
icedsun
Novice


Joined: 20 Jan 2006
Posts: 45
Location: Minnesota

PostPosted: Tue Jan 31, 2006 7:30 pm   

Safe trigger expression
 
When I get a "tell" from a person on the MUD I want to record that entire block of text to FILE 2. I know that it's unsafe to use the (*) parameter in a trigger because people could send %dde commands and stuff through that. So, what's the proper trigger expression to capture the "tell" line and write it to my little tell log?

example:

Monkey tells you 'I want to kick you in the bananas."

Code:
#TRIGGER {(%w) tells you '(*)'} {#WRITE 1 {TELL: ~(%1~) %2}}


What would be an appropriate substitute for (*) that would be safe?
_________________
"Build a man a fire and he's warm for a night. Light a man on fire and he's warm for the rest of his life." --My Mom
Reply with quote
icedsun
Novice


Joined: 20 Jan 2006
Posts: 45
Location: Minnesota

PostPosted: Tue Jan 31, 2006 7:39 pm   
 
Thinking about this... I suppose I could just do
#TRIGGER {(%w) tells you '(%a)(%s)(%a)(%s)(%a)(%s)(%a)(%s)(%a)(%s)(%a)(%s)(%a)(%s)(%a)(%s)(%a)(%s)(%a)'} {#WRITE 2 {TELL: ~(%1~) %2 %3 %4 %5 %6 %7 %8 %9}
Which would just end up showing me the first x amount of words they wrote... not really as nice as I'd like but it's an option...

Okay upon thinking about that option, it wouldn't work either because of punctuation and such... Ie: tells you 'Hey! It's a nice day' would end with the !, etc... Hmph.

Is there a way to tell the mud not to expand the (*), meaning that I could write that line to my log file exactly as it is and it would never execute anything potentially inside of it? LIke, if they tried a %dde() call in it, it would just write that text to my log file and not actually parse the %dde()?
_________________
"Build a man a fire and he's warm for a night. Light a man on fire and he's warm for the rest of his life." --My Mom
Reply with quote
TonDiening
GURU


Joined: 26 Jul 2001
Posts: 1958
Location: Canada

PostPosted: Tue Jan 31, 2006 8:16 pm   
 
See:
http://forums.zuggsoft.com/phpbb/viewtopic.php?t=11519&highlight=security+expand+%25%2A
http://forums.zuggsoft.com/phpbb/viewtopic.php?t=12453&highlight=security+expand+%25%2A

Issues are resolved with %expand()

Other interesting posts:
http://forums.zuggsoft.com/phpbb/viewtopic.php?t=22026&highlight=security+expand+%25%2A
Reply with quote
icedsun
Novice


Joined: 20 Jan 2006
Posts: 45
Location: Minnesota

PostPosted: Tue Jan 31, 2006 9:06 pm   
 
Thanks much... sorry for posting on an already-resolved issue!!! I'll try to be more careful.
_________________
"Build a man a fire and he's warm for a night. Light a man on fire and he's warm for the rest of his life." --My Mom
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