SHARE
TWEET

Untitled




Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- # Anti flood sur les commandes du Bot x:y (x=nombre de fois, y=secondes) :
- set octopopo(flood) 3:15
- # Ignorer l'utilisateur après son flood (0=non, 1=oui) :
- set octopopo(ignore) 1
- # Si oui, combien de temps (en minutes) :
- set octopopo(ignoretime) 3
- # Laisser faire les utilisateurs ayant certains flags :
- set octopopo(ignflags) "fmnov|fmnov"
- # Préfixe des commandes du script :
- set octopopo(command) "!"
- # Channels où les commandes seront effectives :
- set octopopo(chans) "*"
- #####################################################################
- proc octopopo:flood:init {} {
- global octopopo octopopoflood
- set octopopo(floodnum) [lindex [split $octopopo(flood) :] 0]
- set octopopo(floodtime) [lindex [split $octopopo(flood) :] 1]
- set i [expr $octopopo(floodnum) - 1]
- while {$i >= 0} {
- set octopopoflood($i) 0
- incr i -1
- }
- }
- octopopo:flood:init
- proc octopopo:flood {nick uhost} {
- global octopopo octopopoflood botnick
- if {$octopopo(floodnum) == 0} {
- return 0
- }
- set i [expr $octopopo(floodnum) - 1]
- while {$i >= 1} {
- set octopopoflood($i) $octopopoflood([expr $i - 1])
- incr i -1
- }
- set octopopoflood(0) [unixtime]
- if {[expr [unixtime] - $octopopoflood([expr $octopopo(floodnum) - 1])] <= $octopopo(floodtime)} {
- if {$octopopo(ignore)} {
- newignore [join [maskhost *!*[string trimleft $uhost ~]]] $botnick "Flood" $octopopo(ignoretime)
- }
- return 1
- } {
- return 0
- }
- }
- ##########
- bind pub -|- $octopopo(command)cerveau octopopo:cerveau
- proc octopopo:cerveau {nick uhost hand channel arg} {
- global botnick octopopo
- if ![matchattr $nick $octopopo(ignflags) $channel] {
- if {[octopopo:flood $nick $uhost]} {
- return 0
- }
- }
- if {(([lsearch -exact [string tolower $octopopo(chans)] [string tolower $channel]] != -1) || ($octopopo(chans) == "*")) && (![matchattr $hand b]) && ($nick != $botnick)} {
- if ![string length $arg] {
- puthelp "PRIVMSG $channel :$nick s'offre un Cerveau :)"
- return 1
- } elseif {[string tolower $arg] == [string tolower $botnick]} {
- puthelp "PRIVMSG $channel : Non merci $nick , suis programmé moi :)"
- return 1
- } elseif {[string tolower $arg] == [string tolower $nick]} {
- puthelp "PRIVMSG $channel : $nick s'offre un Cerveau :)"
- return 1
- } else {
- puthelp "PRIVMSG $channel : PLOP!!! Un nouveau Cerveau Tout Neuf $arg ...Merci $nick mais c'est pas sur que cela lui serve!"
- return 1
- }
- }
- }
- putlog "octopopo v1.1 by ShadOw loaded!"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.