mIRC Home    About    Download    Register    News    Help

Print Thread
#223762 01/08/10 12:48 PM
Joined: Feb 2003
Posts: 3,432
S
sparta Offline OP
Hoopy frood
OP Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
i using this code for one of my scripts
Code:
alias cexcctcp {
  if ($hfind(exclude.ctcp,*,0,w) > 0) {
    var %i = $hfind(exclude.ctcp,*,0,w)
    while (%i) {
      if ($hfind(exclude.ctcp,*,%i,w) iswmcs $nick) { return $true }
      dec %i
    }
  }
}

and then i using $cexcctcp to see if the nick are in the hashtable, it worked in mirc 6.35 now in mirc v.71 it wont work.

Thnx in advance.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Feb 2006
Posts: 546
J
Fjord artisan
Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
it's difficult to say without knowing the contents of the hash table, however you can eliminate the loop by using $hfind()'s W option:

Code:
alias cexcctcp return $iif($hfind(exclude.ctcp, $nick, 1, W), $true, $false)


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
Ignore this. Was code but jaytea's is better smile

Last edited by FroggieDaFrog; 01/08/10 03:07 PM.

I am SReject
My Stuff
Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
hfind already has the ability to loop...why use a while loop? smirk

Opps. You already edited it...

Last edited by Tomao; 01/08/10 03:09 PM.
Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
I had forgotten about the W switch


I am SReject
My Stuff

Link Copied to Clipboard