Advertisement
jally511

Add/Rem/Give Points and Raffle system

Mar 4th, 2015
511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.80 KB | None | 0 0
  1. TO EDIT THE TIMER POINTS YOU LOOK FOR THE FOLLOWING: $+(.timerpoints.,#,.,$nick) 0 600 add.pts $+(#,.,$nick)
  2. AND EDIT THE "600" TO HOWEVER MANY SECONDS YOU WANT
  3. TO EDIT THE AMOUNT OF POINTS FOR THE TIMER, YOU LOOK FOR: writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 10)
  4. AND EDIT THE +1O TO HOWEVER MANY POINTS YOU WANT TO BE ADDED FOR THE AMOUNT OF TIME YOU'VE INPUTTED.
  5. CREDITS TO darkestginge and afterburn1000 THAT HAD ORIGINAL SCRIPTS OUT THERE.
  6. ALL I DID WAS EDIT PARTS OF THE SCRIPT SUCH AS ADDING THE OPTION TO LET VIEWERS FEED CARROTS FROM THEIR OWN ADDED UP POINTS (GIVING POINTS) AND OTHER MISC. MINOR THINGS TO MY LIKING.
  7. ** IF YOU'D LIKE TO SEE IT WORKS, YOU CAN CHECK IT OUT AT:
  8. WWW.TWITCH.TV/JALLY511
  9. ********************************************************************************************************************************
  10.  
  11. alias -l addPoints {
  12. if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt }
  13. var %topic $+($chan,.,$nick)
  14. var %points $calc($readini(Points.ini,%topic,Points) + $1)
  15. writeini -n Points.ini %topic Points %points
  16. return %points
  17. }
  18. alias -l feedPoints {
  19. if ($4 !isnum) { echo 2 -st $4 is not a number. It needs to be a number. | halt }
  20. var %topic $+($chan,.,$nick)
  21. var %points $calc($readini(Points.ini,%topic,Points) + $4)
  22. var %remove = %user - $4
  23. writeini -n Points.ini %user Points %points
  24. writeini -n Points.ini %topic Points %remove
  25. return %points
  26. }
  27. alias -l lookUpPoints {
  28. var %topic $+($chan,.,$nick)
  29. var %points $readini(Points.ini,%topic,Points)
  30. return %points
  31. }
  32. alias doaddpoints {
  33. if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
  34. var %topic $+($1,.,$2)
  35. var %points $calc($readini(Points.ini,%topic,Points) + $3)
  36. writeini -n Points.ini %topic Points %points
  37. echo -a Added points for %topic
  38. }
  39. alias dorempoints {
  40. var %topic $+($1,.,$2)
  41. remini -n Points.ini %topic Points
  42. echo -a Removed points for %topic
  43. }
  44.  
  45. on *:TEXT:!carrots:#:{ msg # $nick has $readini(Points.ini,$+(#,.,$nick),Points) total carrots. }
  46.  
  47. on $*:TEXT:/!carrots (add|remove)/Si:#:{
  48. if ($nick = Jally511) {
  49. if ($0 < 3) { msg # Insufficient parameters: Use !carrots <add|remove> <user> [number] | return }
  50. writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
  51. { msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total carrots. }
  52. }
  53. else { msg $chan /me Only Jally can give you more carrots! Slaps $nick }
  54. }
  55. on *:text:!carrots feed*:#: {
  56. if ($0 != 4) || ($4 !isnum) {
  57. msg $chan Insufficient or incorrect parameters: use !carrots feed [user] [number]
  58. Halt
  59. }
  60. if ($4 <= 0) {
  61. msg $chan $nick you cannot give someone less than 1 carrot.
  62. halt
  63. }
  64. if ($readini(Points.ini,$+(#,.,$3),Points) = $null) {
  65. msg $chan $nick That person isn't registered to Jally's Empire, please check your spelling or that you have the correct name and try again.
  66. Halt
  67. }
  68. else {
  69. if ($readini(Points.ini,$+(#,.,$nick),Points) >= $4) {
  70. writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) + $4)
  71. writeini -n Points.ini $+(#,.,$nick) Points $calc($readini(Points.ini,$+(#,.,$nick),Points) - $4)
  72. msg $chan $nick has given $4 of their carrots to $3, $3 now has $readini(Points.ini,$+(#,.,$3),Points) carrots and $nick now has $readini(Points.ini,$+(#,.,$nick),Points).
  73. halt
  74. }
  75. elseif ($readini(Points.ini,$+(#,.,$nick),Points) < $4) {
  76. msg $chan $nick you do not have that many carrots to give.
  77. halt
  78. }
  79. }
  80. }
  81.  
  82.  
  83.  
  84. ON !*:join:#:{
  85. $+(.timerpoints.,#,.,$nick) 0 600 add.pts $+(#,.,$nick)
  86. add.pts $+(#,.,$nick)
  87. if ((%floodjoin) || ($($+(%,floodjoin.,$nick),2))) { return }
  88. set -u10 %floodjoin On
  89. set -u30 %floodjoin. $+ $nick On
  90. msg $chan /ME WELCOME $nick !!! you have just joined Jally's Empire and will start earning carrots.
  91. }
  92. ON !*:part:#:$+(.timerpoints.,#,.,$nick) off
  93. alias -l add.pts {
  94. writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 10)
  95. }
  96.  
  97.  
  98. on *:TEXT:!getbunnies &:#:{
  99. if (%open == 1) {
  100. if ($2 > 10) {
  101. msg $chan $nick $+ , you can only have a max of 10 bunnies!
  102. }
  103. if ($2 < 11) {
  104. var %i = 0
  105. var %count = $2
  106. var %topic = $+(#,.,$nick)
  107. var %user = $readini(Points.ini,%topic,Points)
  108. var %final = 88 * %count
  109. var %remove = %user - %final
  110. if (%remove > 0) {
  111. writeini -n Points.ini %topic Points %remove
  112. while (%i < %count) {
  113. write Raffle.txt $nick
  114. %i = %i + 1
  115. }
  116. msg $chan $nick $+ , just got %count bunnies using %final carrots! Find out how many bunnies are in the raffle right now by typing !bunnies
  117. }
  118. if (%remove < 0) {
  119. msg $chan Sorry $nick but you don't have enough carrots to get %count bunnies!
  120. }
  121. }
  122. }
  123. }
  124. on *:TEXT:*:#:{
  125. if ($nick = Jally511) {
  126. if ($1 == !bunny) {
  127. if ($2 == hopin) {
  128. msg $chan /me Wiggle your noses and FLUFF your tails! The RAFFLE BUNNY JUST HOPPED IN, type !getbunnies <amount> to join in!
  129. set %open 1
  130. write -c Raffle.txt
  131. echo -a Raffle Started
  132. }
  133. if ($2 == hopout) {
  134. msg $chan /me [RAFFLE CLOSED]
  135. set %open 0
  136. write -c Raffle.txt
  137. echo -a Raffle Closed
  138. }
  139. }
  140. if ($1 == !wiggles) {
  141. if (%open == 1) {
  142. var %user = $read(Raffle.txt,n)
  143. write -c Raffle.txt
  144. set %open 0
  145. msg $chan /me And the winner is... %user $+ !!! Grats!
  146. echo -a Raffle Closed
  147. }
  148. }
  149. }
  150. if ($1 == !bunnies) {
  151. if (%open == 1) {
  152. msg $chan There are currently $lines(Raffle.txt) bunnies entered into the raffle!
  153. }
  154. }
  155. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement