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
hadd $+(-mu,$calc($remove($7-,) * 60)) scr.lst $6 OK
Try that and see if that works for ya.
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
Post an example of the line that your passing to it, along with the rest/some more of the code
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 }
}
}
}
Well, I made an alias with the relevant section and used the inputs below, all worked fine.
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
Thanks Iori
It is working now
RC