mIRC Home    About    Download    Register    News    Help

Print Thread
#169216 20/01/07 12:03 PM
Joined: Apr 2006
Posts: 464
O
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Does anyone know a way to remotely start the Script Editor?

I run two versions of mIRC. My main client, and a bot.
The bot is always minimised in the tray (next to the clock).
Now I'm looking for a way to start the bot's Scripts Editor from my main client.

Something like !rse

Obviously I'll add some protections, to make sure it will only activate if it's me. But is it possible?

Thx in advance!

Joined: Apr 2006
Posts: 464
O
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Code:
on *:TEXT:!rse:?:{
  sendkeys % $+ r
}

alias sendkeys {
  .comopen sendkeys WScript.Shell
  if ($com(sendkeys)) .comclose sendkeys $com(sendkeys,SendKeys,3,bstr,$1-)
}


Hmm, ok that code is actually running the editor.
But it runs it from the wrong client.

Joined: Apr 2006
Posts: 464
O
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Does anyone have any idea's on this one?
It's opening the script editor from the main client, and not from the bot.

Even though the script is triggered from the bot....

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
Try making the bot's mIRC the active window before you use the sendkeys commands.

/help /showmirc

-genius_at_work

Joined: Apr 2006
Posts: 464
O
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
Perfect, thank you Genius.

I now have this line in my Main Client aliases:
/F12 .notice botname run-script-editor

And the following code in the Bots remote section:
Code:
on *:NOTICE:run-script-editor:?:{
  showmirc -x
  if ($appstate == maximized) { sendkeys % $+ r }
  .timer 1 1 showmirc -m
}

alias sendkeys {
  var %a = sendkeys $+ $ticks
  .comopen %a WScript.Shell
  if !$comerr {
    var %b = $com(%a,SendKeys,3,bstr,$1-)
    .comclose %a
    return %b
  }
  return 0
}


So, I just press the F12 key, and bot's remote window pops up!

Thanks smile


Link Copied to Clipboard