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


Joined: 10 Oct 2005
Posts: 24

PostPosted: Fri Apr 18, 2008 12:28 am   

Scripted Word Filter?
 
First dumb question, does anyone know how to make a scripted word filter.

I.E. to replace curse words before they are entered into cue in the MUD.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Apr 18, 2008 1:07 am   
 
To replace them when you enter them, or to replace them when they appear on the screen? For either one, you need to create a trigger that uses the #sub command. To replace them in commands you send rather than text on the screen, use a trigger with the oninput option set. Examples:

#trig {fishcake} {#sub {a naughty word}}
#oninput {fishcake} {#sub {a naughty word}}

However, assuming your question was relating to commands you enter, a much easier way would be to either:

1) Move to a MUD that's not so prudish
2) Stop using swear words

;)
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Nurodma
Beginner


Joined: 10 Oct 2005
Posts: 24

PostPosted: Fri Apr 18, 2008 3:21 am   
 
Yeah, it's relating to commands I enter.

And it's mostly for when I forget which channel I'm speaking on, some are FFA and others are very strictly monitored.
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Fri Apr 18, 2008 3:48 am   
 
Here's something you can do:
Code:
#ALIAS addcurse {#ADDKEY subcurse {%1} {%2}}
#ONINPUT {({@subcurse})} {#SUB {%db(@subcurse, %1)}}


It's pretty simple. Say "rock" is the curse word, and you want to replace it with "pebble." Just type:

addcurse rock pebble

This is assuming that all your curse words are one word long, and you want to replace it with one word subs. If you want to replace "rock" with "little pebble," then change the %2 in the alias to %-2.

Now, whenever you type "This rocking sucks!" it'll send "This pebbleing sucks!" Of course, this doesn't make too much sense, but I'm sure you get the idea.

Enjoy.

Charneus
Reply with quote
Nurodma
Beginner


Joined: 10 Oct 2005
Posts: 24

PostPosted: Sat Apr 19, 2008 12:59 am   
 
That's awesome. Thank you. Very Happy
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