mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Sheesh. I changed that because I "remembered" that it was the total points instead of the total users. I need to stop coding when I'm tired.

Here is the entire !top5 event that should be used:

Code:
on *:text:!top5:#: {
  if (%Top5.fld) { return }
  set -u10 %Top5.fld On
  hsave -n TopScores hash.tmp
  filter -ffcuten 2 32 hash.tmp hash.tmp
  var %cnt = 1
  while (%cnt <= 5) {
    var %data = $read(hash.tmp,%cnt)
    msg $chan $hget(TopScores,$gettok(%data,1,32)).item is %cnt $+ / $+ $hget(TopScores,0).item with $gettok(%data,2,32) points
    inc %cnt
  }
  .remove hash.tmp
}


Invision Support
#Invision on irc.irchighway.net
Joined: Feb 2007
Posts: 91
S
spermis Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2007
Posts: 91
great. it works.. VERY big thx.

Joined: Feb 2007
Posts: 91
S
spermis Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2007
Posts: 91
oh yeah and the 11 line save line should be

hsave TopScores topscores.hsh - or it shows
* /hsave: insufficient parameters (line 11, top999.mrc

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
It shouldn't give an error, but if you're putting it all in your mIRC folder and not subfolders, then that's fine to do it that way.


Invision Support
#Invision on irc.irchighway.net
Joined: Feb 2007
Posts: 91
S
spermis Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Feb 2007
Posts: 91
yes because i couldn find the scriptsdir.. and it was giving error then if scriptsdir was there

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
$scriptdir (available only from within a script file and not from the command line) is the path to where your script is saved. It's an internal mIRC identifier and shouldn't ever give errors. $scriptdir\TopScores.hsh just says to go to the script's location and find/save the hash table there. The $qt part puts quotes around it so you don't have issues with spaces in the path. So there is no reason that I can see for why it won't work.

It's fine to remove that and just save it in mIRC's main folder. Just remember to change ALL $scriptdir parts dealing with that filename (including the /hsave and /hload commands) or you'll have problems later on.


Invision Support
#Invision on irc.irchighway.net
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
It would also give that error if $qt (which is a relatively new identifier) doesn't exist. To solve that, just add a local alias to the top of the script:

Code:
alias -l qt { return " $+ $1" }

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Good point. I forgot that $qt was new. I should have just stuck with the old method of $+(",$scriptdir\TopScores.hsh") instead.


Invision Support
#Invision on irc.irchighway.net
Page 2 of 2 1 2

Link Copied to Clipboard