mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: May 2014
Posts: 2
T
Bowl of petunias
OP Offline
Bowl of petunias
T
Joined: May 2014
Posts: 2
I need some help with some coding. I have it where when someone types !rank. It will show them with this kind of message for an example. "<user> is rank 40 [Major]" I wanted to add something extra where it will show this for an example.. "<user> is rank 40 [Major] #34 in chat" / basically what im saying is i fundamentally want a leaderboard type of coding to show what position they are against other users. if its impossible thats fine. ps. the rank goes up! not down. rank 0 is the lowest. heres my code as well. this is the link -> http://pastebin.com/r3f7WdUp

Joined: May 2014
Posts: 2
T
Bowl of petunias
OP Offline
Bowl of petunias
T
Joined: May 2014
Posts: 2
I'll also pay via paypal if anyone knows how!

Joined: Dec 2013
Posts: 779
N
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
You'll find that your request was posted quite recently on the forums.
https://forums.mirc.com/ubbthreads.php/topics/245600/How_to_display_a_top_10#Post245600


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
This is the code to get the position of user. Add it into your code. (as you said, sort is ascending. the rank goes up)
Code:
alias -l showpos {
  window -h @.
  filter -kff points2.ini .cb $+(*,$1,*)
  filter -ctuww 2 32 @. @.
  filter -cnww @. @. $+(*,$2,*)
  var %pos $gettok($line(@.,1),1,32)
  window -c @.
  return %pos
}

alias -l cb {
  var %s $remove($1-,[,])
  aline @. $gettok(%s,-1,46) $readini(points2.ini,%s,points)
}

And edit this part.
Code:
on *:text:!rank:#:{
  var %pointCheck $readini(Points2.ini,$+(#,.,$nick),Points)

  var %position $+($chr(35),$showpos(#,$nick))

  if (%pointCheck > 1) && (%pointCheck <= 4) msg # $nick is rank %pointCheck $+ . [Recruit] %position in chat.
  else if (%pointCheck > 5) && (%pointCheck <= 6) msg # $nick is rank %pointCheck $+ . [Apprentice] %position in chat.

  ... and rest of the code...

}


Link Copied to Clipboard