mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
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

Last edited by pouncer; 20/04/06 07:21 PM.
Joined: May 2005
Posts: 449
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
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?

Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
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?

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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.

Joined: Oct 2005
Posts: 827
P
pouncer Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: Oct 2005
Posts: 827
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?

Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
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.


$maybe
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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 { }


Link Copied to Clipboard