So, essentially, I have the points system that a bunch of people use for twitch, and i've run it silently behind a channel for months. Now, to make it visible, I am using !hours instead of points, which wasn't too hard, just adding a $calc, then dividing by 12. But, I want to add this !top10 command that I found, that does work, but i can't find a spot to run the $calc(____/12) that doesn't crash mirc. Thank you all.

My guess currently would be that %p is the points pulled from the file, so could I just add a $calc(%p/12)?

edit: I got it to work with a %p = $calc(%p / 12) before the aline.

So, can anyone help me come up with a more efficient method?

Currently, when run, an example output of the !top10 command is "Top 10 point are: user1 #, user2 #, ..."

on *:TEXT:!top10:#:{
if ($nick isop #) { top10 # }
else { msg # You are not allowed to use !top10. }
}

alias -l top10 {
window -h @. | var %i 1
while $gettok($remove($read(points.ini,w,$+(*,$1,*),%i),[,]),2,46) {
var %n $v1, %p $gettok($read(points.ini,$calc($readn + 1)),2,61)
aline @. %n %p
var %i $calc($readn + 1)
}
filter -cetuww 2 32 @. @.
var %i 1 | while %i <= 10 {
var %list $addtok(%list,$line(@.,%i),44)
inc %i
}
msg $1 Top 10 point are: $replace(%list,$chr(44),$+($chr(44),$chr(32)))
window -c @.
msg $chr(44)
}

Last edited by ekwag; 12/02/16 04:48 AM.