Also, there is a problem with RusselB's hadd... It has no item name, which is probably the problem.
.hadd -m Dictionary $qt($2-) added by $nick ADDRESS: $address DATE AND TIME: $date $time
Let's say someone did
!addictionary this is a quoteThe item name would be
"this (including the quote). The data for that item would be
is a quote" added by $nick ADDRESS: $address DATE AND TIME: $date $timeYou can't $hfind that because part of what you're searching for is in the item name instead of the data.
Instead, you need to include an item name. If you want to just use numbers, you can do something like:
.hadd -m Dictionary $calc($hget(Dictionary,0).item + 1) $qt($2-) added by $nick ADDRESS: $address DATE AND TIME: $date $time
As long as you aren't deleting quotes, that will work fine. If you are deleting them, then you'll want to have it verify that you don't alreayd have a quote using the number chosen...
var %quotenum = $calc($hget(Dictionary,0).item + 1)
while ($hget(Dictionary,%quotenum)) {
inc %quotenum
}
.hadd -m Dictionary %quotenum $qt($2-) added by $nick ADDRESS: $address DATE AND TIME: $date $time
That will make certain that you are not accidentally overwriting a previous quote. This would probably be the best choice even if you don't plan to delete quotes.
EDIT: As a note, if you are using this as a dictionary rather than a quote script (where someone would look up an actual word and not a phrase), then I would suggest this:
.hadd -m Dictionary $2 $qt($3-) added by $nick ADDRESS: $address DATE AND TIME: $date $time
This will let you use $hget(Dictionary,$2) to display the definition because $2 would be the item name and $3- would be the definition (in quotes). No need for $hfind. The issue was really the quotes, I think.