Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # bombe.tcl
- # !bomb <pseudo>
- # !cut <couleur>
- bind pub - !bomb bombe:pub
- bind pub - !cut cut:pub
- set fils(couleur) {
- jaune
- rouge
- marron
- bleu
- vert
- noir
- violet
- orange
- gris
- cyan
- blanc
- fushia
- }
- set bombe(set) 0
- set bombe(nick) ""
- set bombe(kickeur) ""
- set bombe(good) ""
- set bombe(list) ""
- set bombe(timer) ""
- set bombe(chan) ""
- set bombe(antifloodt) ""
- set bombe(antiflood) 0
- set bombe(antiflood2) 0
- proc antiflood:bomb {chan} {
- global bombe
- if {$bombe(antiflood) >= 3} {
- if {$bombe(antiflood2) == 1} { return 0 }
- putserv "PRIVMSG $chan :\00314Contrôle de flood activé pour la commande !bomb : pas plus de 3 requête(s) toutes les 200 secondes.\003"
- set bombe(antiflood2) 1
- set bombe(antifloodt) [utimer 200 {set bombe(antiflood) 0 ; set bombe(antiflood2) 0}]
- return 0
- } else {
- incr bombe(antiflood)
- }
- }
- proc bombe:pub {nick uhost hand chan arg} {
- global fils bombe botnick
- if {[string tolower [lindex $arg 0]] == [string tolower $botnick]} {
- putserv "kick $chan $nick :\00313O\0031wned \00313<3"
- return 0
- }
- if {$bombe(set) == 1} {
- if [string match "*c*" [getchanmode $chan]] {
- putserv "PRIVMSG $chan :\00314Bombe \| \0034Le jeu est deja en cours d'utilisation."
- } else {
- putserv "PRIVMSG $chan :\00314Bombe \| \0034Le jeu est deja en cours d'utilisation."
- }
- return 0
- }
- if {[lindex $arg 0] == ""} {
- if [string match "*c*" [getchanmode $chan]] {
- putserv "PRIVMSG $chan :Bombe \| !bomb PSEUDO"
- } else {
- putserv "PRIVMSG $chan :\00314Bombe\003 \| !bomb PSEUDO"
- }
- } else {
- if {![antiflood:bomb $chan]} { return 0 }
- set bombe(set) 1
- set bombe(nick) [lindex $arg 0]
- set bombe(kickeur) $nick
- set cdf [rand 4]
- incr cdf
- set x 0
- set bombe(chan) $chan
- set bombe(timer) [utimer 30 {putserv "kick $bombe(chan) $bombe(nick) :Boum !! Temps écoulé !" ; set bombe(set) 0}]
- while {$x<=$cdf} {
- if {$x == 0} { set bombe(list) "" }
- set bombe(list) "$bombe(list) [lindex $fils(couleur) [rand [llength $fils(couleur)]]]"
- incr x
- }
- set bombe(good) [lindex $bombe(list) [rand [llength $bombe(list)]]]
- putlog "$bombe(list) + $bombe(good)"
- if [string match "*c*" [getchanmode $chan]] {
- putserv "PRIVMSG $chan :\00314Bombe \| \0031Attention\0034 $bombe(nick) \0031Tu dois couper le bon fil tu as 30 secondes :\0034 $bombe(list) \0031( !cut couleur )"
- } else {
- putserv "PRIVMSG $chan :\00314Bombe \| \0031Attention\0034 $bombe(nick) \0031Tu dois couper le bon fil tu as 30 secondes :\0034 $bombe(list) \0031( !cut couleur )"
- }
- }
- }
- proc cut:pub {nick uhost hand chan arg} {
- global bombe
- if {$bombe(set) == 1} {
- if {$nick == $bombe(nick)} {
- if {[lindex $arg 0] == $bombe(good)} {
- if [string match "*c*" [getchanmode $chan]] {
- putserv "PRIVMSG $chan :\00314Bombe \| \0031Joli\0034 $nick !! Tu as trouvé le bon fil \0031:D"
- } else {
- putserv "PRIVMSG $chan :\00314Bombe \| \0031Joli\0034 $nick !! Tu as trouvé le bon fil \0031:D"
- }
- set bombe(set) 0
- killutimer $bombe(timer)
- } else {
- putserv "kick $chan $nick :\00314Boum !! Dtc !! Le bon fil était\0034 $bombe(good)"
- set bombe(set) 0
- killutimer $bombe(timer)
- }
- } else {
- if [string match "*c*" [getchanmode $chan]] {
- putserv "privmsg $chan :Bombe \| C'est a $bombe(nick) de couper le fil !"
- } else {
- putserv "privmsg $chan :\00314Bombe\003 \| C'est a $bombe(nick) de couper le fil !"
- }
- }
- }
- }
- putlog "\[bomb\] a été chargé."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement