Advertisement
Guest User

Malko's twitch script

a guest
Feb 7th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.65 KB | None | 0 0
  1. on *:TEXT:hello:#: { if ((%floodyhello) || ($($+(%,floodhello.,$nick),2))) { return }
  2. set -u10 %floodhello On
  3. set -u30 %floodhello. $+ $nick On
  4. msg $chan Hello $nick
  5. }
  6.  
  7. alias -l addPoints {
  8. if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt }
  9. var %topic $+($chan,.,$nick)
  10. var %points $calc($readini(Points.ini,%topic,Points) + $1)
  11. writeini -n Points.ini %topic Points %points
  12. return %points
  13. }
  14.  
  15. alias -l lookUpPoints {
  16. var %topic $+($chan,.,$nick)
  17. var %points $readini(Points.ini,%topic,Points)
  18. return %points
  19. }
  20. alias doaddpoints {
  21. if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
  22. var %topic $+($1,.,$2)
  23. var %points $calc($readini(Points.ini,%topic,Points) + $3)
  24. writeini -n Points.ini %topic Points %points
  25. echo -a Added points for %topic
  26. }
  27.  
  28. alias dorempoints {
  29. var %topic $+($1,.,$2)
  30. remini -n Points.ini %topic Points
  31. echo -a Removed points for %topic
  32. }
  33.  
  34. on *:text:!points:#:{
  35. if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
  36. set -u10 %floodpoints On
  37. set -u30 %floodpoints. $+ $nick On
  38. msg # $nick has $readini(Points.ini,$+(#,.,$nick),Points) total points.
  39. if (
  40. }
  41.  
  42. on $*:text:/!points (add|remove)/Si:#:{
  43. if ($nick isop #) {
  44. if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
  45. writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
  46. { msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total points. }
  47. }
  48. else { msg $chan This command is only available to moderators. }
  49. }
  50. on !*:join:#:{
  51. $+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick)
  52. add.pts $+(#,.,$nick)
  53. }
  54. on !*:part:#:$+(.timerpoints.,#,.,$nick) off
  55. alias -l add.pts {
  56. writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 5)
  57. }
  58.  
  59.  
  60.  
  61.  
  62. on *:text:!8ball*:#: { /set %8ball $rand(1,15) { if (%8ball == 1) { /msg $chan No! }
  63. elseif (%8ball == 2) { /msg $chan Yes! }
  64. elseif (%8ball == 3) { /msg $chan Maybe }
  65. elseif (%8ball == 4) { /msg $chan of Course! }
  66. elseif (%8ball == 5) { /msg $chan Are you crazy?!?! }
  67. elseif (%8ball == 6) { /msg $chan You may rely on it }
  68. elseif (%8ball == 7) { /msg $chan Without a doubt }
  69. elseif (%8ball == 8) { /msg $chan Signs point to yes }
  70. elseif (%8ball == 9) { /msg $chan Ask again later }
  71. elseif (%8ball == 10) { /msg $chan Computer says no }
  72. elseif (%8ball == 11) { /msg $chan Of course it is Kappa }
  73. elseif (%8ball == 12) { /msg $chan Concentrate and ask again }
  74. elseif (%8ball == 13) { /msg $chan Look behind you SSSsss }
  75. elseif (%8ball == 14) { /msg $chan If you wish }
  76. else { /msg $chan How should I know? } } }
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83. on *:text:!toppoints*:#: {
  84. if ($1 != !toppoints) return
  85.  
  86. if ($0 == 1) {
  87. var %nbLoop = 5
  88. }
  89. elseif ($0 == 2) {
  90. if ($2 isnum) {
  91. if ($2 > 0 && $2 <= 10) {
  92. var %nbLoop = $2
  93. }
  94. else {
  95. msg $chan Wrong parameters. Number must be between 1 and 10
  96. return
  97. }
  98. }
  99. else {
  100. msg $chan Wrong parameters. Use !toppoints [number]
  101. return
  102. }
  103. }
  104. else {
  105. msg $chan Wrong parameters. Use !toppoints [number]
  106. return
  107. }
  108.  
  109. var %i = 1
  110. var %j = 1
  111. var %channelLength = $calc($calc($len(#) + 1) * -1)
  112. var %done = 0
  113.  
  114. while (%i <= %nbLoop) {
  115. var %max [ $+ [ %i ] ] 0
  116. var %name [ $+ [ %i ] ] unknown
  117. inc %i
  118. }
  119.  
  120. while (%j <= $ini(Points.ini,0)) {
  121. var %section $ini(Points.ini,%j)
  122. var %points = $readini(Points.ini,%section,Points)
  123. var %fullname = $right(%section, %channelLength)
  124.  
  125. if ($count(%fullname, nightbot) == 0 && $count(%fullname, xanbot) == 0 && $count(%fullname, twitchranks) == 0 && $count(%fullname, moobot) == 0 && $count(%fullname, maklo8) == 0) {
  126. var %x = %nbLoop
  127.  
  128. while (%x >= 1) {
  129. if (%points > %max [ $+ [ %x ] ] && %done == 0) {
  130. var %y = 1
  131. var %z = 2
  132.  
  133. while (%y <= %x) {
  134. if (%y < %x) {
  135. var %temp = %max [ $+ [ %z ] ]
  136. var %temp2 = %name [ $+ [ %z ] ]
  137. SET %max [ $+ [ %y ] ] %temp
  138. SET %name [ $+ [ %y ] ] %temp2
  139. }
  140. else {
  141. SET %max [ $+ [ %y ] ] %points
  142. SET %name [ $+ [ %y ] ] %fullname
  143. }
  144.  
  145. inc %y
  146. inc %z
  147. }
  148. %done = 1
  149. }
  150. dec %x
  151. }
  152. }
  153. %done = 0
  154. inc %j
  155. }
  156.  
  157. var %string = Top %nbLoop points :
  158. var %i = 1
  159.  
  160. while (%nbLoop >= 1) {
  161. %string = %string $+ $+($chr(32),%i,$chr(46),$chr(32)) %name [ $+ [ %nbLoop ] ] $+($chr(32)) %max [ $+ [ %nbLoop ] ] pts
  162. dec %nbLoop
  163. inc %i
  164. }
  165.  
  166. msg $chan %string
  167. }
  168.  
  169.  
  170.  
  171.  
  172. on *:text:!rand:# :msg $chan your random number is $r(1,1000000)
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180. on me:*:join:#:set %justjoined $addtok(%justjoined,$chan,32)
  181. on me:*:part:#:set %justjoined $remtok(%justjoined,$chan,32) | .timerlottery. $+ $chan off
  182. on *:disconnect unset %justjoined | .timerlottery.* off
  183. on *:op:#:{
  184. if ($opnick == $me) {
  185. if ($istok(%justjoined,$chan,32)) {
  186. $+(.timerlottery.,$chan) 0 60 lottery $safe($chan)
  187. }
  188. set %justjoined $remtok(%justjoined,$chan,32)
  189. }
  190. }
  191. alias lottery {
  192. var %winner $nick($1,$r(1,$nick($1,0)))
  193. var %point $gettok(5 10 20 30 40 50 60 70 80 150,$r(1,10),32)
  194. var %inisection $+($1,.,%winner)
  195. writeini -n Points.ini %inisection Points $calc($readini(Points.ini,%inisection,Points) + %point)
  196. msg $1 %winner wins %point points!
  197. }
  198. alias safe return $!decode( $encode($1-, m) ,m)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement