on *:input:*: {
if (($istok(channel query,$window($active).type,32)) && (/* !iswm $1) && (!$ctrlenter)) {
; -------- START OF SETUP --------
; this is the string of badwords to replace. syntax: badword1 replaceword1,badword2 replaceword2, ...
; note: do not enter equal badwords and replace words, e.g. you must not enter "dick DiCk"
; - otherwise your script will freeze in an infinite loop
var %bad = fuck fúck,pussy pússy,motherfucker motherfúcker,fucking fúcking,O_O O_O,>_< >_<,^.^ ^.^,pussy pússy,cunt cúnt,cunts cúnts,slut slút,sluts slúts,dick díck,dicks dícks,incest íncest,incestual íncestual,nigger nígger,niggers níggers,shit shít,bitch bítch,bitches bítches,cum cúm,cumming cúmming,cock cóck,whore whóre,whores whóres,homo hómo,homos hómos,fag fág,faggot fággot,faggots fággots
; 2) this is the place where you can define how the first word should look like
; if it is a nickname of that chan or the nick of that query
; note: use NICK as placeholder
var %nickstyle = 6..4 $+ NICK $+ 6..
; -------- END OF SETUP --------
; start processing all badwords
var %text = $1-, %nr = 1
while $gettok(%bad,%nr,44) {
var %token = $v1
; replace each badword with the replace-word defined above, but keep the badword's initial case
while ($findtok(%text,$gettok(%token,1,32),1,32)) {
var %match = $v1
var %new = $+($($+($chr(36),$iif(($left($gettok(%text,%match,32),1) isupper),upper,lower), $&
($left($gettok(%token,2,32),1))),2),$mid($gettok(%token,2,32),2))
var %text = $puttok(%text,%new,%match,32)
}
inc %nr
}
; start checking all words for being a nick followed by a ":" char
var %nr = 1
while ($gettok(%text,%nr,32)) {
var %token = $left($v1,-1)
if (($regex($v1,/.+:/s)) && ((%token ison $active) || (%token == $query($active)))) {
; replace the nick with the nickstyle defined above
var %text = $puttok(%text,$+($replacecs(%nickstyle,NICK,%token),$chr(15)),%nr,32)
}
inc %nr
}
; output of the text
msg $active %text
halt
}
}