Anti Advertise

Do you have script in mind but no ability to make it, type in what it should do, and you might be lucky.

Anti Advertise

Postby Lymmel » Tue May 05, 2009 10:31 am

Hello:)))


I need help with a Anti Advertise script..

I want it to ban och devoice the user who do a adv for a channel (#) and http links etc... Only ban and devoice, not kicking <- BANTIME: 2min


And one more thing.. i want it to check after spambots in priv etc... And kicking and banning the spambot in 2 hours

Somebody who can help me?


Sorry bad english^^


XXX lymmel
Lymmel
 

Re: Anti Advertise

Postby nsm » Tue May 05, 2009 8:37 pm

I made a simple devoice/ban script, but its not enought it dont unban on the timer.
Code: Select all
variable bantime
array set bantime {
      "spamscan" "5"

}

bind PUBM - "*" advertise:prot

proc advertise:prot {n u h c m} {
if {![isop $n $c] && ![isvoice $n $c]} { return }
if {[matchattr $h nmf|nmf $c]} { return }
if {[string match -nocase "*idle*" "$m"] || [string match -nocase "*join*" "$m"]  || [string match "*#*" "$m"] || [string match -nocase "*www.*" "$m"] || [string match -nocase  "*raute*" "$m"] || [string match -nocase  "*http:\/\/*" "$m"] || [string match -nocase "*Bananentausch*" "$m"]} then {
set banmask "*!*$u"
putquick "privmsg $n :You have violated $c and/or Quakenets rules. Cease your abuse! - www.mynsm.se/chanrules"
putquick "MODE $c +b $u"
putquick "mode $c -v $n"
}
flushmode $c
utimer [expr {$::bantime(spamscan) * 60}] [list pushmode $c -b $banmask] || [putquick "mode $c +v $n"]

}

nsm
 

Re: Anti Advertise

Postby Cristian » Fri May 08, 2009 5:57 pm

I hope its okay I changed the script a bit.

I added a variable, making it easier to add more matches for the anti advertise,

.chanset #channel +anti-advert (to activate it in your channel (partyline))

Operators, Voice and users added with exemptflags are ignored.
Bot is required operator status.

Change the variables after your need, if you have questions please post them, and I'll answer them as quick as possible.


Code: Select all
setudef flag anti-advert

namespace eval advertisement {

   namespace eval variable {
      variable bantime 2
      variable spambotbantime 120
      variable exemptflags "nmf|nmf"
      variable warnmessage "You are violating :channel: or Quakenet rules. Cease your abuse!"
      variable spammessage "Spam messages in private chat. Banned for :spambotbantime: minuttes"
   }

   if {[info exists words]} {
      unset words
   }

   set words {
      "*www.*"
      "*join*#*"
      "*http:\/\/*"
      "*idle*#*"
   }

   bind PUBM - "*" [namespace current]::public
   bind MSGM - "*" [namespace current]::private

   proc public {nickname hostname handle channel text} {
      if {[channel get $channel anti-advert]} {
         if {[::advertisement::allow $nickname $handle $channel]} {
            set result 0
            foreach word $::advertisement::words  {
               if {[string match $word "$text"]} {
                  set result 1
               }
            }
            
            if {$result == 1} {
               set banmask "*!*[string trim $hostname "~"]"
               
               putserv "PRIVMSG $nickname :[string map "\":channel:\" \"$channel\"" $::advertisement::variable::warnmessage]"
               putquick "MODE $channel -v+b $nickname $banmask"
               
               timer $::advertisement::variable::bantime [list pushmode $channel -b $banmask]
            }
         }
      }
   }
   proc private {nickname hostname handle text} {
      set result 0
      foreach word $::advertisement::words  {
         if {[string match $word "$text"]} {
            set result 1
         }
      }
            
            
            
      if {$result == 1} {
         foreach channel [channels] {
            
            if {[channel get $channel anti-advert]} {
               if {[::advertisement::allow $nickname $handle $channel]} {
                  set banmask "*!*[string trim $hostname "~"]"
         
                  set kickmessage [string map "\":spambotbantime:\" \"$::advertisement::variable::spambotbantime\"" $::advertisement::variable::spammessage]
         
                  if {[onchan $nickname $channel]} {
                     putquick "KICK $channel $nickname :$kickmessage"
                     putquick "MODE $channel +b $banmask"
                  }
                  newchanban $channel $banmask $::botnick "$kickmessage" $::advertisement::variable::spambotbantime
               }
            }
         }
      }
   }
   proc allow {nickname handle channel} {
      if {[botisop $channel]} {
         return 1
      } elseif {![isop $nickname $channel]} {
         return 1
      } elseif {![isvoice $nickname $channel]} {
         return 1
      } elseif {![matchattr $handle $::advertisement::variable::exemptflags $channel]} {
         return 1
      }
   }
}
Cristian
proof of advance
proof of advance
 
Posts: 282
Joined: Sun Nov 04, 2007 3:02 pm
Location: Denmark
Authnick: Sumsar


Return to TCL Scripting Request

Who is online

Users browsing this forum: No registered users and 1 guest

cron