|
Joined: Jan 2015
Posts: 168
Vogon poet
|
OP
Vogon poet
Joined: Jan 2015
Posts: 168 |
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
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 779 |
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,211
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,211 |
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
Vogon poet
|
OP
Vogon poet
Joined: Jan 2015
Posts: 168 |
I deleted everything and pasted the code below and now it tells me "ADD.PTS unknown command"
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
Hoopy frood
|
Hoopy frood
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
Vogon poet
|
OP
Vogon poet
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.
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
Fjord artisan
|
Fjord artisan
Joined: Mar 2014
Posts: 215 |
If my memory serves, craftingmotion accidentally typed -l in the video, it's supposed to be -1
|
|
|
|
Joined: Jan 2015
Posts: 168
Vogon poet
|
OP
Vogon poet
Joined: Jan 2015
Posts: 168 |
This did not work, it added the ADD.PTS Unknown command again.
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
Fjord artisan
|
Fjord artisan
Joined: Jun 2014
Posts: 248 |
If my memory serves, craftingmotion accidentally typed -l in the video, it's supposed to be -1 What the..
|
|
|
|
Joined: Jan 2015
Posts: 168
Vogon poet
|
OP
Vogon poet
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
Vogon poet
|
OP
Vogon poet
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
Vogon poet
|
OP
Vogon poet
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.
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
Hoopy frood
|
Hoopy frood
Joined: Dec 2013
Posts: 779 |
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
Vogon poet
|
OP
Vogon poet
Joined: Jan 2015
Posts: 168 |
This works great! Thank you so much for your help!
|
|
|
|
|