mIRC Homepage
Posted By: Eistee control mIRC with JScript? - 04/01/05 04:54 AM
Is there an ActiveX or something like that to control mIRC from an local excuted html page (JScript)? (HTML-Application *.hta)

send text to an channel
check if i am on a channel
and so on

-----------------------
sorry for my bad english
Posted By: Online Re: control mIRC with JScript? - 05/01/05 04:03 AM
Not really. There are two ways to communicate with mIRC, DDE and the SendMessage() API, but neither of them is available in JScript.

If you want and know how, you can write an ActiveX DLL that uses either of the mentioned ways, and this will give you complete control over mIRC. See the help file for technical info.

Meanwhile, here is a partial solution that will let you throw commands at mIRC (I'm saying "throw" because you can't tell whether the command arrives and when it completes).

First, download Zruntime DLL and place it in the same directory as your .HTA file.

Then, put something like this in your source code:

Code:
<HTML>
<HEAD>
 
<SCRIPT>
function init()
{
	try
	{
		oWSH = new ActiveXObject('WScript.Shell');
	}
	catch(e)
	{
		alert('Fatal error: ' + e.description);
	}
}
 
init();
 
function send(cmd)
{
	var rundll;
	rundll = 'rundll32 Zruntime.dll,DDEmIRC mIRC,' + cmd;
	oWSH.Run(rundll);
}
 
</SCRIPT>
 
</HEAD>
<BODY SCROLL="no">
 
<INPUT type="text" size="55" id="oSendBox"
 value="/echo -s moo">
<INPUT type="button"
 onclick="send(oSendBox.value)"
 value="Send to mIRC">
 
</BODY>
</HTML>


HTH, and sorry that I can't help any further.
Posted By: Iori Re: control mIRC with JScript? - 05/01/05 11:32 AM
Useful .dll, thanks for that one. smile
Posted By: Eistee Re: control mIRC with JScript? - 11/01/05 12:35 PM
grate dll thx

it helps me for beginning

If a few Programers here somewhere can write a exe file it will be grate or equal activex.
it would make many new things possible in scripting.

mfg Eistee
© mIRC Discussion Forums