Need help to finish point system [twitch bot] - 03/07/14 07:25 PM
Hello, i need little help with my twitch mirc bot. I was already watching and reading lot of topics but i cant find solution.
My point system is working and writing data to Points.ini . Only think what i am looking for is to add command !pointlist and want to get back something like:
bot: Hello, there is list of points (nick 5 points, nick2 4 points, nick3 3 points)
It can be top 10 ordered by highest point, whole list can be long.
There is script of classic point system: http://pastebin.com/mzSsvrDm
or there whole code.
There is example how its Points.ini looking.
Thank you for any tip or help.
My point system is working and writing data to Points.ini . Only think what i am looking for is to add command !pointlist and want to get back something like:
bot: Hello, there is list of points (nick 5 points, nick2 4 points, nick3 3 points)
It can be top 10 ordered by highest point, whole list can be long.
There is script of classic point system: http://pastebin.com/mzSsvrDm
or there whole code.
Code:
alias -1 addPoints { if ($1 !isnum) { echo 2 -st $1 is not 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 -1 lookUpPoints { var %topic $+($chan,.,$nick) var %points $readini(Points.ini,$topic,Points) return %points } alias doaddpoints { if ($3 !isnum { echo 2 =st $3 není číslo. Hodnota musí být číslo. | 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:!points:#: { msg # $nick má právě $readini(Points.ini,$+(#,.,$nick),Points) bodů. } on *:TEXT:!pointlist:#: { msg # I CANT EVEN MAKE THIS :( } on $*:text:/!points (add|remove)/Si:#:{ if ($nick isop #) { if ($0 < 3) { msg # Špatný paremetr: příkaz je !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 má právě $readini(Points.ini,$+(#,.,$3),Points) bodů. ) } else {msg $chan Tento příkaz je povolen pouze moderátorům. } } on !*:join:#:{ $+(.timerpoints.,#,.,$nick) 0 300 add.pts $+(#,.,$nick) add.pts $+(#,.,$nick) } on !*:part:#:$+(.timerpoints.,#,.,$nick) off alias -l add.pts { writeini -n Points.ini $1 Points $calc($readini(Points.ini,$1,Points) + 1) }
There is example how its Points.ini looking.
Code:
[#acercz.acercz] Points=149 [#acercz.luke_seventh] Points=129 [#acercz.acercze] Points=12 [#acercz.moobot] Points=20 [#acercz.punkys91] Points=388 [#acercz.lochnes] Points=173 [#acercz.toxo115] Points=91
Thank you for any tip or help.