Jump to content
Sign in to follow this  
gumbitha

Script breaks when compiled.

Recommended Posts

gumbitha

When I run this through SciTe's "Go" option, it works just fine. However, when I compile it using "Aut2Exe v3", it fails to detect my keystroke when I am ingame.

What it does: Detects Control+Alt+Q. If Jedi academy is running (jamp.exe), it closes the process.

#include <Misc.au3>
#NoTrayIcon
HotKeySet("^!q", "close")

While 1
sleep(10)
WEnd
Func close()
$PID = ProcessExists("jamp.exe") 
If $PID Then 
    ProcessClose($PID)  
MsgBox(0, "Subaru's MBII closer", "MBII successfully closed!")
Exit
Else 
    MsgBox(0, "Subaru's MBII closer", "MBII wasn't running!")
    exit
    Endif
EndFunc

Share this post


Link to post
Share on other sites
APPLEEATER

When I run this through SciTe's "Go" option, it works just fine. However, when I compile it using "Aut2Exe v3", it fails to detect my keystroke when I am ingame.

What it does: Detects Control+Alt+Q. If Jedi academy is running (jamp.exe), it closes the process.

#include <Misc.au3>
#NoTrayIcon
HotKeySet("^!q", "close")

While 1
sleep(10)
WEnd
Func close()
$PID = ProcessExists("jamp.exe") 
If $PID Then 
    ProcessClose($PID)  
MsgBox(0, "Subaru's MBII closer", "MBII successfully closed!")
Exit
Else 
    MsgBox(0, "Subaru's MBII closer", "MBII wasn't running!")
    exit
    Endif
EndFunc
You could try the compile command in SciTe but that might not fix it either...

The thing is...

the hotkey might not work because the script is too busy *SLEEPING* and also if MDII is running then your computer is doing that too,

so you could try changing it to Sleep(100) and it could work,

it might just be because it needs SciTe to be running to detect it when the game is open too...

Another Option is adding a GUI instead of just Sleep

Share this post


Link to post
Share on other sites
gumbitha

Yeah. I'm going to see _IsPressed() will work better.

EDIT: Nope same behavior. Same with SciTe's compile option ;)

EDIT2: Removed sleep. Still no bananas. It detects the hotkey only when the game is NOT running, which is what I don't want. I might have to find a different way to tell autoit to close the process.

Edited by gumbitha

Share this post


Link to post
Share on other sites
APPLEEATER

Yeah. I'm going to see _IsPressed() will work better.

EDIT: Nope same behavior. Same with SciTe's compile option ;)

EDIT2: Removed sleep. Still no bananas. It detects the hotkey only when the game is NOT running, which is what I don't want. I might have to find a different way to tell autoit to close the process.

Yes,

the game is probably just blocking hotkeys,

if this does not defeat the purpose of your program then you could make a GUI window with an EXIT Game Button

Share this post


Link to post
Share on other sites
gumbitha

Yes,

the game is probably just blocking hotkeys,

if this does not defeat the purpose of your program then you could make a GUI window with an EXIT Game Button

I still don't see what having SciTe running is doing for it...

I dont know of any good way to make a GUI window that you could focus on without using a hotkey ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.