mIRC Home    About    Download    Register    News    Help

Print Thread
$hfind() , please help me :) #117938 21/04/05 02:36 AM
Joined: Apr 2005
Posts: 2
F
Flophead Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
F
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

Re: $hfind() , please help me :) #117939 21/04/05 03:27 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Re: $hfind() , please help me :) #117940 21/04/05 06:59 AM
Joined: Aug 2003
Posts: 314
S
Sigh Offline
Fjord artisan
Offline
Fjord artisan
S
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

Re: $hfind() , please help me :) #117941 21/04/05 07:24 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
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.

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 }
  }
}

Re: $hfind() , please help me :) #117942 21/04/05 11:05 PM
Joined: Apr 2005
Posts: 2
F
Flophead Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
F
Joined: Apr 2005
Posts: 2
Thx DaveC , works smile

thx

Re: $hfind() , please help me :) #117943 21/04/05 11:23 PM
Joined: Dec 2002
Posts: 3,547
S
SladeKraven Offline
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Your nickname is a little more appropriate. :tongue: