This scriptwill say (censored) instead of a bad word, the third line is wear you add the words then the fourth is what you want it to sya instead,
on *:INPUT:*: {
if (/* !iswm $1) || ($ctrlenter) {
var %acros = shit,fuck,slut,slapper,slag,cunt,dick,ass,arse,fuck,niger,mother fucker,wanka,wanker,fanny,fucker,
var %expand = (Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);
var %x = $numtok(%acros,44)
while (%x) {
var %w = $gettok(%acros,%x,44)
var %xx = $findtok($1-,%w,0,32)
while (%xx) {
tokenize 32 $reptok($1-,%w,$gettok(%expand,%x,59),%xx,32)
dec %xx
}
dec %x
}
msg $target $1-
halt
}
}
Abcdefmonkey
crikey .. thanks. and its working very well up to an extent. but here is the "tricky" part of the problem, both chans have the same name.
This is working . if on chan1 someone types a line.. the bot will msg the same chan with the word censored.. but on the other server (same chan name) the bad word is still getting thru.. and i suppose also the bot shouldn't be messaging the source channel if someone talks there.
Im trying to make other scripts to go with this multiserver setup i have, but im finding everything is so much harder because both chan have the same name... ive kinda shot myself in the foot ;)
However I can perhaps fiddle about with things here to make this work.. i think the main ingredients are all there.
Superb job thanks :D
Well, @Pangaea it will work for your bot. I tried it myself. Change the first line to this
on *:TEXT:*:#: {
Then replace this line
msg $target $1-
Just change $target to the channel name you want it relayed to. Cheers :)
Edit: here's what you need.. i made the changes for you
on *:TEXT:*:#: {
var %acros = shit,fuck,slut,slapper,slag,cunt,dick,ass,arse,fuck,niger,mother fucker,wanka,wanker,fanny,fucker,
var %expand = (Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);(Censored);
var %x = $numtok(%acros,44)
while (%x) {
var %w = $gettok(%acros,%x,44)
var %xx = $findtok($1-,%w,0,32)
while (%xx) {
tokenize 32 $reptok($1-,%w,$gettok(%expand,%x,59),%xx,32)
dec %xx
}
dec %x
}
msg #RELAY-CHANNEL $1-
halt
}
yea.. tricky.. i guess something like this would have to be implemented into the relay code itself
.. hell it was worth a try ;)
cheers :D
EDIT.. is there such a thing as an "on msg" event?.. or equivalent
by on msg, i mean a state where it has text in buffer or whatever and its about to deploy.. um.. lol .. im crazy
oh.. i kinda always thought on text events where processed if the text has already been messaged to channel.
ill give it a shot tho , cheers :)
EDIT.. naw.. tho i didnt think that would work anyway for the reasons i stated above
IF i myself manually talk thru the bot using its client the words are censored on both chans (using on input) .. but wont work while relaying chan text from one chan to the other
@Pangaea this snippet uses on INPUT... changing it to on TEXT would work, from a bot's perspective.