First at all sorry for my bad english.
Good day, I’m trying to make a rank system over this points system.
alias rank.pts {
var %v $+(#,.,$nick)
if ($readini(rangos.ini,%v,Rank) == 1) return 0
elseif ($readini(rangos.ini,%v,Rank) == 2) return 0.2
elseif ($readini(rangos.ini,%v,Rank) == 3) return 0.4
elseif ($readini(rangos.ini,%v,Rank) == 4) return 0.6
elseif ($readini(rangos.ini,%v,Rank) == 5) return 0.8
return 0
}
alias -l add.pts {
writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + $calc(1 + $rank.pts))
if ($readini(rangos.ini,$1,Rank) = $null) { writeini -n rangos.ini $1 Rank 1 }
}
; %offline is a global variable from a socket script telling when the channel is online = 120 or offline = 360
on !*:join:#:{
$+(.timerpoints.,#,.,$nick) 0 %offline add.pts $+(#,.,$nick)
add.pts $+(#,.,$nick)
if ((%floodjoin) || ($($+(%,floodjoin.,$nick),2))) { return }
set -u10 %floodjoin On
set -u30 %floodjoin. $+ $nick On
/cprivmsg $nick # welcome, blah blah blah...
}
on !*:QUIT: { $+(.timerpoints.,#azubu.nanito.en,.,$nick) off }
When viewers connect to the channel the script check the points and check if the viewer has a rank data in the rank.ini file. After this, the scripts give the first point + the rank point and this rank point is an alias because is a dynamic value (sorry if I’m wrong in this). All this is controller with a timer that every X time (%offline is a global variable that check if the channel is online = 120 or offline = 360) re run the alias add.pts to give a new point.
Example: The viewer connects to the channel and he has rank lvl 5 (this mean it will have + 0.8 points in the point count). The bot give him 1.8 points every join BUT this is not happening.
The problem in the scripts is:
1. - the «rankpoint» is only given the first time the viewer connects to the channel then, when the timer triggers the add.pts alias... the timer give only 1 point and not 1.8 points.
2. - Maybe this is because the timer only runs the add.pts alias and not the rank.pts alias. (I don't know if this is true)
3. - I tried to deal with this with my «very limited scripter begginer mind» adding another timer for the rank.pts next to the timer of the add.pts but this wasn't the solution.
These are my 4 questions:
1. - How can I solve this problem? (make it work, the rank system)
2. - is it possible run 2 commands at the same time for a single timer?
3. - The global variable «%offline» return 120 as value when the stream is online and 360 when it's offline. If this global variable changes to 360 (turning off the stream) the timers maintain their value of 120 because it's the value that the viewer gets in his "Join", of course at least the viewer rejoin the channel and gets the new value = 360. Is it possible to refresh in «real time» the timers?
4. - The scripts start with the event JOIN and the viewers in the channel, who joined before the bot, don't get points, at least they do a rejoin. [I can learn to get a userlist using «names $$1» then use «raw commands» like I read here in another post (I don't learn this yet) but I don't know how to use a userlist in a Join event for this point system]. So which is the best way to use a users list (users connected to the channel before the bot joins) from the channel in this system point?.
Thanks for your patience and time,
Nanito