|
Nurodma Beginner
Joined: 10 Oct 2005 Posts: 24
|
Posted: 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. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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
;) |
|
|
|
Nurodma Beginner
Joined: 10 Oct 2005 Posts: 24
|
Posted: 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. |
|
|
|
charneus Wizard
Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: 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 |
|
|
|
Nurodma Beginner
Joined: 10 Oct 2005 Posts: 24
|
Posted: Sat Apr 19, 2008 12:59 am |
That's awesome. Thank you.
|
|
|
|
|
|