mIRC Homepage
Posted By: pouncer this alias isnt working properly - 20/04/06 07:20 PM
Code:
alias test {
; this sets a variable %blah in mIRC
 $dllcall(blah.dll, 0, function1, 0)

 if (%blah) { echo -a YES var exists }
}


it dllcall DOES set the %blah variable in mIRC, but it doesnt echo the 2nd line..

its like it only executes the first line in the alias and stops :S
Posted By: bwr30060 Re: this alias isnt working properly - 20/04/06 07:33 PM
How do you know it's setting the variable? The mIRC help for $dllcall says the parameters are this
Quote:

$dllcall(filename, alias, procname, data)


Are you sure you're calling it correctly?
Posted By: pouncer Re: this alias isnt working properly - 20/04/06 07:40 PM
yep its correct,

$dllcall(filename, alias, procname, data)

instead of using alias name, i just used 0, doesnt make a difference

but weird problem is:

alias test {
$dllcall(blah.dll, 0, function1, 0)
echo -a test
}

it echos 'test' for me first, then it sets the variable :S

i know this because when it sets the variable i make it send a mesage to mirc too (an echo), and the message appears AFTER the 'test' echo.

why doesnt it execute the alias in order?
Posted By: DaveC Re: this alias isnt working properly - 21/04/06 02:01 AM
It does execute the alias in order, you just didnt read the help file.

/help $dllcall

I draw your attention to....
$dllcall() is multi-threaded so it will not halt the script and will call the specified alias once the call returns.

aka, the alias continues to run while the $dllcall is also running, thus the next line of the alias checks the condition of %blah and finds if $false so echos nothing.

The idea of it being able to call an alias on return (which means it well call an alias when and only when mirc becomes free, so dont do a loop for ever waiting for it) is so you can continue processing your script with the $dllcall result in hand.
Posted By: pouncer Re: this alias isnt working properly - 21/04/06 04:55 PM
ok thanks. also:

$dllcall(blah.dll, 0, function1, 0)

sometimes it gives me

0 unknown command becasue 0 is not an alias.

any way to stop this, without using an alias?
Posted By: Mpdreamz Re: this alias isnt working properly - 21/04/06 05:59 PM
use $null or a nonechoing command like .!.echo ! or !noop ! (6.17) if $null fails which i doubt.

$dllcall(blah.dll,$null, function1, 0)
$dllcall(blah.dll,, function1, 0)

both count as sending a $null.
Posted By: DaveC Re: this alias isnt working properly - 22/04/06 03:14 AM
Quote:
ok thanks. also:

$dllcall(blah.dll, 0, function1, 0)

sometimes it gives me

0 unknown command becasue 0 is not an alias.

any way to stop this, without using an alias?


from that i would assume u must have an alias called 1 since its 1 if the call is ok, so if u got an alias 1 and your happy calling it when its good, then do this

/alias 0 { }
© mIRC Discussion Forums