Advertisement
Guest User

heist/points system

a guest
Mar 28th, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. on *:text:!heist:#: {
  2. if ((%floodheist) || ($($+(%,floodheist.,$nick),2))) { return }
  3. set -u10 %floodheist On
  4. set -u30 %floodheist. $+ $nick On
  5. var %topic $+($chan,.,$nick)
  6. var %points $iif($readini(Points.ini,%topic,Points) == $null,0,$v1)
  7. var %rng $rand(1,10)
  8. if (%rng == 1) { .timer1 1 15 msg # $nick, the heist went well, you earned 100 points
  9. }
  10. if (%rng == 2) { .timer2 1 15 msg # $nick, the heist went bad, you lost 200 points
  11. }
  12. if (%rng == 3) { .timer3 1 15 msg # $nick, the heist went well, you earned 50 points
  13. }
  14. if (%rng == 4) { .timer4 1 15 msg # $nick, the heist went bad, you lost 100
  15. }
  16. if (%rng == 5) { .timer5 1 15 msg # $nick, the heist went well, you earned 300 points
  17. }
  18. if (%rng == 6) { .timer6 1 15 msg # $nick, the heist went bad, you lost 300 points
  19. }
  20. if (%rng == 7) { .timer7 1 15 msg # $nick, the heist went well, you earned 350 points
  21. }
  22. if (%rng == 8) { .timer8 1 15 msg # $nick, the heist went bad, you lost 50 points
  23. }
  24. if (%rng == 9) { .timer9 1 15 msg # $nick, the heist went well, you earned 400 points
  25. }
  26. if (%rng == 10) { .timer10 1 15 msg # $nick, the heist went bad, you lost 400 points
  27. }
  28.  
  29.  
  30. if (%points < 50) {
  31. msg $chan $nick you do not have enough points to start a heist.
  32. return
  33. }
  34. %points = $calc(%points - 50)
  35. msg $chan $nick has started a heist and it will last 15 seconds. $+ . Removed 50 points from $nick (Had $calc(%points + 50) points and now has %points points).
  36. writeini -n Points.ini %topic Points %points
  37. return %points
  38. }
  39.  
  40.  
  41. on *:text:!areyouhere:#:{
  42. msg # Im here, now what do you want.
  43. }
  44.  
  45. alias -l addPoints {
  46. if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt }
  47. var %topic $+($chan,.,$nick)
  48. var %points $calc($readini(Points.ini,%topic,Points) + $1)
  49. writeini -n Points.ini %topic Points %points
  50. return %points
  51. }
  52.  
  53. alias -l lookUpPoints {
  54. var %topic $+($chan,.,$nick)
  55. var %points $readini(Points.ini,%topic,Points)
  56. return %points
  57. }
  58. alias doaddpoints {
  59. if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
  60. var %topic $+($1,.,$2)
  61. var %points $calc($readini(Points.ini,%topic,Points) + $3)
  62. writeini -n Points.ini %topic Points %points
  63. echo -a Added points for %topic
  64. }
  65.  
  66. alias dorempoints {
  67. var %topic $+($1,.,$2)
  68. remini -n Points.ini %topic Points
  69. echo -a Removed points for %topic
  70. }
  71.  
  72. on *:text:!points:#:{
  73. if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
  74. set -u10 %floodpoints On
  75. set -u30 %floodpoints. $+ $nick On
  76. msg # $nick has $readini(Points.ini,$+(#,.,$nick),Points) total points.
  77. }
  78.  
  79. on $*:text:/!points (add|remove)/Si:#:{
  80. if ($nick isop #) {
  81. if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
  82. writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
  83. { msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total points. }
  84. }
  85. else { msg $chan This command is only available to moderators. }
  86. }
  87. on !*:join:#:{
  88. $+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick)
  89. add.pts $+(#,.,$nick)
  90. }
  91. on !*:part:#:$+(.timerpoints.,#,.,$nick) off
  92. alias -l add.pts {
  93. writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement