Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. # This sets what channel it should respond in
  2. setudef flag roulette
  3. # Random values for current chamber and loaded chamber based on rounds in gun
  4. set gunRounds 6
  5. set currentRound [expr {int(rand()*$gunRounds)} +1]
  6. set loadedChamber [expr {int(rand()*$gunRounds)} +1]
  7.  
  8. bind pub - %rr russianroulette
  9.  
  10. proc russianroulette {nick host handle chan text} {
  11. if {![channel get $channel roulette]} {
  12. return 0
  13. }
  14. global currentRound loadedChamber gunRounds
  15.  
  16. if {$currentRound == $loadedChamber} {
  17. puthelp "PRIVMSG $chan :$nick loads one bullet. He spins the barrel and pulls the trigger."
  18. newbanchan $chan "$nick!*@*" oldtopbot "Lost at Russian Roulette. (5 minutes)" 5
  19. puthelp "PRIVMSG ChanServ :KICK $rouletteChan $nick died. Respawn in 5 minutes."
  20. set currentRound [expr {int(rand()*$gunRounds)} +1]
  21. set loadedChamber [expr {int(rand()*$gunRounds)} +1]
  22. puthelp "PRIVMSG $chan :The gun has been reloaded with a new round."
  23. return 1
  24. } elseif {$currentRound != $loadedChamber} {
  25. puthelp "PRIVMSG $chan :$nick hears the hammer click, but he emerges unscathed."
  26. if {$currentRound > $gunRounds} {
  27. set currentRound 0
  28. } else {
  29. incr currentRound
  30. }
  31. return 1
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement