mIRC Homepage
Posted By: powerade661 Please help me.. Script isn't working - 31/01/15 11:56 PM
Code:

on !*:JOIN:#coolkid661:{
  $+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick)
  add.pts $+(#,.,$nick)  
  if coolkid661($mid(#,2-) !ison #coolkid661) return
}
on !*:PART:#coolkid661:$+(.timerpoints.,#,.,$nick) off
alias -l add.pts {
  writeini -n Points5.ini $1 Points $calc($readini(Points5.ini,$1,Points) + 1)}
  if coolkid661($mid(#,2-) !ison #coolkid661) return
}

alias -l addPoints { 
  if coolkid661($mid(#,2-) !ison #coolkid661) return
  if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt }
  var %topic $+($chan,.,$nick)
  var %Points5 $calc($readini(Points5.ini,%topic,Points) + $1)
  writeini -n Points5.ini %topic Points %Points5
  return %Points5
}
alias -l lookUpPoints {
  var %topic $+($chan,.,$nick)
  var %Points5 $readini(Points5.ini,%topic,Points)
  return %Points5
}
alias doaddpoints { 
  if coolkid661($mid(#,2-) !ison #coolkid661) return
  if ($3 !isnum) { echo 2 -st $3 is not a number. It needs to be a number. | halt }
  var %topic $+($1,.,$2)
  var %Points5 $calc($readini(Points5.ini,%topic,Points) + $3)
  writeini -n Points5.ini %topic Points %Points5
  echo -a Added points for %topic
}
alias dorempoints {
  var %topic $+($1,.,$2)
  remini -n Points5.ini %topic Points
  echo -a Removed points for %topic
}
on *:text:!Points5:#:{
  if ($readini(Points5.ini,$+(#,.,$nick),Points) > 0) {
    msg # $Nick you have $readini(Points5.ini,$+(#,.,$nick),Points) points!
  }
  else { msg # Sorry you do not have any points }
}
on $*:text:/!Points5 (add|remove)/Si:#:{
  if ($nick isop #) {
    if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
    writeini -n Points5.ini $+(#,.,$3) Points $calc($readini(Points5.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
    { msg $chan $3 now has $readini(Points5.ini,$+(#,.,$3),Points) total points. }
  }
  else { msg $chan This command is only available to moderators. }




I have tried everything I have even tried it without putting in a username... I am trying to count points up for multiple users for my bot and no matter what I do it counts the points regardless if they are in the stream or not.
Posted By: Nillen Re: Please help me.. Script isn't working - 01/02/15 12:18 AM
Code:
on !*:JOIN:#:{
  $+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick)
  add.pts $+(#,.,$nick)  
}

on !*:PART:#:$+(.timerpoints.,#,.,$nick) off

alias -l add.pts { 
if ($mid(#,2-) ison #) writeini -n Points5.ini $1 Points $calc($readini(Points5.ini,$1,Points) + 1)
}

on *:text:!Points5:#: msg # You have $iif($readini(Points5.ini,$+(#,.,$nick),Points),$v1,0) points.

on $*:text:/!Points5 (add|remove)/Si:#:{
  if ($nick isop #) {
    if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
    writeini -n Points5.ini $+(#,.,$3) Points $calc($readini(Points5.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
    msg $chan $3 now has $readini(Points5.ini,$+(#,.,$3),Points) total points. 
  }
  else msg $chan This command is only available to moderators.
}
Delete everything you have and use this. Your formatting was way off and parts of non-code was touching code, rendering it unable to work.

E: When you're skilled enough to make these kinds of scripts on your own, I recommend tossing this one away as it's not effective in long-term.
Posted By: Wims Re: Please help me.. Script isn't working - 01/02/15 12:24 AM
You're passing unknown content ($chan) to /timer in that on join event, it's going to be double evaluated, you need a $safe around this $chan value
I deleted everything and pasted the code below and now it tells me "ADD.PTS unknown command"

Code:
on !*:JOIN:#:{
  $+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick)
  add.pts $+(#,.,$nick)  
}

on !*:PART:#:$+(.timerpoints.,#,.,$nick) off

alias -l add.pts { 
  if ($mid(#,2-) ison #) writeini -n Points5.ini $1 Points $calc($readini(Points5.ini,$1,Points) + 1)
}

on *:text:!Points5:#: msg # You have $iif($readini(Points5.ini,$+(#,.,$nick),Points),$v1,0) points.

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

Posted By: Nillen Re: Please help me.. Script isn't working - 01/02/15 01:31 AM
Then there's likely a bracket mismatch somewhere.
Try using the bracket check.

If you can't find a bracket error, try deleting the -l from the alias -l add.pts

It's unlikely that you have it in different files, but could always give it a try
This is strange. When I took off the -l from alias -l it will count up one if the user joins but it won't continue the count while they are in the stream. On the plus side removing the -l removed the ADD.PTS unknown command.

Code:
on !*:JOIN:#:{
  $+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick)
  add.pts $+(#,.,$nick)  
}

on !*:PART:#:$+(.timerpoints.,#,.,$nick) off

alias add.pts { 
  if ($mid(#,2-) ison #) writeini -n Points5.ini $1 Points $calc($readini(Points5.ini,$1,Points) + 1)
}

on *:text:!Points5:#: msg # You have $iif($readini(Points5.ini,$+(#,.,$nick),Points),$v1,0) points.

on $*:text:/!Points5 (add|remove)/Si:#:{
  if ($nick isop #) {
    if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
    writeini -n Points5.ini $+(#,.,$3) Points $calc($readini(Points5.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
    msg $chan $3 now has $readini(Points5.ini,$+(#,.,$3),Points) total points. 
  }
  else msg $chan This command is only available to moderators.
}
Posted By: judge2020 Re: Please help me.. Script isn't working - 01/02/15 02:14 AM
If my memory serves, craftingmotion accidentally typed -l in the video, it's supposed to be -1
This did not work, it added the ADD.PTS Unknown command again.

Code:
on !*:JOIN:#:{
  $+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick)
  add.pts $+(#,.,$nick)  
}

on !*:PART:#:$+(.timerpoints.,#,.,$nick) off

alias -l add.pts { 
  if ($mid(#,2-) ison #) writeini -n Points5.ini $1 Points $calc($readini(Points5.ini,$1,Points) + 1)
}

on *:text:!Points5:#: msg # You have $iif($readini(Points5.ini,$+(#,.,$nick),Points),$v1,0) points.

on $*:text:/!Points5 (add|remove)/Si:#:{
  if ($nick isop #) {
    if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
    writeini -n Points5.ini $+(#,.,$3) Points $calc($readini(Points5.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
    msg $chan $3 now has $readini(Points5.ini,$+(#,.,$3),Points) total points. 
  }
  else msg $chan This command is only available to moderators.
}
Posted By: Belhifet Re: Please help me.. Script isn't working - 01/02/15 01:13 PM
Originally Posted By: judge2020
If my memory serves, craftingmotion accidentally typed -l in the video, it's supposed to be -1


What the..
I know right... lol It only adds 1 point for every time they join, but it doesn't keep counting up.
So does anyone have a solution to this? Am I the only that finds it strange that it adds the user but doesn't count up the points?
Ok so after poking around a little I added one exclamation mark and points started counting? But it still doesn't stop when the streamer leaves.

Code:
on !*:JOIN:#:{
  $+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick)
  add.pts $+(#,.,$nick)  
}

on !*:PART:#:$+(.timerpoints.,#,.,$nick) off

alias add.pts { 
  if ($mid(#,2-) !ison #) writeini -n Points5.ini $1 Points $calc($readini(Points5.ini,$1,Points) + 1)
}

on *:text:!Points:#: msg # You have $iif($readini(Points5.ini,$+(#,.,$nick),Points),$v1,0) points.

on $*:text:/!Points (add|remove)/Si:#:{
  if ($nick isop #) {
    if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
    writeini -n Points5.ini $+(#,.,$3) Points $calc($readini(Points5.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
    msg $chan $3 now has $readini(Points5.ini,$+(#,.,$3),Points) total points. 
  }
  else msg $chan This command is only available to moderators.
}
Posted By: Nillen Re: Please help me.. Script isn't working - 01/02/15 10:27 PM
Code:
on !*:JOIN:#:{
  $+(.timerpoints.,#,.,$nick) 0 300 add.pts # $+(#,.,$nick)
  add.pts # $+(#,.,$nick)  
}

on !*:PART:#:$+(.timerpoints.,#,.,$nick) off

alias add.pts { 
  if ($mid($1,2-) ison $1) writeini -n Points5.ini $2 Points $calc($readini(Points5.ini,$2,Points) + 1)
}

on *:text:!Points:#: msg # You have $iif($readini(Points5.ini,$+(#,.,$nick),Points),$v1,0) points.

on $*:text:/!Points (add|remove)/Si:#:{
  if ($nick isop #) {
    if ($0 < 3) { msg # Insufficient parameters: Use !points <add|remove> <user> [number] | return }
    writeini -n Points5.ini $+(#,.,$3) Points $calc($readini(Points5.ini,$+(#,.,$3),Points) $iif($2 == add,+,-) $iif($4 isnum,$4,1))
    msg $chan $3 now has $readini(Points5.ini,$+(#,.,$3),Points) total points. 
  }
  else msg $chan This command is only available to moderators.
}
This works great! Thank you so much for your help! smile
© mIRC Discussion Forums