mIRC Homepage
Posted By: Krayzee $SoundCard - 28/05/04 10:56 PM
how's about a $SoundCard which would return $TRUE or $FALSE if a soundcard is present or not.

this would be usefull in case where u have a script that plays sounds and there is not soundcard installed.

this way u could check for a soundcard before u play a sound.
Posted By: MTec89 Re: $SoundCard - 29/05/04 01:16 AM


use: //echo -a $SoundCard

Code:
alias SoundCard { var yas $dll(checksounddev.dll, soundcards, 0) | if (yas >= 1) { return $True } |  else { return $false }}
http://www.mtec89.com/ftp/checksounddev.dll
Posted By: FiberOPtics Re: $SoundCard - 29/05/04 09:24 AM
Hi,

when setting a variable you need to put a % in front of the name, like %yas, but I assume you know this and simply forgot about it, no biggie.
Code:
 
alias SoundCard return $iif($dll(checksounddev.dll, soundcards, 0),$true,$false) 


Greets
Posted By: MTec89 Re: $SoundCard - 29/05/04 04:46 PM
i didnt "set" anything i used a local "var".
Posted By: FiberOPtics Re: $SoundCard - 29/05/04 04:54 PM
ROFL

And you think a local var doesn't need to be set?

You're confusing the word 'to set a variable' with mIRC's function /set

Whether its local or global, you're still setting a variable.

And the fact remains, local variables also need to be preceded by a %

But hey, don't take my word for it, open up your mIRC and put in the following aliases:

alias test1 {
var yas = blabla
echo -a yas
}

alias test2 {
var %yas = blabla
echo -a %yas
}

Results for the two aliases:

alias 1: echo's "yas" in other words, just the plain text word yas

alias 2: echo's "blabla" which is the contents of the variable %yas

I suggest you do /help local variables

lol
Posted By: MTec89 Re: $SoundCard - 29/05/04 04:57 PM
:P well any way the dll still does what is needed regardless of my horrible mircscript
Posted By: FiberOPtics Re: $SoundCard - 29/05/04 05:05 PM
Ah,

don't beat urself up, it's not "horrible mircscript", you simply made a mistake, no worries, everyone makes mistakes.

Cya
Posted By: Artwerks Re: $SoundCard - 29/05/04 05:32 PM
/var is only a /set -l
Here's the test:

alias set { echo -a $1- }
//var %a = Data here
© mIRC Discussion Forums