mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2007
Posts: 9
O
orcsoul Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Jan 2007
Posts: 9
What I'm trying to accomplish is that on execution of a specific 'on text' event, client A will launch client B ... I'm pretty sure I've got everything worked out except for how (if it's possible) to start an external program from within mirc.

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
//run "path to file\mirc.exe"


I am SReject
My Stuff
Joined: Jan 2007
Posts: 9
O
orcsoul Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Jan 2007
Posts: 9
Of course it had to be that simple *headdesk* I must have glossed right over that / command in the help index for mirc.

Thanks!

Joined: Jan 2007
Posts: 9
O
orcsoul Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Jan 2007
Posts: 9
Ok.. so everything is working.. however after putting a little more thought into it I realized I've got a very nasty vulnerability in my script.. as it stands now it's susceptible to malicious/ignorant misuse by spawning multiple instances of the run target...

I'm not familiar enough with mirc scripting to know how to construct an if-then or some other type of logic check that will somehow make sure that the command can only be run successfully once...

Perhaps by doing a /whois and checking that a nick is in use.. if the nick is in use, the /run doesn't get executed, otherwise the /run is performed?


on 1:TEXT:*call bot*:*://run "C:\Internet Utils\mircbot\mirc.exe"

Is where I'm at... but I'm unfortunately not quite sure how the syntax would work for the if statement, especially when it comes to somehow integrating it with the bot-call remote line.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The first option that occurs to me is to use a group to limit the ability to have the /run command started.
Eg:
Code:
on *:start:{
  .enable #bot_start
}
#bot_start off
on *:text:*call bot*:*:{
  .disable #bot_start
  run "C:\Internet Utils\mircbot\mirc.exe"
}
#bot_start end

When the script starts, the group #bot_start will be enabled.
This will then allow the call bot text to be recognized.
When that text is recognized the first time, the group is disabled, then the other mIRC is run.
Since the group is disabled the first time the text is recognized, that ON TEXT event will not be triggered again.
Exceptions are:
1) The script is restarted
2) The group is re-enabled, either manually or via another script.

Joined: Jan 2007
Posts: 9
O
orcsoul Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Jan 2007
Posts: 9
Hmm, thanks for the suggestion. I ended up figuring out how to integrate an if statement into the bot-call before seeing your reply, so went that route.

Joined: Apr 2010
Posts: 969
F
Hoopy frood
Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
If you REALLY want I could write a script using coms to check for 2 mirc.exe's running, and if not, start the second smile


I am SReject
My Stuff
Joined: Jan 2007
Posts: 9
O
orcsoul Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Jan 2007
Posts: 9
That would make the script significantly more secure from abuse, however I've no idea how much work that would entail on your behalf, and the crowd that would be utilizing the commands isn't the type to try to abuse something like that. However, thanks for the offer on that.


Link Copied to Clipboard