mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2006
Posts: 14
P
Pikka bird
OP Offline
Pikka bird
P
Joined: Jul 2006
Posts: 14
hello to all.

i have a script like that :

Code:
on 1:JOIN:#:{
  /set %toto = aaa,bbb,ccc,ddd,eee,ffff,gggggg,hhhh,....
  /set %i $gettok(%toto,0,44)
  while (%i > 0) {
    if ( $gettok(%toto,%i,44) isin $nick ) {
      goto tata
    }
    %i = %i - 1
  }

 /msg $nick,text

:tata
}

 


in this way i can exlude some nikcks from my /msg

but i have a list of nick wich is very very big.

fo you hove an idea of how i can optimize this code and put a very large list of nicks without slowing mirc too much ?

(maybe i can put the list of nicks in a file, but i don't know hhow to do that and i am afraid that it will be very slow)

Thank you gor your help.

Last edited by parisien; 17/10/07 07:52 AM.
Joined: Jun 2006
Posts: 508
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Looks like spam...

Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Here you can use hash tables they are fast and easy to use

The syntax of this script is...

/nlist add NICKNAME
/nlist save
/nlist load

for /nlist add nickname its pretty explanatory it adds to your hash table

/nlist save will save your current hash table to file

/nlist load will load your previous file nicklist.hsh

Code:
alias nlist {
  if ($1 == load) {
    if ($exists(nicklist.hsh)) { 
      if ($hget(nicklist)) { hfree -s nicklist | hmake nicklist 1000 | hload -s nicklist nicklist.hsh }
      else { hmake nicklist 1000 | hload -s nicklist nicklist.hsh }
    }
    else { echo -a nicklist.hsh is not on file. }
  } 
  elseif ($1 == add) {
    if ($hget(nicklist)) { hadd -s nicklist $2 }
    else { echo -a Hash table is not loaded }
  }
  elseif ($1 == save) {
    if ($hget(nicklist)) { 
      if ($exists(nicklist.hsh)) { .remove nicklist.hsh | hsave -s nicklist nicklist.hsh }
      else { hsave -s nicklist nicklist.hsh }
    }
    else { echo -a Hash table is not loaded }
  }
}

on 1:JOIN:#:{
  if ($hget(nicklist)) && ($hfind(nicklist,$nick)) { .msg $nick text }
}


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Jul 2006
Posts: 14
P
Pikka bird
OP Offline
Pikka bird
P
Joined: Jul 2006
Posts: 14
your script seems very good.

i am studying it to find out exactly how it works.

i really thank you for your help


Link Copied to Clipboard