Advertisement
kyroskoh

mIRC Points System

Dec 21st, 2014
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. alias -l addPoints {
  2. if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt }
  3. var %topic $+($chan,.,$nick)
  4. var %points $calc($readini(Points.ini,%topic,Points) + $1)
  5. writeini -n Points.ini %topic Points %points
  6. return %points
  7. }
  8.  
  9. alias -l lookUpPoints {
  10. var %topic $+($chan,.,$nick)
  11. var %points $readini(Points.ini,%topic,Points)
  12. return %points
  13. }
  14.  
  15. alias doaddpoints {
  16. if ($3 !isnum) { echo 2 -st $4 is not a number. It needs to be a number. | halt }
  17. var %topic $+($1,.,$2)
  18. var %points $calc($readini(Points.ini,%topic,Points) + $4)
  19. writeini -n Points.ini %topic Points %points
  20. echo -a Added points for %topic
  21. }
  22.  
  23. alias dorempoints {
  24. var %topic $+($1,.,$2)
  25. remini -n Points.ini %topic Points
  26. echo -a Removed points for %topic
  27. }
  28.  
  29. on *:join:#:{
  30. var %points $addPoints(1)
  31. timer $+ $nick 0 60 doaddpoints $chan $nick $1
  32. msg $chan $nick has joined the room and is earning points now.
  33. }
  34.  
  35. on *:part:#:{
  36. timer $+ $nick off
  37. msg $chan $nick has left the room and has stopped earning points.
  38. }
  39.  
  40. on *:text:!points:#:{
  41. var %points $lookUpPoints
  42. msg $chan $nick has total of %points points.
  43. if ($nick isop #) {
  44. if ($2 == add) { doaddpoints $chan $3 $4 | msg $chan Added $4 points to $3 | halt }
  45. if ($2 == remove) { dorempoints $chan $3 $4 | msg $chan Removed $4 points to $3 | halt }
  46. if ($2 == help) { msg $chan To add: !points add username amount. To remove: !points remove username amount. | halt }
  47. }
  48. }
  49.  
  50. on *:text:!points *:#:{
  51. if ($nick isop #) {
  52. if ($2 == add) { doaddpoints $chan $3 $4 | msg $chan Added $3 points to $4 | halt }
  53. if ($2 == remove) { dorempoints $chan $3 $4 | msg $chan Removed $3 points to $4 | halt }
  54. if ($2 == help) { msg $chan To add: !points add username amount. To remove: !points remove username amount. | halt }
  55. }
  56. }
  57.  
  58. on *:text:!cleardb:#:{
  59. if ($nick isop #) {
  60. remini Points.ini
  61. msg $nick You have cleared the database.
  62. echo -a Cleared Database (Deleted Points.ini file)
  63. }
  64. }
  65.  
  66. on *:text:!check:#:{
  67. if ($nick isop #) {
  68. var %check $+($chan,.,$2)
  69. var %checkpoints $readini(Points.ini,%check,Points)
  70. msg $chan $2 has total of %checkpoints points.
  71. }
  72. }
  73.  
  74. on *:text:!check *:#:{
  75. if ($nick isop #) {
  76. var %check $+($chan,.,$2)
  77. var %checkpoints $readini(Points.ini,%check,Points)
  78. msg $chan $2 has total of %checkpoints points.
  79. }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement