Advertisement
TaahaK

Smash4UBot Version 1.7.0

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