westor

Twitch commands fix v1.0 for zigress

Sep 24th, 2017
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Smash4UBot
  2. ;Version 1.7.0 - updates
  3. ;Last updated 3:53 PM CST on 9/24/17
  4.  
  5. ;:::::::::::::::::::
  6. ; Connect Commands :
  7. ;:::::::::::::::::::
  8.  
  9. /* The script below should not be removed or adjusted under any circumstances.
  10. This script has been automatically installed for you as your bot is connected to irc.twitch.tv.
  11. irc.twitch.tv has anti-flood measures in place. If your bot sends 20 messages/commands to irc.twitch.tv
  12. within 30 seconds, irc.twitch.tv will place an 8 hour chat block on your bot.
  13.  
  14. This script prevents your bot from triggering irc.twitch.tv's anti-flood systems by stopping messages
  15. from being sent if sending them would result in a block.
  16.  
  17. The script has been thoroughly tested, we do not recommend editing or removing it.
  18. Editing or removing the script below may result in your bot being blocked from irc.twitch.tv.
  19. */
  20.  
  21. alias mod { return $iif($msgtags(user-type).key == mod || $mid(#, 2-) == $nick, $true) }
  22. alias sub { return $iif($msgtags(subscriber).key == 1,$true) }
  23. alias reg { return $iif($msgtags(user-type).key == reg || $mid(#, 2-) == $nick, $true) }
  24.  
  25. on *:CONNECT: { join #smash4ubot }
  26. on *:LOGON:*:{
  27.   raw CAP REQ :twitch.tv/membership
  28.   raw CAP REQ :twitch.tv/tags
  29.   raw CAP REQ :twitch.tv/commands
  30.   /debug @raw
  31. }
  32.  
  33. ON *:TEXT:!joinchannel:#smash4ubot: {
  34.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  35.   var %f = chans.txt
  36.   var %c = $chr(35) $+ $nick
  37.   var %r = $read(%f,nw,%c)
  38.   if (!%r) { var %add = 1 | write %rn $qt(%f) %c }
  39.  
  40.   if ($me !ison %c) { join -n %c | msg $chan I have joined $nick $+ 's channel! $iif(%add,- (added in the channel list)) You must mod me to use my features! Thank you for choosing Smash4UBot. }
  41.   else { msg $chan I am already in %c $+ 's channel. }
  42. }
  43.  
  44. ON *:TEXT:!leave:#smash4ubot: {
  45.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  46.   var %f = chans.txt
  47.   var %c = $chr(35) $+ $nick
  48.   var %r = $read(%f,nw,%c)
  49.   var %rn = $readn
  50.   if (%r) && (%rn) { var %del = 1 | write -dl $+ %rn $qt(%f) }
  51.  
  52.   if ($me ison %c) { part %c | msg $chan I have left $+($nick,'s) channel. $iif(%del,- (removed from the channel list)) I hope I can revisit soon! Thank you for using Smash4UBot. }
  53.   else { msg $chan I am not in $nick $+ 's channel }
  54. }
  55.  
  56. ON *:TEXT:!joinchannel *:#smash4ubot: {
  57.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  58.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  59.  
  60.   var %f = chans.txt
  61.   var %c = $chr(35) $+ $2
  62.   var %r = $read(%f,nw,%c)
  63.   if (!%r) { var %add = 1 | write $qt(%f) %c }
  64.  
  65.   if ($me !ison %c) { join -n %c | msg $chan I have joined $2 $+ 's channel! $iif(%add,- (added in the channel list)) }
  66.   else { msg $chan I am already into %c channel! }
  67. }
  68.  
  69. ON *:TEXT:!leavechannel *:#smash4ubot: {
  70.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  71.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  72.  
  73.   var %f = chans.txt
  74.   var %c = $chr(35) $+ $2
  75.   var %r = $read(%f,nw,%c)
  76.   var %rn = $readn
  77.   if (%r) && (%rn) { var %del = 1 | write -dl $+ %rn $qt(%f) }
  78.  
  79.   if ($me ison %c) { part %c | msg $chan I have parted from $2 $+ 's channel! $iif(%del,- (removed from the channel list)) }
  80.   else { msg $chan I am not in %c $+ 's channel! }
  81. }
  82.  
  83. ON *:TEXT:!joinallchannels:#smash4ubot: {
  84.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  85.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  86.   if ($timer([PART_FINISH])) { msg $chan You cannot execute that command now because !leaveallchannels is in use. | return }
  87.   var %f = chans.txt
  88.   var %t = $lines(%f)
  89.   if (!$isfile(%f)) || (!%t) { msg $chan There aren't any channels in the database. | return }
  90.   var %total = $calc($calc(%t +3) * 5000)
  91.   msg $chan Starting to join %t channels - please wait at least $duration($calc(%total / 1000)) $+ ...
  92.  
  93.   var %i = 1
  94.   while (%i <= %t) {
  95.     var %c = $read(%f,n,%i)
  96.     if (%c) && ($me !ison %c) {
  97.       var %tot = $addtok(%tot,%c,44)
  98.       .timer[JOIN_ $+ %c $+ ] -ho 1 $calc(%i * 5000) join -n %c
  99.       .timer[JOIN_MSG_ $+ %c $+ ] -ho 1 $calc(%i * 5100) msg $chan REBOOTING BOT - I have joined %c $+ 's channel.
  100.     }
  101.     inc %i
  102.   }
  103.   if (%tot) { .timer[JOIN_FINISH] -ho 1 %total msg $chan Finished! Kreygasm I have joined $numtok(%tot,44) channels. }
  104.   else { msg $chan I have already joined all the channels in the database. }
  105. }
  106.  
  107. ON *:TEXT:!leaveallchannels:#smash4ubot: {
  108.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  109.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  110.   if ($timer([JOIN_FINISH])) { msg $chan You cannot execute that command now because !joinallchannels is in use. | return }
  111.   var %f = chans.txt
  112.   var %t = $lines(%f)
  113.   if (!$isfile(%f)) || (!%t) { msg $chan There aren't any channels in the database. | return }
  114.   var %total = $calc($calc(%t +3) * 5000)
  115.   msg $chan Starting to leave from %t channels, please wait at least $duration($calc(%total / 1000)) $+ ...
  116.  
  117.   var %i = 1
  118.   while (%i <= %t) {
  119.     var %c = $read(%f,n,%i)
  120.     if (%c) && ($me ison %c) {
  121.       var %tot = $addtok(%tot,%c,44)
  122.       .timer[PART_ $+ %c $+ ] -ho 1 $calc(%i * 5000) part %c
  123.       .timer[PART_MSG_ $+ %c $+ ] -ho 1 $calc(%i * 5100) msg $chan I parted from %c $+ 's channel.
  124.     }
  125.     inc %i
  126.   }
  127.   if (%tot) { .timer[PART_FINISH] -ho 1 %total msg $chan Finished - I have left $numtok(%tot,44) channels. }
  128.   else { msg $chan I have already left all the channels in the database. }
  129. }
  130.  
  131. ON *:TEXT:!chans:#smash4ubot: {
  132.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  133.   var %f = chans.txt
  134.   var %t = $lines(%f)
  135.   if (!%t) { msg $chan There aren't any channels in the database. }
  136.   else { msg $chan There are %t currently channels in the database. }
  137. }
  138.  
  139. ;::::::::::::::::
  140. ; Test Commands :
  141. ;::::::::::::::::
  142.  
  143. on *:TEXT:!test:#: {
  144.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  145.   if ($mod) { msg # Hi! I'm here! HeyGuys }
  146.   else { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer }
  147. }
  148.  
  149. on *:TEXT:!testsub:#: {
  150.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  151.   if ($mod) {
  152.     raw *:*: { echo -t @raw RAW: nick $nick string $msgtags }
  153.     if (subscriber=1 isin $msgtags) { msg # Hey look, a subscriber! PogChamp }
  154.   }
  155.   else { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer }
  156. }
  157.  
  158. ON *:TEXT:!testtype:#: {
  159.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  160.   msg # OUTPUT: $msgtags(subscriber).key
  161. }
  162.  
  163. ;:::::::::::::::::::
  164. ; General Commands :
  165. ;:::::::::::::::::::
  166.  
  167. ON *:TEXT:!reportbugs:#: {
  168.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  169.   if ($me == Smash4UBot) {
  170.     if (%flood_bugs_ [ $+ [ $chan ] ]) || (%flood_bugs_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
  171.     set -eu15 %flood_bugs_ $+ $chan On
  172.     set -eu30 %flood_bugs_ $+ $chan $+ _ $+ $nick On
  173.     msg $chan If you have any complaints, suggestions, or you would like to report any bugs, PM/whisper TaahaK. Thank you for using Smash4UBot.
  174.   }
  175. }
  176.  
  177. on *:TEXT:!howto:#: {
  178.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  179.   if (%howto_ [ $+ [ $chan ] ]) || (%howto_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
  180.   set -eu15 %howto_ $+ $chan On
  181.   set -eu30 %howto_ $+ $chan $+ _ $+ $nick On
  182.   msg $chan /me : Join the list by typing !join. Thank you!
  183. }
  184.  
  185. on *:TEXT:!commands:#: {
  186.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  187.   if ($me == Smash4UBot) {
  188.     if (%commands_ [ $+ [ $chan ] ]) || (%commands_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
  189.     set -eu15 %commands_ $+ $chan On
  190.     set -eu30 %commands_ $+ $chan $+ _ $+ $nick On
  191.     msg $chan For more information about Smash4UBot, a detailed list of commands, or instructions on how to add the bot, check out this link: http://pastebin.com/Hzqy5gKA
  192.   }
  193. }
  194.  
  195. on *:TEXT:!info:#: {
  196.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  197.   if ($me == Smash4UBot) {
  198.     if (%info_ [ $+ [ $chan ] ]) || (%info_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
  199.     set -eu15 %info_ $+ $chan On
  200.     set -eu30 %info_ $+ $chan $+ _ $+ $nick On
  201.     msg $chan For more information about Smash4UBot, a detailed list of commands, or instructions on how to add the bot, check out this link: http://pastebin.com/Hzqy5gKA
  202.   }
  203. }
  204.  
  205. ;::::::::::::::::::::::
  206. ; Smash List Commands :
  207. ;::::::::::::::::::::::
  208.  
  209. ON *:TEXT:!spot:#: {
  210.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  211.   if (%spot_ [ $+ [ $chan ] ]) || (%spot_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
  212.   set -eu3 %spot_ $+ $chan On
  213.   set -eu60 %spot_ $+ $chan $+ _ $+ $nick On
  214.  
  215.   var %f = tlist $+ $chan $+ .txt
  216.   var %r = $read(%f,nw,$nick)
  217.   var %rn = $readn
  218.   if (!$isfile(%f)) || (!$lines(%f)) { msg #jtv /w $nick There are no users in the queue. | return }
  219.   if (!%r) || (!%rn) { msg #jtv /w $nick $nick - you are not on the list. | return }
  220.   msg #jtv /w $nick User: @ $+ $nick $chr(124) Place in Line: %rn
  221. }
  222.  
  223. ON *:TEXT:!list:#: {
  224.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  225.   if ($mod) {
  226.     if (%floodlistmod_ [ $+ [ $chan ] ]) || (%floodlistmod_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
  227.     set -eu5 %floodlistmod_ $+ $chan On
  228.     set -eu10 %floodlistmod_ $+ $chan $+ _ $+ $nick On
  229.   }
  230.   else {
  231.     if (%floodlist_ [ $+ [ $chan ] ]) || (%floodlist_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
  232.     set -eu15 %floodlist_ $+ $chan On
  233.     set -eu30 %floodlist_ $+ $chan $+ _ $+ $nick On
  234.   }
  235.  
  236.   var %f = tlist $+ $chan $+ .txt
  237.   if (!$isfile(%f)) || (!$lines(%f)) { msg $chan The list is empty. | return }
  238.  
  239.   var %t = $lines(%f)
  240.   var %i = 1
  241.   while (%i <= %t) {
  242.     var %n = $read(%f,n,%i)
  243.     if (%i == 1) { var %first = %n | goto next }
  244.     if (%n) { var %tot = $addtok(%tot,%n,32) $+ $chr(44) }
  245.  
  246.     :next
  247.     inc %i
  248.   }
  249.   if (%tot) { msg $chan On stream: @ $+ %first $+ . Current List: $mid(%tot,0,-1) }
  250.   elseif (!%tot) && (%first) { msg $chan On stream: @ $+ %first $+ . Current List: There are no other users in the queue. }
  251. }
  252.  
  253. ON *:TEXT:!join:#: {
  254.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  255.   var %f = tlist $+ $chan $+ .txt
  256.   var %t = $lines(%f)
  257.   var %r = $read(%f,nw,$nick)
  258.  
  259.   if (!%open_ [ $+ [ $chan ] ]) { msg $chan /me : Sorry - the list is currently closed. | return }
  260.   if (%submode_ [ $+ [ $chan ] ]) && (!$sub) { msg $chan /me : Sorry - the list is for subscribers only at the moment. | return }
  261.  
  262.   if (%t == %limit_ [ $+ [ $chan ] ]) { msg $chan /me : The list is now closed. | return }
  263.   if (%r) { msg $chan /me : $nick - you are already in the queue. | return }
  264.  
  265.   write $qt(%f) $nick
  266.   msg $chan /me added $nick to the queue.
  267. }
  268.  
  269. ON *:TEXT:!join *:#: {
  270.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  271.   if (%nnid_ [ $+ [ $chan ] ]) {
  272.     if ($2 == $me) || ($2 == $nick) { return }
  273.     var %f = tlist $+ $chan $+ .txt
  274.     var %t = $lines(%f)
  275.     var %r = $read(%f,nw,$nick)
  276.  
  277.     if (!%open_ [ $+ [ $chan ] ]) { msg $chan /me : Sorry - the list is currently closed. | return }
  278.     if (%submode_ [ $+ [ $chan ] ]) && (!$sub) { msg $chan /me : Sorry - the list is for subscribers only at the moment. | return }
  279.  
  280.     if (%t == %limit_ [ $+ [ $chan ] ]) { msg $chan /me : The list is now closed. | return }
  281.     if (%r) { msg $chan /me : $nick - you are already in the queue. | return }
  282.  
  283.     write $qt(%f) $nick
  284.     msg $chan /me added $nick to the queue.
  285.   }
  286.   else { msg $chan Joining with NNID is turned off. Simply type !join at the moment. }
  287. }
  288.  
  289. ON *:TEXT:!setlimit *:#: {
  290.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  291.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  292.   if ($2 !isnum) { msg $chan /me : $nick - sorry, only numbers allowed. | return }
  293.   set %limit_ [ $+ [ $chan ] ] $2
  294.   msg $chan /me : $nick changed the list limit to $2 $+ .
  295. }
  296.  
  297. ON *:TEXT:!setnnidon:#: {
  298.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  299.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  300.   if (%nnid_ [ $+ [ $chan ] ]) { msg $chan /me : @ $+ $nick - Using NNID to join the list is already turned on. | return }
  301.   set %nnid_ $+ $chan 1
  302.   msg $chan /me : You now need to enter your NNID to join the list. Type !join [yourNNID] to enter!
  303. }
  304.  
  305. ON *:TEXT:!setnnidoff:#: {
  306.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  307.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  308.   if (!%nnid_ [ $+ [ $chan ] ]) { msg $chan /me : @ $+ $nick - Using NNID to join the list is already turned off. | return }
  309.   unset %nnid_ $+ $chan
  310.   msg $chan /me : Using NNID to join the list is now turned off.
  311. }
  312.  
  313. ON *:TEXT:!next:#: {
  314.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  315.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  316.  
  317.   var %f = tlist $+ $chan $+ .txt
  318.   var %n = nnid $+ $chan $+ .txt
  319.   if (!$isfile(%f)) || (!$lines(%f)) { msg $chan The queue is empty. | return }
  320.  
  321.   var %1 = $read(%f,n,1)
  322.   var %2 = $read(%f,n,2)
  323.   var %3 = $read(%f,n,3)
  324.   var %n2 = $read(%f,n,2)
  325.  
  326.   if (!%2) {
  327.     if (%1) { write -dl1 $qt(%f) }
  328.     msg $chan The queue is empty.
  329.     return
  330.   }
  331.  
  332.   msg $chan /me : @ $+ %2 - you are now up! $iif(%nnid_ [ $+ [ $chan ] ] && %n2,NNID is %n2 $+ .) $iif(%3,- @ $+ %3 you are up afterwards. Please let $regsubex(#,^#*,) know that you are ready. )
  333.  
  334.   write -dl1 $qt(%f)
  335.   write -dl1 $qt(%n)
  336. }
  337.  
  338. ON *:TEXT:!skip:#: {
  339.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  340.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  341.  
  342.   var %f = tlist $+ $chan $+ .txt
  343.   var %n = nnid $+ $chan $+ .txt
  344.   var %t = $lines(%f)
  345.   if (!$isfile(%f)) || (!%t) { msg $chan The queue is empty. | return }
  346.  
  347.   var %l = $calc(%t + 1)
  348.   var %1 = $read(%f,n,1)
  349.   var %2 = $read(%f,n,2)
  350.   var %3 = $read(%f,n,3)
  351.  
  352.   msg $chan /me : @ $+ %2 - you are now up! $iif(%nnid_ [ $+ [ $chan ] ] && %n2,NNID is %n2 $+ .) $iif(%3,- @ $+ %3 you are up afterwards. Let $regsubex(#,^#*,) know that you are ready. )
  353.  
  354.   write -dl1 $qt(%f)
  355.   write -dl1 $qt(%n)
  356.   write -m1l $+ %l $qt(%f) %1
  357. }
  358.  
  359. ON *:TEXT:!dropspot:#: {
  360.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  361.   var %f = tlist $+ $chan $+ .txt
  362.   var %t = $lines(%f)
  363.   var %r = $read(%f,nw,$nick)
  364.   var %rn = $readn
  365.  
  366.   if (!$isfile(%f)) || (!%t) { msg $chan The queue is empty. | return }
  367.   if (!%r) || (!%rn) { msg $chan $nick you are not in the queue. | return }
  368.   write -dl $+ %rn $qt(%f)
  369.   msg $chan /me removed $nick from the queue.
  370. }
  371.  
  372. ON *:TEXT:!clear:#: {
  373.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  374.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  375.   var %f = tlist $+ $chan $+ .txt
  376.   var %t = $lines(%f)
  377.   if (!$isfile(%f)) || (!%t) { msg $chan The list is already empty. | return }
  378.   write -c $qt(%f)
  379.   msg $chan /me : The list has been reset.
  380. }
  381.  
  382. ON *:TEXT:!open:#: {
  383.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  384.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  385.   if (%open_ [ $+ [ $chan ] ]) { msg $chan /me : @ $+ $nick - the player list is already open. | return }
  386.   set %open_ $+ $chan 1
  387.   msg $chan /me : The player list is now open. Type !join to enter the queue.
  388. }
  389.  
  390. ON *:TEXT:!close:#: {
  391.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  392.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  393.   if (!%open_ [ $+ [ $chan ] ]) { msg $chan /me : @ $+ $nick - the player list is already closed. | return }
  394.   unset %open_ $+ $chan
  395.   msg $chan /me : The player list is now closed.
  396. }
  397.  
  398. ON *:TEXT:!status:#: {
  399.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  400.   if (%floodstatus_ [ $+ [ $chan ] ]) || (%floodstatus_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
  401.   set -eu10 %floodstatus_ $+ $chan On
  402.   set -eu15 %floodstatus_ $+ $chan $+ _ $+ $nick On
  403.  
  404.   if (%open_ [ $+ [ $chan ] ]) { msg $chan /me : List Status: [OPEN] }
  405.   else { msg $chan /me : List Status: [CLOSED] }
  406. }
  407.  
  408. ON *:TEXT:!add *:#: {
  409.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  410.   if ($2 == $me) || ($2 == $nick) { return }
  411.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  412.   if ($3) && ($3 !isnum) { msg $chan Error, Use only numbers! | return }
  413.   var %f = tlist $+ $chan $+ .txt
  414.   var %r = $read(%f,nw,$2)
  415.  
  416.   if (%r) { msg $chan $2 is already in the queue. | return }
  417.  
  418.   write $iif($3,-il $+ $3) $qt(%f) $2
  419.   msg $chan /me added $2 to the queue.
  420. }
  421.  
  422. ON *:TEXT:!remove *:#: {
  423.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  424.   if ($2 == $me) || ($2 == $nick) { return }
  425.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  426.   var %f = tlist $+ $chan $+ .txt
  427.   var %t = $lines(%f)
  428.   var %r = $read(%f,nw,$2)
  429.   var %rn = $readn
  430.  
  431.   if (!$isfile(%f)) || (!%t) { msg $chan $2 The queue is already empty. | return }
  432.   if (!%r) || (!%rn) { msg $chan $2 is not on the list. | return }
  433.  
  434.   write -dl $+ %rn $qt(%f)
  435.   msg $chan /me removed $2 from the queue.
  436. }
  437. ;::::::::::::::::::
  438. ; King of the Hill:
  439. ;::::::::::::::::::
  440.  
  441. ON *:TEXT:!kothoff:#: {
  442.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  443.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  444.   if (!%kothmode_ [ $+ [ $chan ] ]) { msg $chan /me : $nick - KotH mode is already off! | return }
  445.   unset %kothmode_ $+ $chan
  446.   msg $chan /me : KotH mode is now turned off.
  447. }
  448.  
  449. ON *:TEXT:!kothon:#: {
  450.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  451.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  452.   if (%kothmode_ [ $+ [ $chan ] ]) { msg $chan /me : $nick - KotH mode is already on! | return }
  453.   set %kothmode_ $+ $chan 1
  454.   msg $chan /me : KotH mode is now enabled! Fight for glory!
  455. }
  456.  
  457. ON *:TEXT:!kothsetup:#: {
  458.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  459.   msg $chan How to setup King of the Hill in 5 easy steps: 1) Decide on a King. This can either be you or a viewer. 2) Type !kothon to turn on King of the Hill mode. 3) Make sure that the King joins the KotH line first by typing !kothadd [King's username]. 4) You may open list for others to join by typing !open. 5) Players join the queue by typing !challenge. To see the KotH list, type !kothlist.
  460.  }
  461.  
  462. ON *:TEXT:!kothlist:#: {
  463.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  464.   if ($mod) {
  465.     if (%floodkothmod_ [ $+ [ $chan ] ]) || (%floodkothmod_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
  466.     set -eu5 %floodkothmod_ $+ $chan On
  467.     set -eu10 %floodkothmod_ $+ $chan $+ _ $+ $nick On
  468.   }
  469.   else {
  470.     if (%floodkoth_ [ $+ [ $chan ] ]) || (%floodkoth_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
  471.     set -eu15 %floodkoth_ $+ $chan On
  472.     set -eu30 %floodkoth_ $+ $chan $+ _ $+ $nick On
  473.   }
  474.  
  475.   var %f = kothlist $+ $chan $+ .txt
  476.   if (!$isfile(%f)) || (!$lines(%f)) { msg $chan The KotH line is empty. | return }
  477.  
  478.   var %t = $lines(%f)
  479.   var %i = 1
  480.   while (%i <= %t) {
  481.     var %n = $read(%f,n,%i)
  482.     if (%i == 1) { var %first = %n | goto next }
  483.     if (%n) { var %tot = $addtok(%tot,%n,32) $+ $chr(44) }
  484.  
  485.     :next
  486.     inc %i
  487.   }
  488.   if (%tot) { msg $chan Current King: @ $+ %first $+ . Challengers: $mid(%tot,0,-1) }
  489.   elseif (!%tot) && (%first) { msg $chan King: @ $+ %first $+ . Challengers: There are no challengers at the moment. }
  490. }
  491.  
  492. ON *:TEXT:!challenge:#: {
  493.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  494.   var %f = kothlist $+ $chan $+ .txt
  495.   var %t = $lines(%f)
  496.   var %r = $read(%f,nw,$nick)
  497.  
  498.   if (!%open_ [ $+ [ $chan ] ]) { msg $chan /me : Sorry - The KotH list is currently closed. | return }
  499.   if (%submode_ [ $+ [ $chan ] ]) && (!$sub) { msg $chan /me : Sorry - the list is for subscribers only at the moment. | return }
  500.   if (!%kothmode_ [ $+ [ $chan ] ]) { msg $chan /me : Sorry - KotH mode is currently off. | return }
  501.  
  502.   if (%t == %limit_ [ $+ [ $chan ] ]) { msg $chan /me : The KotH list is now closed. | return }
  503.   if (%r) { msg $chan /me : $nick is already in the KotH queue. | return }
  504.  
  505.   write $qt(%f) $nick
  506.   msg $chan /me added $nick to the KotH queue.
  507. }
  508.  
  509. ON *:TEXT:!lose:#: {
  510.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  511.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  512.  
  513.   var %f = kothlist $+ $chan $+ .txt
  514.   if (!$isfile(%f)) || (!$lines(%f)) { msg $chan The queue is empty. | return }
  515.  
  516.   var %1 = $read(%f,n,1)
  517.   var %2 = $read(%f,n,2)
  518.   var %3 = $read(%f,n,3)
  519.   var %4 = $read(%f,n,4)
  520.  
  521.   msg $chan /me : The King falls! @ $+ %2 - is the new King! $iif(%2,- @ $+ %3 is the next challenger. Please let $regsubex(#,^#*,) know that you are ready. )
  522.  
  523.   write -dl1 $qt(%f)
  524. }
  525.  
  526. ON *:TEXT:!win:#: {
  527.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  528.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  529.  
  530.   var %f = kothlist $+ $chan $+ .txt
  531.   var %t = $lines(%f)
  532.   if (!$isfile(%f)) || (!%t) { msg $chan The queue is empty. | return }
  533.  
  534.   var %1 = $read(%f,n,1)
  535.   var %2 = $read(%f,n,2)
  536.   var %3 = $read(%f,n,3)
  537.  
  538.   msg $chan /me : The King wins! @ $+ %1 is victorious and remains King! $iif(%3,- @ $+ %3 is the next challenger. Please let $regsubex(#,^#*,) know that you are ready. )
  539.  
  540.   if (%2) { write -dl2 $qt(%f) }
  541.   elseif (!%2) && (%1) { write -dl1 $qt(%f) }
  542. }
  543.  
  544. ON *:TEXT:!kothadd *:#: {
  545.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  546.   if (!$2) || ($2 == $me) { return }
  547.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  548.   var %f = kothlist $+ $chan $+ .txt
  549.   var %r = $read(%f,nw,$2)
  550.  
  551.   if (%r) { msg $chan $2 is already in the KotH line. | return }
  552.  
  553.   write $qt(%f) $2
  554.   msg $chan /me added $2 to the KotH queue.
  555. }
  556.  
  557. ON *:TEXT:!kothremove *:#: {
  558.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  559.   if (!$2) || ($2 == $me) { return }
  560.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  561.   var %f = kothlist $+ $chan $+ .txt
  562.   var %t = $lines(%f)
  563.   var %r = $read(%f,nw,$2)
  564.   var %rn = $readn
  565.  
  566.   if (!$isfile(%f)) || (!%t) { msg $chan $2 There are no challengers to remove. | return }
  567.   if (!%r) || (!%rn) { msg $chan $2 is not in the KotH queue. | return }
  568.  
  569.   write -dl $+ %rn $qt(%f)
  570.   msg $chan /me removed $2 from the KotH queue.
  571. }
  572.  
  573. ON *:TEXT:!kothdropspot:#: {
  574.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  575.   var %f = kothlist $+ $chan $+ .txt
  576.   var %t = $lines(%f)
  577.   var %r = $read(%f,nw,$nick)
  578.   var %rn = $readn
  579.  
  580.   if (!$isfile(%f)) || (!%t) { msg $chan The queue is empty. | return }
  581.   if (!%r) || (!%rn) { msg $chan $nick you are not in the queue. | return }
  582.   write -dl $+ %rn $qt(%f)
  583.   msg $chan /me removed $nick from the KotH queue.
  584. }
  585.  
  586. ON *:TEXT:!kothclear:#: {
  587.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  588.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  589.   var %f = kothlist $+ $chan $+ .txt
  590.   var %t = $lines(%f)
  591.   if (!$isfile(%f)) || (!%t) { msg $chan The queue is already empty. | return }
  592.   write -c $qt(%f)
  593.   msg $chan /me : The KotH queue has been reset.
  594. }
  595.  
  596. ;::::::::::::::::::::::::::::::::::
  597. ; Subscriber-Interaction Commands :
  598. ;::::::::::::::::::::::::::::::::::
  599.  
  600. ON *:TEXT:!submodeoff:#: {
  601.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  602.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  603.   if (!%submode_ [ $+ [ $chan ] ]) { msg $chan /me : $nick - sub mode is already off! | return }
  604.   unset %submode_ $+ $chan
  605.   msg $chan /me : The list is now available for all viewers!
  606. }
  607.  
  608. ON *:TEXT:!submodeon:#: {
  609.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  610.   if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
  611.   if (%submode_ [ $+ [ $chan ] ]) { msg $chan /me : $nick - sub mode is already on! | return }
  612.   set %submode_ $+ $chan 1
  613.   msg $chan /me : The list is now restricted to subscribers only.
  614. }
  615.  
  616. ;:::::::::::::::::::::::
  617. ; Script Load Commands :
  618. ;:::::::::::::::::::::::
  619.  
  620. /* Provides !load <script> and !unload <script>
  621. You are welcome to edit this script in any way if you wish to improve or change it.
  622. The nickname specified below can be edited to allow other users to use the command.
  623. Note: for scripts in the scripts folder use !load scripts/script.ini
  624. !load script.ini would load script.ini from your bot's main folder.
  625. */
  626. on *:TEXT:!*load*:#: {
  627.   if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
  628.   if ($nick == taahak) {
  629.     if ($1 == !load) {
  630.       if ($2- == $null) {
  631.         msg $chan Usage: !load scriptname.extension
  632.       }
  633.       else {
  634.         if ($read($2) == $null) {
  635.           msg $chan Script not found. Please try again.
  636.         }
  637.         else {
  638.           load -rs $2
  639.           msg $chan Script Loaded!
  640.         }
  641.       }
  642.     }
  643.     elseif ($1 == !unload) {
  644.       if ($2- == $null) {
  645.               msg $chan Usage: !unload scriptname.extension
  646.       }
  647.       else {
  648.         if ($read($2) == $null) {
  649.           msg $chan Script not found. Please try again.
  650.         }
  651.         else {
  652.           unload -rs $2
  653.           msg $chan Script Unloaded!
  654.         }
  655.       }
  656.     }
  657.   }
  658. }
Add Comment
Please, Sign In to add comment