mIRC Home    About    Download    Register    News    Help

Topic Options
#117938 - 21/04/05 03:36 AM $hfind() , please help me :)
Flophead Offline
Bowl of petunias

Registered: 21/04/05
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

Top
#117939 - 21/04/05 04:27 AM Re: $hfind() , please help me :)
RusselB Offline
Planetary brain

Registered: 03/08/04
Posts: 7252
Loc: Ontario, Canada
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.

Top
#117940 - 21/04/05 07:59 AM Re: $hfind() , please help me :)
Sigh Offline
Fjord artisan

Registered: 28/08/03
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

Top
#117941 - 21/04/05 08:24 AM Re: $hfind() , please help me :)
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
/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 }
  }
}

Top
#117942 - 22/04/05 12:05 AM Re: $hfind() , please help me :)
Flophead Offline
Bowl of petunias

Registered: 21/04/05
Posts: 2
Thx DaveC , works smile

thx

Top
#117943 - 22/04/05 12:23 AM Re: $hfind() , please help me :)
SladeKraven Offline
Planetary brain

Registered: 19/12/02
Posts: 3547
Loc: Kent, England
Your nickname is a little more appropriate. :tongue:

Top