paintbalbot

AutoVoice

Feb 25th, 2015
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 3.27 KB | None | 0 0
  1. ;Dear people
  2. ;i couldn't convert this into a willie module due to special events like on DNS and raw 302, so i just left it as mirc
  3. ;i've set up a few variables
  4. ;that will make this easier
  5. ;NOTE::: the user MUST be an operator of the channel due to gamesurge's configuration.
  6. ;----------
  7. ;|FEATURES|
  8. ;----------
  9. ;ip list stored in %appdata%\mIRC (goodips.txt)
  10. ;operators add/remove people
  11. ;manual autovoice preference
  12. ;-------
  13. ;|USAGE|
  14. ;-------
  15. ;add people    !av [name of person]
  16. ;remove people !rv [name of person]
  17. ;manual usage  !autovoice [on/off]
  18. ;should be used with channel modes +m, and chanserv as "!set givevoice 100"
  19. on *:start: {
  20.   set -e %WantedNickName botname
  21.   set -e %AltNickName alternate
  22.   set -e %channelname #yourchannel
  23.   set -e %username authserv username
  24.   set -e %password authserv password
  25.   nick %WantedNickName
  26.   set -e %checknicktaken t
  27.   server irc.gamesurge.net 6667
  28.   .timercheck 1 15 checknicktaken
  29. }
  30. alias checknicktaken {
  31.   if (%checknicktaken == t) {
  32.     nick %AltNickName
  33.     server irc.gamesurge.net 6667
  34.   }
  35. }
  36. on *:connect: {
  37.   set -e %checknicktaken f
  38.   authserv auth %username %password
  39.   authserv set autofake on
  40.   umode +x
  41.   join %channelname
  42. }
  43. alias scanip {
  44.   set -u20 %scanning.for $1
  45.   set -u20 %scan.active $true
  46.   set -u20 %chan $chan($active)
  47.   set -u20 %st $nick( %chan ,0)
  48.   set -u20 %sp 1
  49.   .userhost $1
  50.   set -u20 %nick.ip $1
  51. }
  52. alias scan.nick {
  53.   set -u20 %scan.nick $true
  54.   userhost %nick.ip
  55. }
  56. raw 302:*:{
  57.   if (%scan.active) || (%scan.nick) {
  58.     set -u20 %nickhost $2
  59.     scan.for.match
  60.   }
  61. }
  62. alias scan.for.match {
  63.   tokenize 64 %nickhost
  64.   set -u20 %curr.nick $1
  65.   set -u20 %toknickhost $2
  66.   tokenize 61 %curr.nick
  67.   set -u20 %current.nick $1
  68.   .dns %toknickhost
  69. }
  70. on 1:DNS:{
  71.   if (!$dns(1).ip) {
  72.     afterscan %nick.ip %toknickhost
  73.     unset %scan.nick
  74.     halt
  75.   }
  76.   afterscan %nick.ip $dns(1).ip
  77.   unset %scan.nick
  78.   halt
  79. }
  80. alias afterscan {
  81.   if (%scantype == add) {
  82.     write goodips.txt $2
  83.     mode %channelname +v $1
  84.     echo -a added $1 ( $2 )
  85.   }
  86.   if (%scantype == check) {
  87.     if (!$read(goodips.txt,$2)) { echo -a $1 $2 | return }
  88.     echo -a checked $1
  89.     mode %channelname +v $1
  90.   }
  91.   if (%scantype = rem) {
  92.     write -ds $+ $2 goodips.txt
  93.     mode %channelname -v $1
  94.     echo -a removed $1
  95.   }
  96. }
  97. on *:join:*: {
  98.   if (%mode == on) {
  99.     set -e %scantype check
  100.     scanip $nick
  101.   }
  102. }
  103. on *:mode:*: {
  104.   if ($chr(109) isin $1-) {
  105.     if ($chr(43) isin $1-) {
  106.       set -e %mode on
  107.       msg %channelname Auto-voice is now ON. turn it off by "!autovoice off"
  108.       return
  109.     }
  110.     if ($chr(45) isin $1-) {
  111.       set -e %mode off
  112.       msg %channelname Auto-voice is now OFF. turn it on by "!autovoice on"
  113.       return
  114.     }
  115.   }
  116. }
  117. on *:text:!autovoice*:*: {
  118.   if ($nick !isop %channelname) { return }
  119.   if ($2 == off) {
  120.     set -e %mode off
  121.     msg %channelname Auto-voice is now OFF. turn it off by "!autovoice off"
  122.   }
  123.   if ($2 == on) {
  124.     set -e %mode on
  125.     msg %channelname Auto-voice is now ON. turn it off by "!autovoice off"
  126.   }
  127. }
  128. on *:text:!av*:*: {
  129.   if ($nick !isop $chan) { return }
  130.   set -e %scantype add
  131.   scanip $2
  132. }
  133. on *:text:!rv*:*: {
  134.   if ($nick !isop $chan) { return }
  135.   set -e %scantype rem
  136.   scanip $2
  137. }
Advertisement
Add Comment
Please, Sign In to add comment