mIRC Homepage
Posted By: MrPeepers Hash Table Help - 22/08/03 01:10 PM
IM writing a script where you can type !suggest suggestion here to the bot and it would save that, I have it done but without hash table, and Id like to use one everyone seems to like them, I looked in help and I sorta get it but I was wondering if someone could just give me a push start. I was planning on storing The suggest who made it when they made it and their userhost. Im not asking fo ryou to write it just a hin or push start
Posted By: LocutusofBorg Re: Hash Table Help - 22/08/03 01:25 PM
Code:
/hadd tablename nick $address($nick,3) $ctime suggestion


note:
1. always store times in ctime format - makes for easy calculations should you ever want them. added advantage: it's only one word
2. put the suggestion last. everything else is only one word, so you can easily extract all information

For more info: hash table tutorial by Pasmal
Posted By: MrPeepers Re: Hash Table Help - 22/08/03 01:30 PM
I'd first want to create the has table and then set it to load when I start mirc and save when I quit correct?
Posted By: MrPeepers Re: Hash Table Help - 22/08/03 02:12 PM
OKay first I make the table /hmake -s suggestion 10
Then I have a remote
on 10:text:!suggest*:*:/hadd -s suggestion $nick $address($nick,3) $ctime $2-
//echo -a The first item found in the suggestion is $hget(suggestion,1).item
Will return the nick that did it but it wont store anything after the nick
Posted By: SladeKraven Re: Hash Table Help - 22/08/03 09:49 PM
Try..
Code:
on 10:text:!suggest*:[color:red]#[/color]:/hadd -s suggestion $nick $address($nick,3) $ctime $2- 
Posted By: LocutusofBorg Re: Hash Table Help - 23/08/03 06:34 AM
What he has would work, just everywhere and not only in a channel.

The $hget(table,1).item returns the item that happens to be in slot one. Hash tables are not sorted in any way. To get the info about the user,

var %user = $hget(tablename,1).item
var %info = $hget(tablename,%user)
© mIRC Discussion Forums