mIRC Home    About    Download    Register    News    Help

Print Thread
this alias isnt working properly #147582 20/04/06 07:20 PM
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.
Re: this alias isnt working properly #147583 20/04/06 07:33 PM
Joined: May 2005
Posts: 449
bwr30060 Offline
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?

Re: this alias isnt working properly #147584 20/04/06 07:40 PM
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?

Re: this alias isnt working properly #147585 21/04/06 02:01 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
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.

Re: this alias isnt working properly #147586 21/04/06 04:55 PM
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?

Re: this alias isnt working properly #147587 21/04/06 05:59 PM
Joined: Apr 2004
Posts: 759
M
Mpdreamz Offline
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
Re: this alias isnt working properly #147588 22/04/06 03:14 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
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 { }