Advertisement
Guest User

Untitled

a guest
May 27th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1.  
  2. # This script bans users which joins a given channel within 5 seconds
  3. # after getting kicked, for 5 minutes. Made for eggdrop v1.1
  4.  
  5. # delay before users can join the channel after a kick (in seconds)
  6. set joindelay 5
  7.  
  8. # the bans will be removed after this delay (in minutes)
  9. set bantime 5
  10.  
  11. # 0=work on one channel only, 1=multichannel (overrides channel-setting)
  12. set multichannel 0
  13.  
  14. # the channel you wish this script to work on
  15. set channel "#diablo2.de"
  16.  
  17. # do not ban users with this flag on the bot
  18. set dontban "o"
  19.  
  20. # 1=nick&host-specific bans, 0=host-specific bans
  21. set nickban 1
  22.  
  23. bind kick - * autorejoin_ban
  24. # bind join - * autorejoin_ban
  25.  
  26. proc autorejoin_ban {nick uhost hand chan knick reason} {
  27. global joindelay channel multichannel
  28.  
  29. if {![expr [lsearch -glob [utimers] "*nada $knick $chan*"] + 1]} {
  30. if {$multichannel} {
  31. utimer $joindelay [subst {kickban_when_autorejoined $knick $chan}]
  32. } else {
  33. if {$chan == $channel} {
  34. utimer $joindelay [subst {kickban_when_autorejoined {$knick} $chan}]
  35. }
  36. }
  37. }
  38. }
  39.  
  40. proc kickban_when_autorejoined {nick chan} {
  41. global bantime dontban nickban joindelay
  42.  
  43.  
  44.  
  45. if {[onchan $nick $chan]} {
  46. if {[matchattr [nick2hand $nick $chan] $dontban]} {
  47. # putserv "PRIVMSG $chan :$nick will not be banned, of course, as he has +$dontban."
  48. } else {
  49.  
  50. # hostmasking:
  51. append userhost $nick "!" [getchanhost $nick $chan]
  52. set hostmask [maskhost $userhost]
  53. if {[string first @ $hostmask]<12} {
  54. set hostmask "*!*[string range $hostmask 2 [string length $hostmask]]"
  55. }
  56.  
  57. # insert nick for nickban:
  58. if {$nickban} { set hostmask "*$nick$hostmask"}
  59.  
  60. # performance:
  61. putserv "MODE $chan +b $hostmask"
  62. utimer [expr 3 * $joindelay] [subst {nada $nick $chan}]
  63. putserv "KICK $chan $nick :autorejoined after getting kicked. -> lamer!"
  64.  
  65. if {![expr [lsearch -glob [utimers] "*MODE $chan -b $hostmask*"] + 1]} {
  66. utimer [expr 60 * $bantime] [subst {putserv "MODE $chan -b $hostmask"}]
  67. }
  68.  
  69. putserv "notice $nick :Somebody kicked you, and you autorejoined. $bantime minutes in the corner! Turn off autorejoin!"
  70. }
  71. }
  72. }
  73.  
  74. proc nada {nick chan} { }
  75.  
  76. putlog "NO! autorejoin v1.1c by nickerne"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement