mIRC Homepage
Posted By: Flophead $hfind() , please help me :) - 21/04/05 02:36 AM
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
Posted By: RusselB Re: $hfind() , please help me :) - 21/04/05 03:27 AM
try this
Code:
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.
Posted By: Sigh Re: $hfind() , please help me :) - 21/04/05 06:59 AM
$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
Posted By: DaveC Re: $hfind() , please help me :) - 21/04/05 07:24 AM
/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.

Code:
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 }
  }
}
Posted By: Flophead Re: $hfind() , please help me :) - 21/04/05 11:05 PM
Thx DaveC , works smile

thx
Posted By: SladeKraven Re: $hfind() , please help me :) - 21/04/05 11:23 PM
Your nickname is a little more appropriate. :tongue:
© mIRC Discussion Forums