Advertisement
Guest User

Untitled

a guest
Jul 8th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 4.26 KB | None | 0 0
  1. # bombe.tcl
  2. # !bomb <pseudo>
  3. # !cut <couleur>
  4.  
  5.  
  6.  
  7. bind pub - !bomb bombe:pub
  8.  bind pub - !cut cut:pub
  9.  
  10. set fils(couleur) {
  11.       jaune
  12.       rouge
  13.       marron
  14.       bleu
  15.       vert
  16.       noir
  17.       violet
  18.       orange
  19.       gris
  20.       cyan
  21.       blanc
  22.       fushia
  23. }
  24.  
  25. set bombe(set) 0
  26. set bombe(nick) ""
  27. set bombe(kickeur) ""
  28. set bombe(good) ""
  29. set bombe(list) ""
  30. set bombe(timer) ""
  31. set bombe(chan) ""
  32. set bombe(antifloodt) ""
  33. set bombe(antiflood) 0
  34. set bombe(antiflood2) 0
  35.  
  36. proc antiflood:bomb {chan} {
  37.       global bombe
  38.       if {$bombe(antiflood) >= 3} {
  39.             if {$bombe(antiflood2) == 1} { return 0 }
  40.             putserv "PRIVMSG $chan :\00314Contrôle de flood activé pour la commande !bomb : pas plus de 3 requête(s) toutes les 200 secondes.\003"
  41.             set bombe(antiflood2) 1
  42.             set bombe(antifloodt) [utimer 200 {set bombe(antiflood) 0 ; set bombe(antiflood2) 0}]
  43.             return 0
  44.       } else {
  45.             incr bombe(antiflood)
  46.       }
  47. }
  48.  
  49. proc bombe:pub {nick uhost hand chan arg} {
  50.       global fils bombe botnick
  51.      
  52.       if {[string tolower [lindex $arg 0]] == [string tolower $botnick]} {
  53.             putserv "kick $chan $nick :\00313O\0031wned \00313<3"
  54.             return 0
  55.       }
  56.       if {$bombe(set) == 1} {
  57.             if [string match "*c*" [getchanmode $chan]] {
  58.                   putserv "PRIVMSG $chan :\00314Bombe \| \0034Le jeu est deja en cours d'utilisation."
  59.             } else {
  60.                   putserv "PRIVMSG $chan :\00314Bombe \| \0034Le jeu est deja en cours d'utilisation."
  61.             }
  62.             return 0
  63.       }
  64.       if {[lindex $arg 0] == ""} {
  65.       if [string match "*c*" [getchanmode $chan]] {
  66.             putserv "PRIVMSG $chan :Bombe \| !bomb PSEUDO"
  67.       } else {
  68.             putserv "PRIVMSG $chan :\00314Bombe\003 \| !bomb PSEUDO"
  69.       }
  70.       } else {
  71.      
  72.       if {![antiflood:bomb $chan]} { return 0 }
  73.      
  74.       set bombe(set) 1
  75.       set bombe(nick) [lindex $arg 0]
  76.       set bombe(kickeur) $nick
  77.       set cdf [rand 4]
  78.       incr cdf
  79.       set x 0      
  80.       set bombe(chan) $chan
  81.       set bombe(timer) [utimer 30 {putserv "kick $bombe(chan) $bombe(nick) :Boum !! Temps écoulé !" ; set bombe(set) 0}]
  82.        while {$x<=$cdf} {
  83.             if {$x == 0} { set bombe(list) "" }
  84.              set bombe(list) "$bombe(list) [lindex $fils(couleur) [rand [llength $fils(couleur)]]]"
  85.              
  86.              incr x
  87.        }
  88.       set bombe(good) [lindex $bombe(list) [rand [llength $bombe(list)]]]
  89.       putlog "$bombe(list) + $bombe(good)"
  90.       if [string match "*c*" [getchanmode $chan]] {
  91.             putserv "PRIVMSG $chan :\00314Bombe \| \0031Attention\0034 $bombe(nick) \0031Tu dois couper le bon fil tu as 30 secondes :\0034 $bombe(list) \0031( !cut couleur )"
  92.       } else {
  93.             putserv "PRIVMSG $chan :\00314Bombe \| \0031Attention\0034 $bombe(nick) \0031Tu dois couper le bon fil tu as 30 secondes :\0034 $bombe(list) \0031( !cut couleur )"
  94.       }
  95.       }
  96. }
  97.  
  98.  
  99. proc cut:pub {nick uhost hand chan arg} {
  100.       global bombe
  101.       if {$bombe(set) == 1} {
  102.             if {$nick == $bombe(nick)} {
  103.                   if {[lindex $arg 0] == $bombe(good)} {
  104.                   if [string match "*c*" [getchanmode $chan]] {
  105.                         putserv "PRIVMSG $chan :\00314Bombe \| \0031Joli\0034 $nick !! Tu as trouvé le bon fil \0031:D"
  106.                   } else {
  107.                         putserv "PRIVMSG $chan :\00314Bombe \| \0031Joli\0034 $nick !! Tu as trouvé le bon fil \0031:D"
  108.                   }
  109.                         set bombe(set) 0
  110.                         killutimer $bombe(timer)
  111.                   } else {
  112.                         putserv "kick $chan $nick :\00314Boum !! Dtc !! Le bon fil était\0034 $bombe(good)"
  113.                         set bombe(set) 0
  114.                         killutimer $bombe(timer)
  115.                   }
  116.             } else {
  117.             if [string match "*c*" [getchanmode $chan]] {
  118.                   putserv "privmsg $chan :Bombe \| C'est a $bombe(nick) de couper le fil !"
  119.             } else {
  120.                   putserv "privmsg $chan :\00314Bombe\003 \| C'est a $bombe(nick) de couper le fil !"
  121.             }
  122.             }
  123.       }
  124.      
  125. }
  126.  
  127. putlog "\[bomb\] a été chargé."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement