Advertisement
Guest User

points system

a guest
Jul 3rd, 2014
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. alias doaddpoints {
  2. if ($3 !isnum) { echo 2 -st $3 is not a number. it needs to be a number. | halt }
  3. var %topic $+(,.,$2)
  4. var %points $calc($readini(points.ini,%topic,points) + $3 )
  5. writeini -n points.ini %topic points %points
  6. echo -a added points for %topic
  7. }
  8. alias -l addpoints {
  9. if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt }
  10. var %topic $+($chan,.,$nick)
  11. var %points $calc($readini(points.ini,%topic,points) + $1)
  12. writeini -n points.ini %topic points %points
  13. return %points
  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. alias dorempoints {
  28. var %topic $+($1,.,$2)
  29. remini -n points.ini %topic points
  30. echo -a Removed points for %topic
  31. }
  32. on *:text:!points:#:{
  33. if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
  34. set -u10 %floodpoints On
  35. set -u30 %floodpoints. $+ $nick On
  36. msg # $nick has $readini(points.ini,$+(#,.,$nick),points) total points.
  37. }
  38. on $*:text:/!points (add|remove)/Si:#:{
  39. if ($nick == probablepanic ) {
  40. if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
  41. writeini -n points.ini $+(#,.,$3) points $calc($readini(points.ini,$+(#,.,$3),points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
  42. { msg $chan $3 now has $readini(points.ini,$+(#,.,$3),points) points. }
  43. }
  44. else { msg $chan YOU ARE NOT WORTHY. }
  45. }
  46.  
  47. on !*:join:#:{
  48. $+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick)
  49. add.pts $+(#,.,$nick)
  50. }
  51. on !*:part:#:$+(.timerpoints.,#,.,$nick) off
  52. alias -l add.pts {
  53. writeini -n points.ini $1 points $calc($readini(points.ini,$1,points) + 1)
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement