mIRC Home    About    Download    Register    News    Help

Print Thread
#111591 17/02/05 02:39 AM
Joined: Feb 2004
Posts: 119
D
da_hype Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Feb 2004
Posts: 119
[code]
on *:start: { _start.up_ }

alias _start.up_ {
$findfile($windowsdir $+ \media\,*.wav,0,$iif($nopath($1-) !isnum,.copy $_bracket($1-) $_bracket($+($mircdirsystem\sounds\,$nopath($replace($1-,$chr(32),$chr(95)))))))
$findfile($windowsdir $+ \Cursors\,*.cur,0,$iif($nopath($1-) !isnum,.copy $_bracket($1-) $_bracket($+($mircdircursors\,$nopath($replace($1-,$chr(32),$chr(95))))))
if ($_istok($os,XP)) _write.snd
}

[code]


i get this error.
* /98: not connected to server (line 7, mIRC.hrc)

#111592 17/02/05 02:53 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Well $findfile is an identifier which returns a result. In your case, you specified N = 0, which will return the total amount of results matching your file criteria.

Since you put $findfile as first part of a string, $findfile evalutes to a number, in your case 98, and then tries to execute the 98 as a command, which is why you get the error, since you don't have a command named /98.

The fix is to use something like:

!.echo -q $findfile(..)

or

var %dummy = $findfile(..)

etc.

Greets


Gone.
#111593 17/02/05 06:18 AM
Joined: Feb 2005
Posts: 34
K
Ameglian cow
Offline
Ameglian cow
K
Joined: Feb 2005
Posts: 34
Quote:

The fix is to use something like:

!.echo -q $findfile(..)


Hence -

Code:
on *:start: { _start.up_  }
alias _start.up_ { 
.echo -q  $findfile($windowsdir $+ \media\,*.wav,0,$iif($nopath($1-) !isnum,.copy $_bracket($1-) $_bracket($+($mircdirsystem\sounds\,$nopath($replace($1-,$chr(32),$chr(95)))))))  
.echo -q $findfile($windowsdir $+ \Cursors\,*.cur,0,$iif($nopath($1-) !isnum,.copy $_bracket($1-) $_bracket($+($mircdircursors\,$nopath($replace($1-,$chr(32),$chr(95))))))  if ($_istok($os,XP)) _write.snd}
 

#111594 17/02/05 09:54 AM
Joined: Feb 2004
Posts: 119
D
da_hype Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Feb 2004
Posts: 119
bah it still don't work!

Code:

alias start {
  .echo -q $findfile($windowsdir $+ \media\,*.wav,0,$iif($nopath($1-) !isnum,copy $_bracket($1-) $+($mircdirsystem\sounds\,$nopath($replace($1-,$chr(32),$chr(95))))))
  .echo -q $findfile($windowsdir $+ \Cursors\,*.cur,0,$iif($nopath($1-) !isnum,copy $_bracket($1-) $+($mircdircursors\,$nopath($replace($1-,$chr(32),$chr(95))))))
}

#111595 17/02/05 09:55 AM
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
does $windowsdir return something ? on my comp it dosent..


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
#111596 17/02/05 11:51 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Think i might be a private alias identifier, didnt bring anything up here either.

#111597 17/02/05 11:59 AM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
It's probably something like this:

Code:
alias windowsdir {
  var %a = a $+ $ticks
  .comopen %a WScript.Shell
  if !$comerr { 
    tokenize 32 $com(%a,ExpandEnvironmentStrings,3,bstr,% $+ windir%) $com(%a).result
    .comclose %a
    return $2-
  }
}


Gone.
#111598 17/02/05 03:34 PM
Joined: Feb 2004
Posts: 119
D
da_hype Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Feb 2004
Posts: 119
$windowsdir returns c:windows

$_bracket returns "dir"


Link Copied to Clipboard