AutoHotkey Community

It is currently May 27th, 2012, 11:40 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: May 6th, 2010, 12:36 pm 
Offline

Joined: April 30th, 2010, 1:03 am
Posts: 98
Location: ACT
This is my first script with AHK so bear with me
I have written a script for an online MMO (Mortal Online).

at the start of my script i have
Code:
Runwait %A_ScriptDir%\Mortal Online Launcher.exe
Process, waitclose, nowgame.exe
Exitapp

Gotpos = false

^t::
if GotPos = false
{
   MouseGetPos xpos1, ypos1
   GotPos = true
   send z
}
else if GotPos = True
{   
   send z
   sleep 100
   MouseGetPos xpos2, ypos2
   mousemove xpos1, ypos1
   sleep 100
   send {click}
   mousemove xpos2, xpos2
   send z
   GotPos = False
}
return

the first line of the code starts the launcher for MO.
when you press play on the launcher its starts Nowgame.exe so i told my script to wait until Nowgame.exe closes, then to exit.
My problem is that because my script is waiting for Nowgame.exe to close it can't run my "If" statements in the next part of code.
How can i change the starting code to allow it to run the IF's

Basically i need some code that will run an exe then when the exe closes it will automatically exit the script if or when Nowgame.exe is no longer running.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 6th, 2010, 12:46 pm 
Offline

Joined: June 8th, 2006, 2:41 am
Posts: 285
one way is to use settimer to periodically check if its closed.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: bowen666, MSN [Bot] and 15 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group