mIRC Homepage
Posted By: keeker $findfile Problem ( I think) - 07/08/06 01:00 PM
hey y'all

i am having a problem with finding files for my lrycis script. the part of the code that is giving me trouble is:
Code:
 
  elseif ( @find == $1 ) {
    set %search = $+(*,$replace($2-,$chr(32),$chr(42)),*)
    echo -a Searching for: %search
    if ( $findfile($lydir,%search,0) > 10 ) {
      notice $nick Sorry $upper($nick) $+ , but i have more that 5 matches, try grabbing my list with: @ $+ $me 
    }
    elseif ( $findfile($lydir,%search,0) < 10 ) && $findfile($sound(mp3),%search,0) != 0 )  {
      senote
    }
    elseif ( $findfile($lydir,%search,0) == 0 ) { notice $nick Sorry $nick i have NO results for %search }
  }
}
;=======================================================
alias senote {
  var %count = 1
  Notice $nick I have found $findfile($lydir,$+(*,%search,*),0) files for your query of: %search
  while %count < 10 { 
    .echo -qa $findfile($lydir,$+(*,%search,*),0,timer 1 $count(%count + 1) notice $nick $+(!,$me) $nopath($1-)) 
    inc %count
  }
} 


and all i get is this:
I have found 0 files for your query of: = *metallica*ride*the*lightning*

its always 0 (zero) and it doesnt send the lyrics results. can yall have a looksie and tell me where i screwed up?

============================================================

ps the "=" that is in the blue line above isnt supposed to be there either...i dotn have any code in my script that returns an "=" sign

any help would be gratefull

thanks
smirk
Posted By: hixxy Re: $findfile Problem ( I think) - 07/08/06 01:10 PM
It should be set %search <data>, not set %search = <data>
Posted By: keeker Re: $findfile Problem ( I think) - 07/08/06 01:42 PM
thank you hixxy, its working now

/me hands hixxy the prestigeous golden script for outstanding performance.
Posted By: MikeChat Re: $findfile Problem ( I think) - 07/08/06 04:33 PM
Quote:

and all i get is this:
I have found 0 files for your query of: = *metallica*ride*the*lightning*

its always 0 (zero) and it doesnt send the lyrics results. can yall have a looksie and tell me where i screwed up?

============================================================

ps the "=" that is in the blue line above isnt supposed to be there either...i dotn have any code in my script that returns an "=" sign

any help would be gratefull

thanks
smirk


set %search = $+(*,$replace($2-,$chr(32),$chr(42)),*)
/set %var doesnt use the "=" and is prolly why your code broke as well as it showing up in the result
Posted By: genius_at_work Re: $findfile Problem ( I think) - 07/08/06 04:55 PM
You shouldn't call $findfile 3 times for the same thing. You should store the results in a variable once and use that for the comparisons.

var %results = $findfile(blah,blah,blah)
if (%results > 10) { ;blah }
elseif (%results < 10) { ;blah }
elseif (%results == 0) { ;blah }

-genius_at_work
© mIRC Discussion Forums