mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
on *:TOPIC:#superkids:{
if $istok(MrDude.SuperMan.tailpush.Geofax.repent.rox.ChopperS.DjTheWizz.DjTheW|zz.Mrdud3.superm4n,$nick,46) { mode $chan +b $address($nick,2) | kick $chan $nick You're banned from setting a topic! ... please set a topic; relevant to the channelsname! | topic $chan Open and free! (Anyone please set a topic; relevant to the channelsname.. It might spark an intersting chat!) }
elseif (superman isin $1-) { mode $chan +t | .timer 1 $rand(10,60) mode $chan -t | topic $chan Open and free! (Anyone please set a topic; relevant to the channelsname.. It might spark an intersting chat!) }
}




This script will autoban anyone who sets a topic containing "superman" .. But how do I make it do that to multiple words? I wouldm like for it to also ban if someone type "foreskin" and "supe3rM4n" ..



Also, is there a way to make it ban people who deletes the topic? If anyone banned by this script, set a blank topic. Nothing happens. And they manage to ruin the open channel for all the rest of us.. frown

Last edited by gomp; 21/05/10 03:09 PM.

I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Code:
on !@*:topic:#superkids:{
  var %n = MrDude.SuperMan.tailpush.Geofax.repent.rox.ChopperS.DjTheWizz.DjTheW|zz.Mrdud3.superm4n
  var %w = foreskin|supe3rM4n|word3|word4|etc.
  if $istok(%n,$nick,46) { 
    ban -k # $nick 2 You're banned from setting a topic! ... please set a topic; relevant to the channelsname!
    topic $chan Open and free! (Anyone please set a topic; relevant to the channelsname.. It might spark an intersting chat!) 
  }
  elseif $istok(%w,$1-,124) { 
    mode # +t | .timer 1 $r(10,60) mode # -t
    topic # Open and free! (Anyone please set a topic; relevant to the channelsname.. It might spark an intersting chat!) 
  }
}
Just replace word3, etc..with more words you want to add, along with a pipe to divide between each word added.

I'm not sure about the empty topic. Are they using a character of some sort to set it as empty?

Joined: Jun 2004
Posts: 243
G
gomp Offline OP
Fjord artisan
OP Offline
Fjord artisan
G
Joined: Jun 2004
Posts: 243
Originally Posted By: Tomao
Code:
on !@*:topic:#superkids:{
  var %n = MrDude.SuperMan.tailpush.Geofax.repent.rox.ChopperS.DjTheWizz.DjTheW|zz.Mrdud3.superm4n
  var %w = foreskin|supe3rM4n|word3|word4|etc.
  if $istok(%n,$nick,46) { 
    ban -k # $nick 2 You're banned from setting a topic! ... please set a topic; relevant to the channelsname!
    topic $chan Open and free! (Anyone please set a topic; relevant to the channelsname.. It might spark an intersting chat!) 
  }
  elseif $istok(%w,$1-,124) { 
    mode # +t | .timer 1 $r(10,60) mode # -t
    topic # Open and free! (Anyone please set a topic; relevant to the channelsname.. It might spark an intersting chat!) 
  }
}
Just replace word3, etc..with more words you want to add, along with a pipe to divide between each word added.

I'm not sure about the empty topic. Are they using a character of some sort to set it as empty?



Thanks! I will implement it now.

Edit: There is a problem with this. Is there a way to make it ban if the word is in the topic in any way?

It only works when the topic contains ONLY one of the words that are banned..




I mean: If someone set the topic to: foreskin
..then the script works!

But if someone set the topic to: foreskin is nice
...then the script does nothing.. frown





No characters no, that is the problem, if one set a empty topic. This is how it looks: 22 14:14:45 * Curious changes topic to ''
..and after that there just is no topic set.


Last edited by gomp; 22/05/10 12:44 PM.

I do not speak English. I speak Norwegian. So please bear with my poor English spelling and grammar.
Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
You have to either loop all the words of topic $1- (to check each for being a token of your badword string), or loop your badwords (to check each for being a token of topic $1-). Or use a more sophisticated method like $hfind(R). IMO a simple loop will suffice because topic changes are rather infrequent and performance shouldn't be a big issue.

Basically, you want to do what all "badword scripts" do. The only difference is that you'll check $1- of the "on topic" event instead of the "on text" event. Take a look at some existing badword scripts - you'll find dozends in these forums and a lot more on dedicated mIRCscript websites.
smile

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
With Horstl's suggestion in mind, this will prevail:
Code:
on !@*:topic:#superkids:{
  var %a = foreskin|supe3rM4n|word3|word4|etc...
  var %n = $numtok(%a,124) | while (%n) {
    if $istok($strip($1-),$gettok(%a,%n,124),32) {
      ban -k # $nick 2 Please set a topic relevant to the channelsname!
      topic # Open and free! (Anyone please set a topic; relevant to the channelsname.. It might spark an intersting chat!)
    }
    dec %n
  }
}


Link Copied to Clipboard