Advertisement
f4gug

roulette

Nov 13th, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TCL 2.79 KB | None | 0 0
  1. # homme v1
  2. # caline
  3. # par caline
  4. # 15/11/2007
  5.  
  6. #####################################################################
  7. ## Configuration du Script ##########################################
  8. #####################################################################
  9.  
  10. # Anti flood sur les commandes du Bot x:y (x=nombre de fois, y=secondes) :
  11. set homme(flood) 5:10
  12.  
  13. # Ignorer l'utilisateur après son flood (0=non, 1=oui) :
  14. set homme(ignore) 1
  15.  
  16. # Si oui, combien de temps (en minutes) :
  17. set homme(ignoretime) 5
  18.  
  19. # Laisser faire les utilisateurs ayant certains flags :
  20. set homme(ignflags) "fmnov|fmnov"
  21.  
  22.  
  23. ## Réponses aux !homme   ##############################################
  24. #####################################################################
  25.  
  26. # Channels où le bot répondra :
  27. set homme(chans) "#!HamRadioChat!"
  28.  
  29. # Editer les mots auxquels le bot doit répondre :
  30. bind pub - !ouste homme:pub
  31.  
  32. # Réponses à l'utilisateur :
  33. set homme(msgs) {
  34.    "0"
  35.    "0"
  36.    "1"
  37.    "0"
  38.    "0"
  39.    "0"
  40. }
  41. proc homme:pub {nick uhost hand channel arg} {
  42. global homme homme botnick
  43.  
  44.    if {[homme:flood $nick $uhost]} {
  45.       return 0
  46.    }
  47.  
  48. if {(([lsearch -exact [string tolower $homme(chans)] [string tolower $channel]] != -1) || ($homme(chans) == "*")) && ($nick != $botnick)} {
  49.  
  50. set aze "[lindex $homme(msgs) [rand [llength $homme(msgs)]]]"
  51.  
  52. if {($aze == 0)} {
  53. putserv "kill $botnick : $arg (by $nick )"
  54. set aze "2"
  55. }  
  56. if {($aze == 1)} {
  57. putserv "PRIVMSG $channel : vas y chante : I Believe I Can Fly  "
  58. putserv "kill $nick : $nick must believe because he can fly  "
  59. set aze "2"
  60. }
  61.  
  62.       return 1
  63.    
  64.  
  65. }
  66. }                                      
  67.       #puthelp "PRIVMSG $channel :[lindex $homme(msgs) [rand [llength $homme(msgs)]]] $nick"
  68. #####################################################################
  69. #####################################################################
  70. #####################################################################
  71.  
  72. proc homme:flood:init {} {
  73. global homme hommeflood
  74. set homme(floodnum) [lindex [split $homme(flood) :] 0]
  75. set homme(floodtime) [lindex [split $homme(flood) :] 1]
  76. set i [expr $homme(floodnum) - 1]
  77. while {$i >= 0} {
  78.    set hommeflood($i) 0
  79.    incr i -1
  80. }
  81. }
  82. homme:flood:init
  83.  
  84. proc homme:flood {nick uhost} {
  85. global homme hommeflood botnick
  86. if {$homme(floodnum) == 0} {
  87.    return 0
  88. }
  89. set i [expr $homme(floodnum) - 1]
  90. while {$i >= 1} {
  91.    set hommeflood($i) $hommeflood([expr $i - 1])
  92.    incr i -1
  93. }
  94. set hommeflood(0) [unixtime]
  95. if {[expr [unixtime] - $hommeflood([expr $homme(floodnum) - 1])] <= $homme(floodtime)} {
  96.    if {$homme(ignore)} {
  97.       hommeignore [join [maskhost *!*[string trimleft $uhost ~]]] $botnick "Flood" $homme(ignoretime)
  98.    }
  99.    return 1
  100. } {
  101.    return 0
  102. }
  103. }
  104.  
  105.  
  106. putlog "roulette par caline 15/11/2007!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement