Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Smash4UBot
- ;Version 1.7.0 - updates
- ;Last updated 3:53 PM CST on 9/24/17
- ;:::::::::::::::::::
- ; Connect Commands :
- ;:::::::::::::::::::
- /* The script below should not be removed or adjusted under any circumstances.
- This script has been automatically installed for you as your bot is connected to irc.twitch.tv.
- irc.twitch.tv has anti-flood measures in place. If your bot sends 20 messages/commands to irc.twitch.tv
- within 30 seconds, irc.twitch.tv will place an 8 hour chat block on your bot.
- This script prevents your bot from triggering irc.twitch.tv's anti-flood systems by stopping messages
- from being sent if sending them would result in a block.
- The script has been thoroughly tested, we do not recommend editing or removing it.
- Editing or removing the script below may result in your bot being blocked from irc.twitch.tv.
- */
- alias mod { return $iif($msgtags(user-type).key == mod || $mid(#, 2-) == $nick, $true) }
- alias sub { return $iif($msgtags(subscriber).key == 1,$true) }
- alias reg { return $iif($msgtags(user-type).key == reg || $mid(#, 2-) == $nick, $true) }
- on *:CONNECT: { join #smash4ubot }
- on *:LOGON:*:{
- raw CAP REQ :twitch.tv/membership
- raw CAP REQ :twitch.tv/tags
- raw CAP REQ :twitch.tv/commands
- /debug @raw
- }
- ON *:TEXT:!joinchannel:#smash4ubot: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- var %f = chans.txt
- var %c = $chr(35) $+ $nick
- var %r = $read(%f,nw,%c)
- if (!%r) { var %add = 1 | write %rn $qt(%f) %c }
- 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. }
- else { msg $chan I am already in %c $+ 's channel. }
- }
- ON *:TEXT:!leave:#smash4ubot: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- var %f = chans.txt
- var %c = $chr(35) $+ $nick
- var %r = $read(%f,nw,%c)
- var %rn = $readn
- if (%r) && (%rn) { var %del = 1 | write -dl $+ %rn $qt(%f) }
- 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. }
- else { msg $chan I am not in $nick $+ 's channel }
- }
- ON *:TEXT:!joinchannel *:#smash4ubot: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- var %f = chans.txt
- var %c = $chr(35) $+ $2
- var %r = $read(%f,nw,%c)
- if (!%r) { var %add = 1 | write $qt(%f) %c }
- if ($me !ison %c) { join -n %c | msg $chan I have joined $2 $+ 's channel! $iif(%add,- (added in the channel list)) }
- else { msg $chan I am already into %c channel! }
- }
- ON *:TEXT:!leavechannel *:#smash4ubot: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- var %f = chans.txt
- var %c = $chr(35) $+ $2
- var %r = $read(%f,nw,%c)
- var %rn = $readn
- if (%r) && (%rn) { var %del = 1 | write -dl $+ %rn $qt(%f) }
- if ($me ison %c) { part %c | msg $chan I have parted from $2 $+ 's channel! $iif(%del,- (removed from the channel list)) }
- else { msg $chan I am not in %c $+ 's channel! }
- }
- ON *:TEXT:!joinallchannels:#smash4ubot: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- if ($timer([PART_FINISH])) { msg $chan You cannot execute that command now because !leaveallchannels is in use. | return }
- var %f = chans.txt
- var %t = $lines(%f)
- if (!$isfile(%f)) || (!%t) { msg $chan There aren't any channels in the database. | return }
- var %total = $calc($calc(%t +3) * 5000)
- msg $chan Starting to join %t channels - please wait at least $duration($calc(%total / 1000)) $+ ...
- var %i = 1
- while (%i <= %t) {
- var %c = $read(%f,n,%i)
- if (%c) && ($me !ison %c) {
- var %tot = $addtok(%tot,%c,44)
- .timer[JOIN_ $+ %c $+ ] -ho 1 $calc(%i * 5000) join -n %c
- .timer[JOIN_MSG_ $+ %c $+ ] -ho 1 $calc(%i * 5100) msg $chan REBOOTING BOT - I have joined %c $+ 's channel.
- }
- inc %i
- }
- if (%tot) { .timer[JOIN_FINISH] -ho 1 %total msg $chan Finished! Kreygasm I have joined $numtok(%tot,44) channels. }
- else { msg $chan I have already joined all the channels in the database. }
- }
- ON *:TEXT:!leaveallchannels:#smash4ubot: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- if ($timer([JOIN_FINISH])) { msg $chan You cannot execute that command now because !joinallchannels is in use. | return }
- var %f = chans.txt
- var %t = $lines(%f)
- if (!$isfile(%f)) || (!%t) { msg $chan There aren't any channels in the database. | return }
- var %total = $calc($calc(%t +3) * 5000)
- msg $chan Starting to leave from %t channels, please wait at least $duration($calc(%total / 1000)) $+ ...
- var %i = 1
- while (%i <= %t) {
- var %c = $read(%f,n,%i)
- if (%c) && ($me ison %c) {
- var %tot = $addtok(%tot,%c,44)
- .timer[PART_ $+ %c $+ ] -ho 1 $calc(%i * 5000) part %c
- .timer[PART_MSG_ $+ %c $+ ] -ho 1 $calc(%i * 5100) msg $chan I parted from %c $+ 's channel.
- }
- inc %i
- }
- if (%tot) { .timer[PART_FINISH] -ho 1 %total msg $chan Finished - I have left $numtok(%tot,44) channels. }
- else { msg $chan I have already left all the channels in the database. }
- }
- ON *:TEXT:!chans:#smash4ubot: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- var %f = chans.txt
- var %t = $lines(%f)
- if (!%t) { msg $chan There aren't any channels in the database. }
- else { msg $chan There are %t currently channels in the database. }
- }
- ;::::::::::::::::
- ; Test Commands :
- ;::::::::::::::::
- on *:TEXT:!test:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if ($mod) { msg # Hi! I'm here! HeyGuys }
- else { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer }
- }
- on *:TEXT:!testsub:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if ($mod) {
- raw *:*: { echo -t @raw RAW: nick $nick string $msgtags }
- if (subscriber=1 isin $msgtags) { msg # Hey look, a subscriber! PogChamp }
- }
- else { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer }
- }
- ON *:TEXT:!testtype:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- msg # OUTPUT: $msgtags(subscriber).key
- }
- ;:::::::::::::::::::
- ; General Commands :
- ;:::::::::::::::::::
- ON *:TEXT:!reportbugs:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if ($me == Smash4UBot) {
- if (%flood_bugs_ [ $+ [ $chan ] ]) || (%flood_bugs_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
- set -eu15 %flood_bugs_ $+ $chan On
- set -eu30 %flood_bugs_ $+ $chan $+ _ $+ $nick On
- msg $chan If you have any complaints, suggestions, or you would like to report any bugs, PM/whisper TaahaK. Thank you for using Smash4UBot.
- }
- }
- on *:TEXT:!howto:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (%howto_ [ $+ [ $chan ] ]) || (%howto_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
- set -eu15 %howto_ $+ $chan On
- set -eu30 %howto_ $+ $chan $+ _ $+ $nick On
- msg $chan /me : Join the list by typing !join. Thank you!
- }
- on *:TEXT:!commands:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if ($me == Smash4UBot) {
- if (%commands_ [ $+ [ $chan ] ]) || (%commands_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
- set -eu15 %commands_ $+ $chan On
- set -eu30 %commands_ $+ $chan $+ _ $+ $nick On
- 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
- }
- }
- on *:TEXT:!info:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if ($me == Smash4UBot) {
- if (%info_ [ $+ [ $chan ] ]) || (%info_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
- set -eu15 %info_ $+ $chan On
- set -eu30 %info_ $+ $chan $+ _ $+ $nick On
- 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
- }
- }
- ;::::::::::::::::::::::
- ; Smash List Commands :
- ;::::::::::::::::::::::
- ON *:TEXT:!spot:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (%spot_ [ $+ [ $chan ] ]) || (%spot_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
- set -eu3 %spot_ $+ $chan On
- set -eu60 %spot_ $+ $chan $+ _ $+ $nick On
- var %f = tlist $+ $chan $+ .txt
- var %r = $read(%f,nw,$nick)
- var %rn = $readn
- if (!$isfile(%f)) || (!$lines(%f)) { msg #jtv /w $nick There are no users in the queue. | return }
- if (!%r) || (!%rn) { msg #jtv /w $nick $nick - you are not on the list. | return }
- msg #jtv /w $nick User: @ $+ $nick $chr(124) Place in Line: %rn
- }
- ON *:TEXT:!list:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if ($mod) {
- if (%floodlistmod_ [ $+ [ $chan ] ]) || (%floodlistmod_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
- set -eu5 %floodlistmod_ $+ $chan On
- set -eu10 %floodlistmod_ $+ $chan $+ _ $+ $nick On
- }
- else {
- if (%floodlist_ [ $+ [ $chan ] ]) || (%floodlist_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
- set -eu15 %floodlist_ $+ $chan On
- set -eu30 %floodlist_ $+ $chan $+ _ $+ $nick On
- }
- var %f = tlist $+ $chan $+ .txt
- if (!$isfile(%f)) || (!$lines(%f)) { msg $chan The list is empty. | return }
- var %t = $lines(%f)
- var %i = 1
- while (%i <= %t) {
- var %n = $read(%f,n,%i)
- if (%i == 1) { var %first = %n | goto next }
- if (%n) { var %tot = $addtok(%tot,%n,32) $+ $chr(44) }
- :next
- inc %i
- }
- if (%tot) { msg $chan On stream: @ $+ %first $+ . Current List: $mid(%tot,0,-1) }
- elseif (!%tot) && (%first) { msg $chan On stream: @ $+ %first $+ . Current List: There are no other users in the queue. }
- }
- ON *:TEXT:!join:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- var %f = tlist $+ $chan $+ .txt
- var %t = $lines(%f)
- var %r = $read(%f,nw,$nick)
- if (!%open_ [ $+ [ $chan ] ]) { msg $chan /me : Sorry - the list is currently closed. | return }
- if (%submode_ [ $+ [ $chan ] ]) && (!$sub) { msg $chan /me : Sorry - the list is for subscribers only at the moment. | return }
- if (%t == %limit_ [ $+ [ $chan ] ]) { msg $chan /me : The list is now closed. | return }
- if (%r) { msg $chan /me : $nick - you are already in the queue. | return }
- write $qt(%f) $nick
- msg $chan /me added $nick to the queue.
- }
- ON *:TEXT:!join *:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (%nnid_ [ $+ [ $chan ] ]) {
- if ($2 == $me) || ($2 == $nick) { return }
- var %f = tlist $+ $chan $+ .txt
- var %t = $lines(%f)
- var %r = $read(%f,nw,$nick)
- if (!%open_ [ $+ [ $chan ] ]) { msg $chan /me : Sorry - the list is currently closed. | return }
- if (%submode_ [ $+ [ $chan ] ]) && (!$sub) { msg $chan /me : Sorry - the list is for subscribers only at the moment. | return }
- if (%t == %limit_ [ $+ [ $chan ] ]) { msg $chan /me : The list is now closed. | return }
- if (%r) { msg $chan /me : $nick - you are already in the queue. | return }
- write $qt(%f) $nick
- msg $chan /me added $nick to the queue.
- }
- else { msg $chan Joining with NNID is turned off. Simply type !join at the moment. }
- }
- ON *:TEXT:!setlimit *:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- if ($2 !isnum) { msg $chan /me : $nick - sorry, only numbers allowed. | return }
- set %limit_ [ $+ [ $chan ] ] $2
- msg $chan /me : $nick changed the list limit to $2 $+ .
- }
- ON *:TEXT:!setnnidon:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- if (%nnid_ [ $+ [ $chan ] ]) { msg $chan /me : @ $+ $nick - Using NNID to join the list is already turned on. | return }
- set %nnid_ $+ $chan 1
- msg $chan /me : You now need to enter your NNID to join the list. Type !join [yourNNID] to enter!
- }
- ON *:TEXT:!setnnidoff:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- if (!%nnid_ [ $+ [ $chan ] ]) { msg $chan /me : @ $+ $nick - Using NNID to join the list is already turned off. | return }
- unset %nnid_ $+ $chan
- msg $chan /me : Using NNID to join the list is now turned off.
- }
- ON *:TEXT:!next:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- var %f = tlist $+ $chan $+ .txt
- var %n = nnid $+ $chan $+ .txt
- if (!$isfile(%f)) || (!$lines(%f)) { msg $chan The queue is empty. | return }
- var %1 = $read(%f,n,1)
- var %2 = $read(%f,n,2)
- var %3 = $read(%f,n,3)
- var %n2 = $read(%f,n,2)
- if (!%2) {
- if (%1) { write -dl1 $qt(%f) }
- msg $chan The queue is empty.
- return
- }
- 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. )
- write -dl1 $qt(%f)
- write -dl1 $qt(%n)
- }
- ON *:TEXT:!skip:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- var %f = tlist $+ $chan $+ .txt
- var %n = nnid $+ $chan $+ .txt
- var %t = $lines(%f)
- if (!$isfile(%f)) || (!%t) { msg $chan The queue is empty. | return }
- var %l = $calc(%t + 1)
- var %1 = $read(%f,n,1)
- var %2 = $read(%f,n,2)
- var %3 = $read(%f,n,3)
- 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. )
- write -dl1 $qt(%f)
- write -dl1 $qt(%n)
- write -m1l $+ %l $qt(%f) %1
- }
- ON *:TEXT:!dropspot:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- var %f = tlist $+ $chan $+ .txt
- var %t = $lines(%f)
- var %r = $read(%f,nw,$nick)
- var %rn = $readn
- if (!$isfile(%f)) || (!%t) { msg $chan The queue is empty. | return }
- if (!%r) || (!%rn) { msg $chan $nick you are not in the queue. | return }
- write -dl $+ %rn $qt(%f)
- msg $chan /me removed $nick from the queue.
- }
- ON *:TEXT:!clear:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- var %f = tlist $+ $chan $+ .txt
- var %t = $lines(%f)
- if (!$isfile(%f)) || (!%t) { msg $chan The list is already empty. | return }
- write -c $qt(%f)
- msg $chan /me : The list has been reset.
- }
- ON *:TEXT:!open:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- if (%open_ [ $+ [ $chan ] ]) { msg $chan /me : @ $+ $nick - the player list is already open. | return }
- set %open_ $+ $chan 1
- msg $chan /me : The player list is now open. Type !join to enter the queue.
- }
- ON *:TEXT:!close:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- if (!%open_ [ $+ [ $chan ] ]) { msg $chan /me : @ $+ $nick - the player list is already closed. | return }
- unset %open_ $+ $chan
- msg $chan /me : The player list is now closed.
- }
- ON *:TEXT:!status:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (%floodstatus_ [ $+ [ $chan ] ]) || (%floodstatus_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
- set -eu10 %floodstatus_ $+ $chan On
- set -eu15 %floodstatus_ $+ $chan $+ _ $+ $nick On
- if (%open_ [ $+ [ $chan ] ]) { msg $chan /me : List Status: [OPEN] }
- else { msg $chan /me : List Status: [CLOSED] }
- }
- ON *:TEXT:!add *:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if ($2 == $me) || ($2 == $nick) { return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- if ($3) && ($3 !isnum) { msg $chan Error, Use only numbers! | return }
- var %f = tlist $+ $chan $+ .txt
- var %r = $read(%f,nw,$2)
- if (%r) { msg $chan $2 is already in the queue. | return }
- write $iif($3,-il $+ $3) $qt(%f) $2
- msg $chan /me added $2 to the queue.
- }
- ON *:TEXT:!remove *:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if ($2 == $me) || ($2 == $nick) { return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- var %f = tlist $+ $chan $+ .txt
- var %t = $lines(%f)
- var %r = $read(%f,nw,$2)
- var %rn = $readn
- if (!$isfile(%f)) || (!%t) { msg $chan $2 The queue is already empty. | return }
- if (!%r) || (!%rn) { msg $chan $2 is not on the list. | return }
- write -dl $+ %rn $qt(%f)
- msg $chan /me removed $2 from the queue.
- }
- ;::::::::::::::::::
- ; King of the Hill:
- ;::::::::::::::::::
- ON *:TEXT:!kothoff:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- if (!%kothmode_ [ $+ [ $chan ] ]) { msg $chan /me : $nick - KotH mode is already off! | return }
- unset %kothmode_ $+ $chan
- msg $chan /me : KotH mode is now turned off.
- }
- ON *:TEXT:!kothon:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- if (%kothmode_ [ $+ [ $chan ] ]) { msg $chan /me : $nick - KotH mode is already on! | return }
- set %kothmode_ $+ $chan 1
- msg $chan /me : KotH mode is now enabled! Fight for glory!
- }
- ON *:TEXT:!kothsetup:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- 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.
- }
- ON *:TEXT:!kothlist:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if ($mod) {
- if (%floodkothmod_ [ $+ [ $chan ] ]) || (%floodkothmod_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
- set -eu5 %floodkothmod_ $+ $chan On
- set -eu10 %floodkothmod_ $+ $chan $+ _ $+ $nick On
- }
- else {
- if (%floodkoth_ [ $+ [ $chan ] ]) || (%floodkoth_ [ $+ [ $chan ] $+ ] _ [ $+ [ $nick ] ]) { return }
- set -eu15 %floodkoth_ $+ $chan On
- set -eu30 %floodkoth_ $+ $chan $+ _ $+ $nick On
- }
- var %f = kothlist $+ $chan $+ .txt
- if (!$isfile(%f)) || (!$lines(%f)) { msg $chan The KotH line is empty. | return }
- var %t = $lines(%f)
- var %i = 1
- while (%i <= %t) {
- var %n = $read(%f,n,%i)
- if (%i == 1) { var %first = %n | goto next }
- if (%n) { var %tot = $addtok(%tot,%n,32) $+ $chr(44) }
- :next
- inc %i
- }
- if (%tot) { msg $chan Current King: @ $+ %first $+ . Challengers: $mid(%tot,0,-1) }
- elseif (!%tot) && (%first) { msg $chan King: @ $+ %first $+ . Challengers: There are no challengers at the moment. }
- }
- ON *:TEXT:!challenge:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- var %f = kothlist $+ $chan $+ .txt
- var %t = $lines(%f)
- var %r = $read(%f,nw,$nick)
- if (!%open_ [ $+ [ $chan ] ]) { msg $chan /me : Sorry - The KotH list is currently closed. | return }
- if (%submode_ [ $+ [ $chan ] ]) && (!$sub) { msg $chan /me : Sorry - the list is for subscribers only at the moment. | return }
- if (!%kothmode_ [ $+ [ $chan ] ]) { msg $chan /me : Sorry - KotH mode is currently off. | return }
- if (%t == %limit_ [ $+ [ $chan ] ]) { msg $chan /me : The KotH list is now closed. | return }
- if (%r) { msg $chan /me : $nick is already in the KotH queue. | return }
- write $qt(%f) $nick
- msg $chan /me added $nick to the KotH queue.
- }
- ON *:TEXT:!lose:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- var %f = kothlist $+ $chan $+ .txt
- if (!$isfile(%f)) || (!$lines(%f)) { msg $chan The queue is empty. | return }
- var %1 = $read(%f,n,1)
- var %2 = $read(%f,n,2)
- var %3 = $read(%f,n,3)
- var %4 = $read(%f,n,4)
- 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. )
- write -dl1 $qt(%f)
- }
- ON *:TEXT:!win:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- var %f = kothlist $+ $chan $+ .txt
- var %t = $lines(%f)
- if (!$isfile(%f)) || (!%t) { msg $chan The queue is empty. | return }
- var %1 = $read(%f,n,1)
- var %2 = $read(%f,n,2)
- var %3 = $read(%f,n,3)
- 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. )
- if (%2) { write -dl2 $qt(%f) }
- elseif (!%2) && (%1) { write -dl1 $qt(%f) }
- }
- ON *:TEXT:!kothadd *:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$2) || ($2 == $me) { return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- var %f = kothlist $+ $chan $+ .txt
- var %r = $read(%f,nw,$2)
- if (%r) { msg $chan $2 is already in the KotH line. | return }
- write $qt(%f) $2
- msg $chan /me added $2 to the KotH queue.
- }
- ON *:TEXT:!kothremove *:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$2) || ($2 == $me) { return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- var %f = kothlist $+ $chan $+ .txt
- var %t = $lines(%f)
- var %r = $read(%f,nw,$2)
- var %rn = $readn
- if (!$isfile(%f)) || (!%t) { msg $chan $2 There are no challengers to remove. | return }
- if (!%r) || (!%rn) { msg $chan $2 is not in the KotH queue. | return }
- write -dl $+ %rn $qt(%f)
- msg $chan /me removed $2 from the KotH queue.
- }
- ON *:TEXT:!kothdropspot:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- var %f = kothlist $+ $chan $+ .txt
- var %t = $lines(%f)
- var %r = $read(%f,nw,$nick)
- var %rn = $readn
- if (!$isfile(%f)) || (!%t) { msg $chan The queue is empty. | return }
- if (!%r) || (!%rn) { msg $chan $nick you are not in the queue. | return }
- write -dl $+ %rn $qt(%f)
- msg $chan /me removed $nick from the KotH queue.
- }
- ON *:TEXT:!kothclear:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- var %f = kothlist $+ $chan $+ .txt
- var %t = $lines(%f)
- if (!$isfile(%f)) || (!%t) { msg $chan The queue is already empty. | return }
- write -c $qt(%f)
- msg $chan /me : The KotH queue has been reset.
- }
- ;::::::::::::::::::::::::::::::::::
- ; Subscriber-Interaction Commands :
- ;::::::::::::::::::::::::::::::::::
- ON *:TEXT:!submodeoff:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- if (!%submode_ [ $+ [ $chan ] ]) { msg $chan /me : $nick - sub mode is already off! | return }
- unset %submode_ $+ $chan
- msg $chan /me : The list is now available for all viewers!
- }
- ON *:TEXT:!submodeon:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if (!$mod) { msg #jtv /w $nick Sorry - this command is only available to moderators. FUNgineer | return }
- if (%submode_ [ $+ [ $chan ] ]) { msg $chan /me : $nick - sub mode is already on! | return }
- set %submode_ $+ $chan 1
- msg $chan /me : The list is now restricted to subscribers only.
- }
- ;:::::::::::::::::::::::
- ; Script Load Commands :
- ;:::::::::::::::::::::::
- /* Provides !load <script> and !unload <script>
- You are welcome to edit this script in any way if you wish to improve or change it.
- The nickname specified below can be edited to allow other users to use the command.
- Note: for scripts in the scripts folder use !load scripts/script.ini
- !load script.ini would load script.ini from your bot's main folder.
- */
- on *:TEXT:!*load*:#: {
- if ($me !isop $chan) { msg $chan ( $+ $nick $+ ): Please mod me to use commands. | return }
- if ($nick == taahak) {
- if ($1 == !load) {
- if ($2- == $null) {
- msg $chan Usage: !load scriptname.extension
- }
- else {
- if ($read($2) == $null) {
- msg $chan Script not found. Please try again.
- }
- else {
- load -rs $2
- msg $chan Script Loaded!
- }
- }
- }
- elseif ($1 == !unload) {
- if ($2- == $null) {
- msg $chan Usage: !unload scriptname.extension
- }
- else {
- if ($read($2) == $null) {
- msg $chan Script not found. Please try again.
- }
- else {
- unload -rs $2
- msg $chan Script Unloaded!
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment