mIRC Home    About    Download    Register    News    Help

Print Thread
#81362 30/04/04 11:29 PM
Joined: Apr 2004
Posts: 17
K
Pikka bird
OP Offline
Pikka bird
K
Joined: Apr 2004
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

#81363 01/05/04 12:00 AM
Joined: Aug 2003
Posts: 325
W
Fjord artisan
Offline
Fjord artisan
W
Joined: Aug 2003
Posts: 325
Code:
hadd $+(-mu,$calc($remove($7-,) * 60)) scr.lst $6 OK

Try that and see if that works for ya.
cool

#81364 01/05/04 12:39 AM
Joined: Apr 2004
Posts: 17
K
Pikka bird
OP Offline
Pikka bird
K
Joined: Apr 2004
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

Last edited by kaotikoo; 01/05/04 12:54 AM.
#81365 01/05/04 12:47 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Post an example of the line that your passing to it, along with the rest/some more of the code

#81366 01/05/04 01:03 AM
Joined: Apr 2004
Posts: 17
K
Pikka bird
OP Offline
Pikka bird
K
Joined: Apr 2004
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 }
}
}
}

#81367 01/05/04 02:59 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
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


#81368 01/05/04 03:29 PM
Joined: Apr 2004
Posts: 17
K
Pikka bird
OP Offline
Pikka bird
K
Joined: Apr 2004
Posts: 17
Thanks Iori
It is working now

RC


Link Copied to Clipboard