mIRC Home    About    Download    Register    News    Help

Topic Options
#81362 - 01/05/04 12:29 AM hash table help
kaotikoo Offline
Pikka bird

Registered: 25/04/04
Posts: 17
hello

Im trying to add items to a hash table and unset it after some time the comand Im trying is:

hadd -mu [ $+ [ $calc($remove($7-,) * 60) ] ] scr.lst $6 OK
I already looked at the $calc to see if it gives me back a number, and it is working

when I try hadd -m scr.lst $6 OK
it does not work either

I just adds the data if I use hadd scr.lst $6 OK

am I really doing something wrong there?

RC

Top
#81363 - 01/05/04 01:00 AM Re: hash table help
Wolfie Offline
Fjord artisan

Registered: 07/08/03
Posts: 325
Code:
hadd $+(-mu,$calc($remove($7-,) * 60)) scr.lst $6 OK

Try that and see if that works for ya.
cool

Top
#81364 - 01/05/04 01:39 AM Re: hash table help
kaotikoo Offline
Pikka bird

Registered: 25/04/04
Posts: 17
Wolfie, it does not work either.
I just can't understand why this happens.

By the way, what im trying to do is sort of an ignore list to work with a trivia, It would have 2 ways at least to add the ppl into the list.

Automatically when someone gets 3 or more answers, depends what the var is.
Manually by the operators using notice.

After a few minutes the table unsets the mask.

If anyone have an idea to add the items to the hash table using -u please send me a msg.

Thanks,

RC


Edited by kaotikoo (01/05/04 01:54 AM)

Top
#81365 - 01/05/04 01:47 AM Re: hash table help
Iori Offline
Hoopy frood

Registered: 30/08/03
Posts: 1831
Post an example of the line that your passing to it, along with the rest/some more of the code

Top
#81366 - 01/05/04 02:03 AM Re: hash table help
kaotikoo Offline
Pikka bird

Registered: 25/04/04
Posts: 17
Iori,

here is the code:

raw WHISPER:*:{
;the $_mask.chk, cheks if the user is granted to add the entries into the list


if ($_mask.chk($strip($gettok($address,1,64))) == $true) {

;$5 is the first wors of the msg, $6 should be the mask, and $7 must be a number
if ($5 === !scrLIST) && ($remove($7-,) isnum) {

;here the code checks if the entry already exists, when it comes to add the entry, specially using -u the hadd just doesnt work.
if ($hget(scr.lst,$6) == $null) { hadd $+(-mu,$calc($remove($7-,) * 60)) scr.lst $6 OK }
}
}
}

Top
#81367 - 01/05/04 03:59 AM Re: hash table help
Iori Offline
Hoopy frood

Registered: 30/08/03
Posts: 1831
Well, I made an alias with the relevant section and used the inputs below, all worked fine.
Code:
alias scr.lst {
  ;$5 is the first wors of the msg, $6 should be the mask, and $7 must be a number
  if ($5 === !scrLIST) && ($remove($7-,) isnum) {
    if ($hget(scr.lst,$6) == $null) { hadd $+(-smu,$calc($remove($7-,) * 60)) scr.lst $6 OK }
  }
  echo -s $hget(scr.lst,0).item $hget(scr.lst,$6) -=- $hget(scr.lst,$6).unset
}

/scr.lst 1 2 3 4 !scrLIST abc 14
* Added item 'abc' to hash table 'scr.lst'
-
1 OK -=- 840
-

/scr.lst 1 2 3 4 !scrLIST bac 4
* Added item 'bac' to hash table 'scr.lst'
-
2 OK -=- 240
-

/scr.lst 1 2 3 4 !scrLIST cba 1
* Added item 'cba' to hash table 'scr.lst'
-
3 OK -=- 60


Top
#81368 - 01/05/04 04:29 PM Re: hash table help
kaotikoo Offline
Pikka bird

Registered: 25/04/04
Posts: 17
Thanks Iori
It is working now

RC

Top