mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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.

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
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.

Last edited by Nillen; 01/02/15 12:24 AM.

Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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.
}


Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
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


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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.
}

Joined: Mar 2014
Posts: 215
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Mar 2014
Posts: 215
If my memory serves, craftingmotion accidentally typed -l in the video, it's supposed to be -1


#imAbeginner
i made a chat bot for mark_paintball! http://twitch.tv/mark_paintball
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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.
}

Joined: Jun 2014
Posts: 248
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Jun 2014
Posts: 248
Originally Posted By: judge2020
If my memory serves, craftingmotion accidentally typed -l in the video, it's supposed to be -1


What the..

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
I know right... lol It only adds 1 point for every time they join, but it doesn't keep counting up.

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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?

Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
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.
}

Last edited by powerade661; 01/02/15 07:58 PM.
Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
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.
}


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Jan 2015
Posts: 168
P
Vogon poet
OP Offline
Vogon poet
P
Joined: Jan 2015
Posts: 168
This works great! Thank you so much for your help! smile


Link Copied to Clipboard