mIRC Homepage
Posted By: Julian_P Self Censoring in channel messages. - 05/03/19 03:28 PM
Hi mirc help,

Can a senders message be prevented sending to my client on the basis it contains a word I've personally marked as to be censored?
Can this be achieved using a script?

1) This a banned word list would be useful to limit the Voice Reader from reading out things like URLs or other repetitive messages.

Julian P
Posted By: rafa555 Re: Self Censoring in channel messages. - 06/03/19 02:27 AM
There's many ways to code it, i did one quick and easy to understand, you can remove the notes with ";"

Code:
; "correct" is the name of the Identifier, you can change, but need to change all the others too
alias correct {
; $1- is all the text you'll send
  if ($1 != $null) %a = $1-
; list of words to be blocked from sending, "halt" will stop all actions
  if (WORD1 isin %a) { halt }
  if (WORD2 isin %a) { halt }
  if (WORD3 isin %a) { halt }
; if there's no blocked words on the text, it'll be sent normally
  else { return %a }
}

; this is the event of when you type something in a private chat
on *:INPUT:?:{
; this is the mensage that you'll see
  echo -t < $+ $me $+ > $correct($1-) 
; this is the mensage that you'll send
  .msg $active $correct($1-)
; end command, to stop any other action from happening
  halt
}

; this is the event of when you type something in a #Channel
on *:INPUT:#:{
; this is the mensage that you'll send
  .raw privmsg # : $+ $correct($1-) 
; this is the mensage that you'll see
  echo -mtli3 # < $+ $me $+ >  $correct($1-)
; end command, to stop any other action from happening
  halt
}


Change WORD1,WORD2,WORD3 with the words that you like, also add as many you wish, following the same patter, i don't know how well you know mIRC Scripting, but theres some options, like case sensitive words, instead of "isin" it's "isincs"

You can also replace a word with another one, using $replace

Code:
alias correct {
  if ($1 != $null) %a = $1-
  if (HI isin %a) { return $replace(%a,$v1,HELLO) }
  else { return %a }
}


But be careful to don't cause conflict, if theres more than 1 word that you want to replace on the text, since this is a simple code.
© mIRC Discussion Forums