mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2015
Posts: 9
B
Budd Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Jan 2015
Posts: 9
I can't, for the life of me, understand why this keeps happening. Randomly users will lose their "points" (or in this case "exp") for no reason. The point system created also has several ties to it. For example, less than 50 points will trigger a part of the script to delete any links posted.

This is my current point system script. Could someone tell me what is wrong with it that makes it randomly reset peoples points?

Code:
;EXPERIENCE SYSTEM
alias -1 addPoints {
  if ($1 !isnum) { echo 2 -st $1 is not a number. | halt }
  var %topic $+($chan,.,$nick)
  var %points $calc($readini(Points.ini,%topic,Points) + $1)
  writeini -n Points.ini %topic Points %points
  return %points
}

alias -l lookUpPoints {
  var %topic $+($chan,.,$nick)
  var %points $readini(Points.ini,%topic,Points)
  return %points
}

alias doaddpoints {
  if ($3 !isnum) { echo 2 -st $3 is not a number. | halt }
  var %topic $+($1,.,$2)
  var %points $calc($readini(Points.ini,%topic,Points) + $3)
  writeini -n Points.ini %topic Points %points
  echo -a Added experience for %topic
}

alias dorempoints {
  var %topic $+($1,.,$2)
  remini -n Points.ini %topic Points
  echo -a Removed experience for %topic
}

on *:text:!exp:#:{
  if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
  set -u5 %floodpoints On
  set -u20 %floodpoints. $+ $nick On 
  msg # /me  $nick has $readini(Points.ini,$+(#,.,$nick),Points) total experience. 
}

on $*:text:/!exp (add|remove)/Si:#:{ 
  if ($nick isop #) {
    if ($0 < 3) { msg # Insufficient parameters: Use !exp <add|remove> <user> [number] | return }
    writeini -n Points.ini $+(#,.,$3) Points $calc($readini(Points.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
    { msg $chan $3 now has $readini(Points.ini,$+(#,.,$3),Points) total experience. }
  }
  else { return }
}

on !*:join:#:{
  if ($nick == elmer2424) { msg # Welcoming our first follower ever, Elmer2424! }
  if ($nick == cold_ass_honkey) { msg # Welcoming the streams top dog donator, Cold_Ass_Honkey! }
  if ($nick == phantaga) { msg # Welcoming the prestigeous donator, Phantaga! }
  if ($nick == ognighthawk) { msg # Welcoming the high rolling donator, OGNightHawk! }
  $+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick)
  add.pts $+(#,.,$nick)
}

on !*:part:#:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
  writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1)
}

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Nothing of what you posted will (without manual trigger) remove values from the ini file.
Also, your first alias is wrong, Alias -l instead of -1


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Jan 2015
Posts: 9
B
Budd Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Jan 2015
Posts: 9
Ah thanks for pointing that out! Should I post the other parts of the code that tie into this system? Maybe they are responsible for the resets... The only other thing I could imagine outside of the code is that the Twitch channel has grown a good bit since the code was first initialized. There used to be an average of 10-20 people watching and now the channel receives upward of 60-80. Could it be that the memory needed or the timers are being overloaded?

Here are the other portions of the code that are used with the exp system.

Code:
;LINK BANNER
on *:TEXT:*http*:#: {
  if ($readini(Points.ini,$+(#,.,$nick),Points) isnum 50-99999) { return }
  else { msg $chan Links not allowed for viewers under !level 3 } { msg $chan /timeout $nick 30 }
}
on *:TEXT:*www.*:#: {
  if ($readini(Points.ini,$+(#,.,$nick),Points) isnum 50-99999) { return }
  else { msg $chan Links not allowed for viewers under !level 3 } { msg $chan /timeout $nick 30 }
}


Code:
on *:text:!level:#:{
  if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return }
  set -u5 %floodpoints On
  set -u15 %floodpoints. $+ $nick On 
  if ($readini(Points.ini,$+(#,.,$nick),Points) isnum 1-19) { msg # /me  The Plebeian $nick - Level 1 }
  if ($readini(Points.ini,$+(#,.,$nick),Points) isnum 20-49) { msg # /me  The Squire $nick - Level 2 }
  if ($readini(Points.ini,$+(#,.,$nick),Points) isnum 50-89) { msg # /me  The Whore $nick - Level 3 }
  if ($readini(Points.ini,$+(#,.,$nick),Points) isnum 90-139) { msg #  /me  The Bloodrider $nick - Level 4 }
  if ($readini(Points.ini,$+(#,.,$nick),Points) isnum 140-199) { msg # /me  The Maegi $nick - Level 5 }
  (---------------- this code continues like this for 20 more levels/lines--------------)
  else { return }
}


There is also a !levelcheck command that looks similar to the !level command but is used for the mods to check someones level on the fly.

The only other portion of the code that I have been having problems with (which, by coincidence, the person helping my test it yesterday had their points reset) has another thread up but that portion of the code has nothing to do with the point system.

Your thoughts are much appreciated. Thank you for helping me out =)


Link Copied to Clipboard