|
Joined: Mar 2015
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: Mar 2015
Posts: 14 |
I have a bot set to award 1 point for every hour someone is in my Twitch channel. What I would like to add is for specific people to earn 1.5 tickets every hour, but the code isn't responding correctly. Here's what I added:
on !*:join:#:{ $+(.timerpoints.,#,.,$nick) 0 3600 add.pts $+(#,.,$nick) add.pts $+(#,.,$nick) if ($readini(P.ini,$nick) $calc($readini(Points.ini,%topic,Points) + $.5)
I'd like the bot to read if a name is on the ini file P.ini but it doesn't seem to read from there. Can anyone tell me what I'm doing wrong? I can add the entire point script if necessary.
|
|
|
|
Joined: Dec 2008
Posts: 1,515
Hoopy frood
|
Hoopy frood
Joined: Dec 2008
Posts: 1,515 |
Please provide us the hole point system code because the problem is not from this code that you have posted.
|
|
|
|
Joined: Mar 2015
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: Mar 2015
Posts: 14 |
alias -l addPoints { if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be 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. It needs to be 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 points for %topic }
alias dorempoints { var %topic $+($1,.,$2) remini -n Points.ini %topic Points echo -a Removed points for %topic }
on *:text:!tickets:#:{ if ((%floodpoints) || ($($+(%,floodpoints.,$nick),2))) { return } set -u10 %floodpoints On set -u30 %floodpoints. $+ $nick On msg # $nick has $readini(Points.ini,$+(#,.,$nick),Points) tickets. }
on $*:text:/!tickets (add|remove)/Si:#:{ if ($nick isop #) { if ($0 < 3) { msg # Insufficient parameters: Use !points <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) tickets. } } else { msg $chan This command is only available to moderators. } } on !*:join:#:{ $+(.timerpoints.,#,.,$nick) 0 3600 add.pts $+(#,.,$nick) add.pts $+(#,.,$nick) if ($readini(P.ini,$nick) $calc($readini(Points.ini,%topic,Points) + $.5) } on !*:part:#:$+(.timerpoints.,#,.,$nick) off alias -l add.pts { writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1) }
|
|
|
|
Joined: May 2015
Posts: 249
Fjord artisan
|
Fjord artisan
Joined: May 2015
Posts: 249 |
First of all - check your mIRC reads right (//echo -a $readini(p.ini,blabla).
Dont give a fish - teach to fish!
|
|
|
|
Joined: May 2015
Posts: 249
Fjord artisan
|
Fjord artisan
Joined: May 2015
Posts: 249 |
And actually after checking your on-text event... well, your idea looks wrong - you call alias to add point and then you try to add point again (your x1.5 bonus) - why not to make a standart bonus = 1, and a special bonus = 1.5 and include it in add.pts formula? (Didnt check if add.pts looks fine)
Last edited by splinny; 17/05/15 07:24 PM.
Dont give a fish - teach to fish!
|
|
|
|
Joined: Mar 2015
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: Mar 2015
Posts: 14 |
I'm BRAND NEW to scripting, but I think I'm understanding what you mean that it should look like this:
alias -l addPoints { if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt } var %topic $+($chan,.,$nick) var %points $calc($readini(Points.ini,%topic,Points) + $1) var %points %calc($readini(P.ini,%topic,Points) + $.5) writeini -n Points.ini %topic Points %points return %points }
|
|
|
|
Joined: May 2015
Posts: 249
Fjord artisan
|
Fjord artisan
Joined: May 2015
Posts: 249 |
$.5 looks wrong, and not having part of your .ini makes it harder to check if your huge variables work fine.
Dont give a fish - teach to fish!
|
|
|
|
Joined: Mar 2015
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: Mar 2015
Posts: 14 |
I'd like the multiplier to add half a point every hour, does irc not register values like that? And what else would you need to see? I copied my name from the "Points.ini" to the "P.ini", but it looks like this:
From Points.ini: [#vip3r22.vip3r22] Points=39
From P.ini: [#vip3r22.vip3r22]
|
|
|
|
Joined: May 2015
Posts: 249
Fjord artisan
|
Fjord artisan
Joined: May 2015
Posts: 249 |
First of all - check your mIRC reads right (//echo -a $readini(p.ini,blabla). Try //echo -ag $calc(1 + 0.5) And your $calc(1 + $.5) - $ means some identifier of function, not a number to calculate.
Dont give a fish - teach to fish!
|
|
|
|
Joined: Mar 2015
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: Mar 2015
Posts: 14 |
alias -l addPoints { if ($1 !isnum) { echo 2 -st $1 is not a number. It needs to be a number. | halt } var %topic $+($chan,.,$nick) var %points $calc($readini(Points.ini,%topic,Points) + $1) var %points $calc($readini(P.ini,%topic,Points)//echo -ag $calc(1 + 0.5) writeini -n Points.ini %topic Points %points return %points }
Isn't working either
First of all - check your mIRC reads right (//echo -a $readini(p.ini,blabla).
I never had that in my original script...where does it need to be added?
Last edited by vip3r22; 17/05/15 09:50 PM.
|
|
|
|
Joined: May 2015
Posts: 249
Fjord artisan
|
Fjord artisan
Joined: May 2015
Posts: 249 |
I meant type //echo -ag blabla - so you can check something before modify your scripts. With double "/". In your editbox, NOT in remotes!
Last edited by splinny; 18/05/15 12:21 AM.
Dont give a fish - teach to fish!
|
|
|
|
Joined: Mar 2015
Posts: 14
Pikka bird
|
OP
Pikka bird
Joined: Mar 2015
Posts: 14 |
Ahh sorry I've been making the changes in the scripts. Again I'm very new to using this and am trying to learn as I go along.
|
|
|
|
|