Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: ahk won't terminate on my custom hotd3 script?  (Read 2560 times)

0 Members and 1 Guest are viewing this topic.

rdowdy95

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 609
  • Last login:July 29, 2011, 11:48:50 am
  • This is my rifle.
ahk won't terminate on my custom hotd3 script?
« on: February 07, 2007, 11:39:16 pm »
Hey guys I have been tinkering with the HOTD3 and I got it to load the game without having to go through the launcher with the following ahk script.  I then converted it to an exe and it is very nice.

**********

RegWrite, REG_DWORD, HKEY_LOCAL_MACHINE, SOFTWARE\SEGA\hod3\Settings, Played, 1


Run, C:\Program Files\Sega\THE HOUSE OF THE DEAD3_EU\exe\HOD3PC.exe

Sleep, 4000
WinWaitClose, THE HOUSE OF THE DEAD 3
return
ExitApp

**********

Now what I am wanting to do is add a command in there so whenever I press the ESC key I want it to do an Alt + F4 command.  This will give me a window in HOTD3 that says you sure you want to exit? yes or no.  This is kind of like how HOTD2 is by default.  You hit esc a window comes up making sure you want to quit.

I tried to make this script here:

**********RegWrite, REG_DWORD, HKEY_LOCAL_MACHINE, SOFTWARE\SEGA\hod3\Settings, Played, 1


Run, C:\Program Files\Sega\THE HOUSE OF THE DEAD3_EU\exe\HOD3PC.exe

Sleep, 4000
WinWaitClose, THE HOUSE OF THE DEAD 3
return
ExitApp

ESC::
Send {LAlt down}
Send {F4 down}
Send {LAlt up}
Send {F4 up}
return

**********

With this script the ESC button does great just like I want it to do.  Very nice.  It brings up the Quit Game confirmation which is what I want.  Now the thing is when I do say YES quit the game it will leave the script running in the systray.  I need to figure out a way to make it quit out the script.  I tried adding an ExitApp right under the return of the Alt + F4 thing but I can't get it to terminate the script.  I really would like to get that escape command in my ahk script.

Fozzy The Bear

  • Handbags at dawn in here!!!
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1831
  • Last login:September 18, 2011, 11:29:59 am
  • It's Been One Of Those Days... Don't Ask!
Re: ahk won't terminate on my custom hotd3 script?
« Reply #1 on: February 08, 2007, 01:13:12 am »
Hey guys I have been tinkering with the HOTD3 and I got it to load the game without having to go through the launcher with the following ahk script.  I then converted it to an exe and it is very nice.

**********

RegWrite, REG_DWORD, HKEY_LOCAL_MACHINE, SOFTWARE\SEGA\hod3\Settings, Played, 1


Run, C:\Program Files\Sega\THE HOUSE OF THE DEAD3_EU\exe\HOD3PC.exe

Sleep, 4000
WinWaitClose, THE HOUSE OF THE DEAD 3
return
ExitApp

**********

Now what I am wanting to do is add a command in there so whenever I press the ESC key I want it to do an Alt + F4 command.  This will give me a window in HOTD3 that says you sure you want to exit? yes or no.  This is kind of like how HOTD2 is by default.  You hit esc a window comes up making sure you want to quit.

I tried to make this script here:

**********RegWrite, REG_DWORD, HKEY_LOCAL_MACHINE, SOFTWARE\SEGA\hod3\Settings, Played, 1


Run, C:\Program Files\Sega\THE HOUSE OF THE DEAD3_EU\exe\HOD3PC.exe

Sleep, 4000
WinWaitClose, THE HOUSE OF THE DEAD 3
return
ExitApp

ESC::
Send {LAlt down}
Send {F4 down}
Send {LAlt up}
Send {F4 up}
return

**********

With this script the ESC button does great just like I want it to do.  Very nice.  It brings up the Quit Game confirmation which is what I want.  Now the thing is when I do say YES quit the game it will leave the script running in the systray.  I need to figure out a way to make it quit out the script.  I tried adding an ExitApp right under the return of the Alt + F4 thing but I can't get it to terminate the script.  I really would like to get that escape command in my ahk script.

