Advertisement
Guest User

Points system

a guest
Nov 11th, 2014
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 2.59 KB | None | 0 0
  1. ;------------------------
  2. ;Points
  3. ;------------------------
  4.  
  5. alias -l addPoints {
  6.   if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt }
  7.   var %topic $+($chan,.,$nick)
  8.   var %points $calc($readini(Points.ini,%topic,Points) + $1)
  9.   writeini -n Points.ini %topic Points %points
  10.   return %points
  11. }
  12. alias -l lookUpPoints {
  13.   var %topic $+($chan,.,$nick)
  14.   var %points $readini(Points.ini,%topic,Points)
  15.   return %points
  16. }
  17. alias doaddpoints {
  18.   if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
  19.   var %topic $+($1,.,$2)
  20.   var %points $calc($readini(Points.ini,%topic,Points) + $3)
  21.   writeini -n Points.ini %topic Points %points
  22.   echo -a Added points for %topic
  23. }
  24. alias dorempoints {
  25.   var %topic $+($1,.,$2)
  26.   remini -n Points.ini %topic Points
  27.   echo -a Removed points for %topic
  28. }
  29. on *:text:!points:#:{
  30.   msg # $nick has $iif($readini(Points.ini,$+(#,.,$nick),Points),$v1,0) total points.
  31. }
  32. on $*:text:/!points (add|remove|del)/Si:#:{
  33.   if ($nick isop #) {
  34.     if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove|del> <user> [number] | return }
  35.     writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
  36.     msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total points.
  37.   }
  38.   else { msg $chan This command is only available to moderators. }
  39. }
  40.  
  41. ON !*:JOIN:#: {
  42.   $+(.timerpoints.,#,.,$nick) 0 120 add.pts $+(#,.,$nick)
  43.   add.pts $+(#,.,$nick)
  44.   if ((%floodjoin) || ($($+(%,floodjoin.,$nick),2))) { return }
  45.   set -eu10 %floodjoin On
  46.   set -eu30 %floodjoin. $+ $nick On
  47.   msg $chan $nick has joined and is now earning points.
  48. }
  49.  
  50. ON *:KICK:#: {
  51.   if ($knick !== $me) {
  52.     $+(.timerpoints.,#,.,$knick) off
  53.     if ((%floodkick) || ($($+(%,floodkick.,$knick),2))) { return }
  54.     set -eu10 %floodkick On
  55.     set -eu30 %floodkick. $+ $nick On
  56.     msg $chan $knick has left the channel and is no longer earning points.
  57.   }
  58. }
  59.  
  60. ON !*:QUIT: {
  61.   $+(.timerpoints.,#,.,$nick) off
  62.   if ((%floodquit) || ($($+(%,floodquit.,$nick),2))) { return }
  63.   set -eu10 %floodquit On
  64.   set -eu30 %floodquit. $+ $nick On
  65.   msg $chan $nick has left the channel and is no longer earning points.
  66. }
  67.  
  68. ON !*:PART:#: {
  69.   $+(.timerpoints.,#,.,$nick) off
  70.   if ((%floodpart) || ($($+(%,floodpart.,$nick),2))) { return }
  71.   set -eu10 %floodpart On
  72.   set -eu30 %floodpart. $+ $nick On
  73.   msg $chan $nick has left the channel and is no longer earning points.
  74. }
  75.  
  76. alias add.pts { if ($1) { writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement