mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
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


keek: Scots - intr.v. keeked, keekĀ·ing, keeks
To peek; peep.
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
It should be set %search <data>, not set %search = <data>

Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
thank you hixxy, its working now

/me hands hixxy the prestigeous golden script for outstanding performance.


keek: Scots - intr.v. keeked, keekĀ·ing, keeks
To peek; peep.
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
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

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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


Link Copied to Clipboard