mIRC Home    About    Download    Register    News    Help

Print Thread
#1539 13/12/02 10:20 PM
Joined: Dec 2002
Posts: 24
L
Laban Offline OP
Ameglian cow
OP Offline
Ameglian cow
L
Joined: Dec 2002
Posts: 24
It would be great if /run could wait for a program to finish and then return the result (if any). Any plans on implenting that?


!ERAU QSSI DLRO WEHT
#1540 14/12/02 01:58 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
/RUN launches a new process; once launched, mIRC does not control it anymore than your desktop mIRC icon can control mIRC after it launches it. It's the same principle as firing a bullet from a gun: once launched, the bullet reports nothing back to the gun that launched it. It's "fire and forget."


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#1541 14/12/02 09:18 AM
Joined: Dec 2002
Posts: 212
V
Fjord artisan
Offline
Fjord artisan
V
Joined: Dec 2002
Posts: 212
just a guess, but can't com be used to do that?


And all I need now is intellectual intercourse, a soul to dig the hole much deeper
#1542 14/12/02 03:31 PM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
A dll might be able to, as would a COM object that you coded specifically to work with mIRC (like you would for a dll). However, neither of those use /run. ;p


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#1543 14/12/02 05:04 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
my /sleep snippet takes advantage of COM's ability to wait for programs to return. you can take a look at the script file if you're interested...

#1544 16/12/02 08:23 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Yes thats exactly what run does, and he is asking to have it do differently...

#1545 22/12/02 10:04 PM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
> It would be great if /run could wait for a program to finish and then return the result (if any).

Here is a solution using COM that will work...

really only $myrun.a is needed, but be aware that halting script execution like this could be very bad in events (signal events are ok to use in)

alias myrun { .timerRun $+ $ctime 1 0 myrun.t $1- }
alias myrun.t { aecho Return: $myrun.a($1-) }
alias myrun.a {
var %Return | var %Com | set %Com %Member $+ $ticks
.comopen %Com WScript.Shell
if (!$comerr) {
set %Return $com(%Com,Run,3,bstr,$1,int,5,bool,1)
if (%Return == 0) { return $null }
set %Return $com(%Com).result
.comclose %Com
return %Return
}
return $null
}



NaquadaBomb
www.mirc-dll.com

Link Copied to Clipboard