|
Joined: Apr 2005
Posts: 2
Bowl of petunias
|
OP
Bowl of petunias
Joined: Apr 2005
Posts: 2 |
I have hash file which contains example Moviedatabase and still no works ://
on *:text:!movie*:*: {
/notice $nick $hfind(moviedatabase,5,$2, w).data
}
Where is problem please ?
thx
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
try this on *:text:!movie *:*:{
.notice $nick $hfind(moviedatabase,$2-,1,w).data
}
I'm presuming you want to return the data for the first match...if I'm wrong, change the 1 in the code to which ever match number you want..1 = first, 2 = second, 3 = third, etc.
|
|
|
|
Joined: Aug 2003
Posts: 314
Fjord artisan
|
Fjord artisan
Joined: Aug 2003
Posts: 314 |
$hfind would return the item name, the .data property just makes it search for matching data
If $2- contains no wildcards then $hfind isn't necessary so it would help to know exactly how the !movie query should operate
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
/notice $nick $hget(moviedatabase,$hfind(moviedatabase, 5,$2 -, #, w).data )missed bits : $hfind gets you the item name not the contents, this may have been what you wanted tho, im not sure not needed : 5, is not needed and isnt part of the $hfind construct Try this below. usage !movie<match text> <match text> well be matched as any part of an hashtable items data, wild cards pased well be used, ie: *&? If no matches then its reported Up to 4 matches well be reported 5+ matches produces a refine your search request.
on *:text:!movie*:*:{
tokenize 32 $+(*,$mid($1-,7),*)
if (!$hfind(moviedatabase,$1-,0,w).data) { .notice $nick No Matches Found. }
else {
.notice $nick $hget(moviedatabase,$hfind(moviedatabase,$1-,1,w).data)
.notice $nick also $hget(moviedatabase,$$hfind(moviedatabase,$1-,2,w).data)
.notice $nick also $hget(moviedatabase,$$hfind(moviedatabase,$1-,3,w).data)
.notice $nick also $hget(moviedatabase,$$hfind(moviedatabase,$1-,4,w).data)
if ($$hfind(moviedatabase,$1-,5,w).data)) { .notice $nick Others also please refine your search }
}
}
|
|
|
|
Joined: Apr 2005
Posts: 2
Bowl of petunias
|
OP
Bowl of petunias
Joined: Apr 2005
Posts: 2 |
Thx DaveC , works thx
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Your nickname is a little more appropriate. :tongue:
|
|
|
|
|