Why have you got Return in your script.... where are you telling it to return to, you don't have a subroutine loop running, there's nowhere it can return to because it never started a subroutine to return from. Think about it dude.....

Best Regards,
Julian (Fozzy The Bear)
Most bottles and jars contain at least twenty-five percent recycled Pacman.
And research indicates that Space Invaders are strongly attracted to people who have recently eaten meat pies.

rdowdy95

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 609
  • Last login:July 29, 2011, 11:48:50 am
  • This is my rifle.
Re: ahk won't terminate on my custom hotd3 script?
« Reply #2 on: February 08, 2007, 10:15:58 am »
Come on Fozzy give me a little break here.  I just started using the ahk program.  What return command are you talking about.  The first one or the second one.  The first ahk script one I got from here on the forums.  The second one is mine.  The thing is if I don't put return in there it will only do the alt + F4 thing once.  The alt + F4 thing brings up a window that says are you sure you want to quit, then I can click yes or no.  I would like to keep that in there.  Do you have any recommendations.  "Think about dude" doesn't really help me

rdowdy95

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 609
  • Last login:July 29, 2011, 11:48:50 am
  • This is my rifle.
Re: ahk won't terminate on my custom hotd3 script?
« Reply #3 on: February 08, 2007, 01:40:16 pm »
When I get home tonight I am going to try this script to see if I can make it do what I want to do.  Key is just getting the script to stop.  Here is what I am going to try tonight.  I read that a 0x112 = WM_SYSCOMMAND, 0xF060 = SC_CLOSE is like an Alt-F4 press so I am going to add that in the script.  Check it out:

**********

RegWrite, REG_DWORD, HKEY_LOCAL_MACHINE, SOFTWARE\SEGA\hod3\Settings, Played, 1


Run, C:\Program Files\Sega\THE HOUSE OF THE DEAD3_EU\exe\HOD3PC.exe

Sleep, 4000
WinWaitClose, THE HOUSE OF THE DEAD 3
return
ExitApp

Escape::
PostMessage, 0x112, 0xF060,,, THE HOUSE OF THE DEAD 3
ExitApp          ; Hopefully will terminate the script
return

**********

Now I am hoping that everytime I press the ESC key it will be like an Alt+F4 press so I can get the really want to quit this game option.  So if I press No then press esc again the message will still pop up.  If not I may put a return command under the postmessage command then maybe do a winwaitclose, then an exitapp command.  Hopefully something like that will work if the other doesn't do what I want it to do.


Fozzy The Bear

  • Handbags at dawn in here!!!
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1831
  • Last login:September 18, 2011, 11:29:59 am
  • It's Been One Of Those Days... Don't Ask!
Re: ahk won't terminate on my custom hotd3 script?
« Reply #4 on: February 08, 2007, 02:19:31 pm »
"Think about it dude" doesn't really help me

OK Sorry.... I just scribbled a flow chart, I was tired last night and misread it a bit.... My fault entirely :notworthy: :notworthy:......You're on the right track with your new script, which should work and should exit the AHK exicutable but you might need to remove the first ExitApp command. The second one should then exit the script. Otherwise it may terminate before issuing the keystrokes you want.

Best Regards,
Julian (Fozzy The Bear)

Most bottles and jars contain at least twenty-five percent recycled Pacman.
And research indicates that Space Invaders are strongly attracted to people who have recently eaten meat pies.

rdowdy95

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 609
  • Last login:July 29, 2011, 11:48:50 am
  • This is my rifle.
Re: ahk won't terminate on my custom hotd3 script?
« Reply #5 on: February 08, 2007, 02:59:09 pm »
Thanks Fozzy.  I will try taking out the first exitapp command.  I will troubleshoot it some tonight.  That is usually how I figure out stuff, that and ask you guys here on the boards.