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
How do you know it's setting the variable? The mIRC help for $dllcall says the parameters are this
$dllcall(filename, alias, procname, data)
Are you sure you're calling it correctly?
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?
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.
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?
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.
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 { }