Jump to content
Sign in to follow this  
Jiggaboo

What is wrong with this simple line of code..

Recommended Posts

Jiggaboo

Hey, so I play Hellgate: London, and more often than not, it freezes up on me, and the only way I can quit is to turn off my computer. So, instead of doing that, I would rather just kill the process (and the only way to do that is by pressing a key, because I am unable to leave the game window) so I made a simple script to kill the process once I press the specified hotkey. So this all works great, but I thought I would improve the script, so I would no longer have to run both files (the script that will kill the game, and the game itself). So I want to have the script start the game for me.

This is so simple, I cannot believe I am having problems with it. I have somehow messed up the syntax and just cannot figure it out. Any help would be greatly appreciated.

HotKeySet("{End}", "Kill")
Run("Launcher", "C:\Program Files\Flagship Studios\Hellgate London\")
Sleep(1500)
Send("{TAB}")
Sleep(200)
Send("{ENTER}")
;Add auto-logon hurr
While 1
    Sleep(5000)
    WEnd
;~~~~~~~~~~~~~~~
Func Kill()
    ProcessClose("hellgate_mp_dx9_x86.exe")
EndFunc

Line 2 is where I am having problems.

The error says that it is unable to execute the external program, because it cannot find the file.

But I know that this is the file name .. so I must have screwed up the syntax somehow.

Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
Generator

Try this..

Run("Launcher.exe", "C:\Program Files\Flagship Studios\Hellgate London\")

If doesn't work then this..

ShellExecute("C:\Program Files\Flagship Studios\Hellgate London\Launcher.exe")

Share this post


Link to post
Share on other sites
Jiggaboo

Try this..

If doesn't work then this..

Thanks for the reply, I appreciate it.

On the first suggestion, I got the same error.

And on the second, it says that ShellExecute function is an unknown Function name.

Share this post


Link to post
Share on other sites
Nahuel

What version of AuotoIt do you have?

MsgBox(0,"",@AutoItVersion)

Share this post


Link to post
Share on other sites
Jiggaboo

What version of AuotoIt do you have?

MsgBox(0,"",@AutoItVersion)
3.1.1.0

Share this post


Link to post
Share on other sites
Nahuel

haha, dude version 3.2.9.6 is out there :P Download that first and check the code Generator gave you.

Share this post


Link to post
Share on other sites
Jiggaboo

O_O

Wow I am way behind!

Thanks a lot for your replies man, I really appreciate the help.

-edit-

Well, that fixed it (the ShellExecute) and now it works flawlessly. Thanks a lot for everyones help!

Edited by Jiggaboo

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  

×