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 --- Bug Reports --- Site News

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

  

Author Topic: HyperAttract - Program that exits an emulator after specified idle time.  (Read 7384 times)

0 Members and 1 Guest are viewing this topic.

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 227
  • Last login:November 19, 2018, 06:58:18 pm
Update: Please see Brian_Hoffman's post below for HyperAttract
I had a little time.

What this app does. Waits the specified amount of time (in minutes) then closes any running processes(specified) after in-activity.

Why would you want this app? Lets say you have a MAME cab and a person starts a game and walks away.. Normally the game stays playing (forever). With this app it will close the emulator proceess after X amount of in-activity time. Thus bringing you back to the FE.


Download the Timer.zip
Extract the archive anywhere. Id copy the files into your FE root directory.

Edit the Watcher.INI , In the INI you can adjust the TIMER (in minutes) and in the emulators section add the process name to listen for. Eg.. MAME  you do not need to add the file extention.. EG do not use MAME.exe

Currently this will work for MOST but not ALL users. This app will hook only mouse and keystrokes.. So if your using a gamepad this app is not reccommended as you will exit your game un-intentionally.

Original Post:
I'm currently using the Mala Front End (which is awesome), but there's a feature I'd like to get on my cabinet. I have my cabinet shared at work, and when people finish playing a game, they don't exit the game typically. This means that the monitor stays on attract mode forever. Ideally, I'd like the monitor to go into sleep mode, but this can only happen if it's back at the front end. So I'm searching for a feature that will exit the game if no input is detected after a set period of time. Does anyone know of a front end or program that can do this?

I checked Mala and didn't see anything like it described.

Thanks!




« Last Edit: February 05, 2009, 03:20:01 am by kagaden »

youki

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1612
  • Last login:November 19, 2016, 01:07:33 pm
  • Atomic Front End Creator
    • Atomic Front End
Re: Front End that returns to itself from a game?
« Reply #1 on: January 16, 2009, 04:48:50 am »
AtomicFE has this feature somewhere in his engine.

I had introduce that as part of my  credit management system in fact. There is parameter where you say "go back to the FE after XXXX secondes of inactivity" and you can also forbid the "manual" exit.  It was done in the goal to avoid user to exit the game accidently.

But as this feature is part on the credit management system that i can not distribute (mame team is against this feature) , i have to double check in my code if you can use it independly. Otherwise i would have to do a little modification to make it available.

Before i spend time in that,  have a quick look in AtomicFE 0.20 and let me know if you are ready to swith to AFE if i make this feature accessible.  If you prefer stay with Mala , i will postpone the modification later.

therefore, as i said,  may be i don't need to modify it ,  the feature could be already accessible. Just have to check. (will look this week end)


Space Fractal

  • Wiki Master
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1887
  • Last login:April 10, 2013, 05:07:30 pm
  • Space Fractal
    • Space Fractal
Re: Front End that returns to itself from a game?
« Reply #2 on: January 16, 2009, 05:54:31 am »
As I see this have really not a credit feature or trying to detect that.

So I guess a Autohotkey script mightbeen can do the job to closedown the mame process when no input have been detected in the while.

But that depend how Mame use input, since I have not looked in or have any problems with in my FE (MultiFE), which does not have that feature yet.
Currectly in work: Greedy Mouse || Previous Work: MultiFE Frontend, ArcadeMusicBox Jukebox || Music for various games (Tardis.dk + Greatflash.co.uk).

youki

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1612
  • Last login:November 19, 2016, 01:07:33 pm
  • Atomic Front End Creator
    • Atomic Front End
Re: Front End that returns to itself from a game?
« Reply #3 on: January 16, 2009, 06:51:00 am »
Quote
As I see this have really not a credit feature or trying to detect that.

i agree, what i say  it is just i had integrated in the context of my Credit management routines.  Just have to check if , "as is", it is usable without enabling  back the credit management.

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 227
  • Last login:November 19, 2018, 06:58:18 pm
Re: Front End that returns to itself from a game?
« Reply #4 on: January 16, 2009, 02:44:38 pm »
AtomicFE has this feature somewhere in his engine.

I had introduce that as part of my  credit management system in fact. There is parameter where you say "go back to the FE after XXXX secondes of inactivity" and you can also forbid the "manual" exit.  It was done in the goal to avoid user to exit the game accidently.

But as this feature is part on the credit management system that i can not distribute (mame team is against this feature) , i have to double check in my code if you can use it independly. Otherwise i would have to do a little modification to make it available.

Before i spend time in that,  have a quick look in AtomicFE 0.20 and let me know if you are ready to swith to AFE if i make this feature accessible.  If you prefer stay with Mala , i will postpone the modification later.

therefore, as i said,  may be i don't need to modify it ,  the feature could be already accessible. Just have to check. (will look this week end)



That would be great Youki! Thanks for the hopeful response :)

For AFE, the front end looks great! I'll have to check it out to see how easy it is to set up with different emulators. I'm currently running nothing on MAME yet, Final Burn Alpha runs my SFIII:3s, and Daphne for (Dragon's Lair 1/2, Space Ace). All of my games are set to Free Play so no credits are inserted.

Unfortunately I'm going to be out of town this weekend so I can't get into seeing how to reconfigure for AFE from Mala quite yet. If you're able to make a standalone application this weekend that presses "escape" after 5 minutes of inactivity (just once until there is another input... otherwise the monitor never sleeps due to repeated esc's >_<) I'd be very grateful and donate $40 for it :D

 :cheers:

youki

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1612
  • Last login:November 19, 2016, 01:07:33 pm
  • Atomic Front End Creator
    • Atomic Front End
Re: Front End that returns to itself from a game?
« Reply #5 on: January 16, 2009, 03:11:40 pm »
I have quickly checked and unfortunaly it is too dependent of my credit management engine.

I will have to make a special developpement for you.

Unfortunaly i don't have time this week end.  :(




brian_hoffman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 131
  • Last login:July 02, 2011, 09:02:20 pm
Re: Front End that returns to itself from a game?
« Reply #6 on: January 18, 2009, 07:43:30 pm »
I had a little time.

What this app does. Waits the specified amount of time (in minutes) then closes any running processes(specified) after in-activity.

Why would you want this app? Lets say you have a MAME cab and a person starts a game and walks away.. Normally the game stays playing (forever). With this app it will close the emulator proceess after X amount of in-activity time. Thus bringing you back to the FE.


Download the Timer.zip
Extract the archive anywhere. Id copy the files into your FE root directory.

Edit the Watcher.INI , In the INI you can adjust the TIMER (in minutes) and in the emulators section add the process name to listen for. Eg.. MAME  you do not need to add the file extention.. EG do not use MAME.exe

Currently this will work for MOST but not ALL users. This app will hook only mouse and keystrokes.. So if your using a gamepad this app is not reccommended as you will exit your game un-intentionally.

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 227
  • Last login:November 19, 2018, 06:58:18 pm
Re: Front End that returns to itself from a game?
« Reply #7 on: January 19, 2009, 01:19:27 am »
Brian and Youki,

I just got home from my friend's bachelor party over the weekend.
Thank you both for the software effort on this problem! I really appreciate it. :)


I had a little time.

What this app does. Waits the specified amount of time (in minutes) then closes any running processes(specified) after in-activity.

Why would you want this app? Lets say you have a MAME cab and a person starts a game and walks away.. Normally the game stays playing (forever). With this app it will close the emulator proceess after X amount of in-activity time. Thus bringing you back to the FE.


Download the Timer.zip
Extract the archive anywhere. Id copy the files into your FE root directory.

Edit the Watcher.INI , In the INI you can adjust the TIMER (in minutes) and in the emulators section add the process name to listen for. Eg.. MAME  you do not need to add the file extention.. EG do not use MAME.exe

Currently this will work for MOST but not ALL users. This app will hook only mouse and keystrokes.. So if your using a gamepad this app is not reccommended as you will exit your game un-intentionally.

Brian,

I tested it out on my system at home here and it worked flawlessly. I tested it out at 1 minute and 2 minutes and ran mame, final burn alpha, and daphne. It worked with all three and afterwards it gave focus back to Mala so you could select another game. Additionally, after Mala was returned to, the power saving timer started for the monitor!

I'm using a J-Pac on my Mame machine (no gamepads) and I'll install it on Tuesday. This looks like a perfect solution for me.

PM me if you're interested in the donation promised (via Paypal), thanks a million Brian!  :applaud:

My only question is, what does "Suspend Hotkeys" do for the options when right clicking the tray icon?

Thanks again!
« Last Edit: January 19, 2009, 01:23:01 am by kagaden »

Space Fractal

  • Wiki Master
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1887
  • Last login:April 10, 2013, 05:07:30 pm
  • Space Fractal
    • Space Fractal
Re: Front End that returns to itself from a game?
« Reply #8 on: January 19, 2009, 02:23:01 am »
Is the application just a script? anyway, I think it can been added to the utility page to the wiki.

If people use gameport controller like me, XPadder can property been used, so it still can been used.
Currectly in work: Greedy Mouse || Previous Work: MultiFE Frontend, ArcadeMusicBox Jukebox || Music for various games (Tardis.dk + Greatflash.co.uk).

brian_hoffman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 131
  • Last login:July 02, 2011, 09:02:20 pm
Re: Front End that returns to itself from a game?
« Reply #9 on: January 19, 2009, 11:40:08 am »
Glad you guys liked the app. Actually it is a autohotkey script compiled to exe.
The whole right click and suspend just stops the script. I don't need the donation but thanks. I just wanted to help :)
« Last Edit: January 19, 2009, 11:53:19 am by brian_hoffman »

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 227
  • Last login:November 19, 2018, 06:58:18 pm
Re: Front End that returns to itself from a game?
« Reply #10 on: January 19, 2009, 08:14:14 pm »
Glad you guys liked the app. Actually it is a autohotkey script compiled to exe.
The whole right click and suspend just stops the script. I don't need the donation but thanks. I just wanted to help :)

You totally rock Brian. Thanks again man. I'll post back with the results this week of how it worked on the cab over an extended period of time.

brian_hoffman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 131
  • Last login:July 02, 2011, 09:02:20 pm
Re: Front End that returns to itself from a game?
« Reply #11 on: January 19, 2009, 09:39:49 pm »
Glad you guys liked the app. Actually it is a autohotkey script compiled to exe.
The whole right click and suspend just stops the script. I don't need the donation but thanks. I just wanted to help :)

You totally rock Brian. Thanks again man. I'll post back with the results this week of how it worked on the cab over an extended period of time.

I'd really appreciate that. Thanks :cheers:

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 227
  • Last login:November 19, 2018, 06:58:18 pm
Re: Front End that returns to itself from a game?
« Reply #12 on: January 23, 2009, 02:09:58 am »
Hi Brian,

I've been running your excellent idle app for several days now as a normal application without any issue at all.

Since my Mala is shelled, today I attempted to make it autoboot as a service using the RunAsSvc application listed on the wiki. Doing this did reveal a potential bug, here are the steps to reproduce it.

Summary: Running HyperAttract.exe as a service with RunAsSvc will cause HyperAttract to always exit a game on launch after it closes the first instance.

1. Download HyperAttract.exe and RunAsSvc.exe onto your computer.
2. Run RunAsSvc.exe.
3. Fill in any name field and description.
4. Fill in the correct HyperAttract.exe file path.
5. Click "Ok".
6. Reboot your computer.
7. Launch a game in any emulator being watched by HyperAttract.
8. Wait the specified amount of time for HyperAttract to kill the process.
9. Attempt to again launch a game in any emulator being watched by HyperAttract.
10. ---> HyperAttract will kill the process after 1 second while loading.

Let me know if you'd like me to test anything for you, I'd be more than happy to.  :notworthy: Otherwise, I'll simply continue launching the application manually upon reboot as a normal application instead of a service. Unfortunately, since explorer is shelled and doesn't load, it also doesn't run typical Startup applications.

brian_hoffman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 131
  • Last login:July 02, 2011, 09:02:20 pm
Re: Front End that returns to itself from a game?
« Reply #13 on: January 23, 2009, 01:32:46 pm »
OH noes.... Bugs!!!!! Ahhhhh....

Lol... Ok Im done. Im not sure why it is doing that. I will look into that for sure.

In the mean time many FE's have the option to "launch on startup" This is what I have been doing to load the hyperattract.exe upon boot as I didn't think of making it a service.

Does Mala have this type feature? If so it would solve your issues.. If not I may have some time this weekend to adjust the script.

Thanks so much for testing. I really appreciate the feedback and with over 10 downloads and no complaints Id say its pretty successful.

If you are farmiliar with AHK I can give you the source its not much.

Otherwise just let me know..

DeLuSioNal29

  • Global Moderator
  • Trade Count: (+6)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 4735
  • Last login:June 16, 2019, 01:39:21 am
  • Build the impossible -"There is no Spoon"
    • DeLuSioNaL's YouTube Videos
Re: Front End that returns to itself from a game?
« Reply #14 on: January 23, 2009, 02:15:27 pm »
FYI,

Maximus Arcade has this feature built in as well.

~ DeLuSioNaL
Stop by my Youtube channel and leave a comment:

protokatie

  • I DO try to be insulting and horrible to my fellow Terran
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1396
  • Last login:March 27, 2012, 09:36:43 pm
  • Is anyone here a member of team retard?
Re: Front End that returns to itself from a game?
« Reply #15 on: January 23, 2009, 11:09:38 pm »
Neat proggy Brian! I may have a use for it in the future. BTW, as I have made some simple autohotkey scripts before, is there any way you could post the source for it? Some people may want to make mods to it for their own uses (possibly other than MAME based).
--- Yes I AM doing this on purpose, and yes I DO realize it is pissing you off.

---If my computers were cats, my place would look like an old widows house, with half of the cats having obvious health problems

brian_hoffman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 131
  • Last login:July 02, 2011, 09:02:20 pm
Re: Front End that returns to itself from a game?
« Reply #16 on: January 24, 2009, 02:27:52 am »
Neat proggy Brian! I may have a use for it in the future. BTW, as I have made some simple autohotkey scripts before, is there any way you could post the source for it? Some people may want to make mods to it for their own uses (possibly other than MAME based).
This will kill just about anything. Notepad,mame what ever just add the process name in the ini.
Here is the code
#SingleInstance force
#persistent
#InstallKeybdHook
#InstallMouseHook
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

IniRead, wait, Watcher.ini, timer, time

IniRead, EMU1, Watcher.ini, emulator1, key
SetTimer, EMU1, 1000, 0
EMU1:
TimeIdle := A_TimeIdlePhysical // 60000
If TimeIdle >= %wait%
Process, Close, %EMU1%.exe

IniRead, EMU2, Watcher.ini, emulator2, key
SetTimer, EMU2, 1000, 0
EMU2:
TimeIdle := A_TimeIdlePhysical // 60000
If TimeIdle >= %wait%
Process, Close, %EMU2%.exe

IniRead, EMU3, Watcher.ini, emulator3, key
SetTimer, EMU3, 1000, 0
EMU3:
TimeIdle := A_TimeIdlePhysical // 60000
If TimeIdle >= %wait%
Process, Close, %EMU3%.exe

IniRead, EMU4, Watcher.ini, emulator4, key
SetTimer, EMU4, 1000, 0
EMU4:
TimeIdle := A_TimeIdlePhysical // 60000
If TimeIdle >= %wait%
Process, Close, %EMU4%.exe

IniRead, EMU5, Watcher.ini, emulator5, key
SetTimer, EMU5, 1000, 0
EMU5:
TimeIdle := A_TimeIdlePhysical // 60000
If TimeIdle >= %wait%
Process, Close, %EMU5%.exe

IniRead, EMU6, Watcher.ini, emulator6, key
SetTimer, EMU6, 1000, 0
EMU6:
TimeIdle := A_TimeIdlePhysical // 60000
If TimeIdle >= %wait%
Process, Close, %EMU6%.exe

IniRead, EMU7, Watcher.ini, emulator7, key
SetTimer, EMU7, 1000, 0
EMU7:
TimeIdle := A_TimeIdlePhysical // 60000
If TimeIdle >= %wait%
Process, Close, %EMU7%.exe



------
Contents of watcher.ini
;Configure Timer in minute intervals
;key is the process name. Do not add the file extention.. Eg.. EXE

[timer]
time=1

[Emulator1]
Key=mame


[Emulator2]
Key=zinc


[Emulator3]
Key=Value



[Emulator4]
Key=Value


[Emulator5]
Key=Value



[Emulator6]
Key=Value



[Emulator7]
Key=Value



kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 227
  • Last login:November 19, 2018, 06:58:18 pm
Re: Front End that returns to itself from a game?
« Reply #17 on: January 24, 2009, 06:29:11 pm »
OH noes.... Bugs!!!!! Ahhhhh....

Lol... Ok Im done. Im not sure why it is doing that. I will look into that for sure.

In the mean time many FE's have the option to "launch on startup" This is what I have been doing to load the hyperattract.exe upon boot as I didn't think of making it a service.

Does Mala have this type feature? If so it would solve your issues.. If not I may have some time this weekend to adjust the script.

Thanks so much for testing. I really appreciate the feedback and with over 10 downloads and no complaints Id say its pretty successful.

If you are farmiliar with AHK I can give you the source its not much.

Otherwise just let me know..

Hi Brian,

Unfortunately Mala doesn't appear to have a "run on startup" feature, only "run on exit".  I'm also very poor with programming and would probably make it worse before I could fix it :P It looks like the the idle timer is not resetting when it's a service like it does when it's run normally. I understand this bug may be something beyond your control in the code and more a bug in the includes for timers when run as a service?

In any case, I have no qualms running it manually while waiting for Mala to add programs on startup or eventually switching front ends. I just wanted to throw it out there incase anyone else ran into the same issue. Simply having the functionality available is a million times better than it was, I worry a lot less about the monitor being on for 10 hours at a time with no one playing it now.  :laugh:

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 227
  • Last login:November 19, 2018, 06:58:18 pm
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #18 on: January 24, 2009, 06:31:21 pm »
I changed the subject of the title to give a little more attention to the application for others who may be interested in it :D

protokatie

  • I DO try to be insulting and horrible to my fellow Terran
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1396
  • Last login:March 27, 2012, 09:36:43 pm
  • Is anyone here a member of team retard?
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #19 on: January 24, 2009, 09:42:28 pm »
About a year ago, I made the move from MALA to AtomicFE and havent looked back (Dont get me wrong, MALA is awesome and has support for plug-ins that atomic doesnt, its just that atomic suited my needs better).

That being said, I just tested out having atomic run HyperAttract upon the start of each game with the option to kill the program when the game exited. This is the only way to do it in atomic (there apparently isnt a "load xxx upon atomic start" option), but it worked well with my little test. The only thing that would be needed to test any further for this with atomic is to see if it works on a system that has atomic as its shell. I presume it would still work, as HA wouldnt be run as a service.
--- Yes I AM doing this on purpose, and yes I DO realize it is pissing you off.

---If my computers were cats, my place would look like an old widows house, with half of the cats having obvious health problems

TheShanMan

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1904
  • Last login:April 23, 2016, 02:55:21 pm
    • My Arcade (updated 1/30/13)
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #20 on: January 25, 2009, 02:20:20 am »
I would love this app if it could handle joystick input and if it could avoid exiting if a game is paused. My son ALWAYS leaves a game running when he's done and it kind of drives me nuts because otherwise it would go into standby after a half hour of non-use. But on the other hand occasionally if I'm playing a long game of Donkey Kong and have to stop for dinner or something, I'll pause it and come back an hour later. Wouldn't want my game killed in that case.

Can these scripts be extended with a dll? I could write a dll that would listen for when mame pauses or unpauses. Is it possible to build analog joystick support, and mouse support (for trackball/spinner games) into the script?
My Collection: Mame cab, 34 dedicated cabs, pin, skeeball, coin op air hockey table, and token machine (VAPS, pics at Arcade Crusade, updated 1/30/13 with Sprint 2, Centipede, and Bubbles)

Add Ambience to your mame cab setup

protokatie

  • I DO try to be insulting and horrible to my fellow Terran
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1396
  • Last login:March 27, 2012, 09:36:43 pm
  • Is anyone here a member of team retard?
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #21 on: January 25, 2009, 04:10:49 am »
@shanman, it IS possible to have a second autohotkey task running that is looking for specific keypresses and can be made to cause another autohotkey app to close (In this case it would be HyperAttract). I have written a few AHK scripts that started and stopped other AHK scripts. It wouldnt be too hard to make an AHK script that looked for your pause key and then terminated Hyperattract. I have the next few days off and will lok at it, but I bet brian would be able to do this much faster for you. (One of the primary reasons why I asked brian to submit his source was so I would be able to implement a second AHK script to get rid of HA when pause was hit)
--- Yes I AM doing this on purpose, and yes I DO realize it is pissing you off.

---If my computers were cats, my place would look like an old widows house, with half of the cats having obvious health problems

TheShanMan

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1904
  • Last login:April 23, 2016, 02:55:21 pm
    • My Arcade (updated 1/30/13)
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #22 on: January 25, 2009, 12:13:14 pm »
That would definitely not be reliable. What if pause is hit when the FE is active where it does nothing? I'd much rather it listen to mame say "game is paused" and "game is unpaused". No, it wouldn't work with other emulators, but I could live with not noticing paused games in other emulators.
My Collection: Mame cab, 34 dedicated cabs, pin, skeeball, coin op air hockey table, and token machine (VAPS, pics at Arcade Crusade, updated 1/30/13 with Sprint 2, Centipede, and Bubbles)

Add Ambience to your mame cab setup

brian_hoffman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 131
  • Last login:July 02, 2011, 09:02:20 pm
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #23 on: January 26, 2009, 12:48:53 pm »
I was thinking about this also for the AHK script I wrote. What I was thinking about doing was Define and "Pause key" So lets say Button P for arguments sake. When you press P not only will it Pause the emulator but Suspend the script and throw up a MSG Box saying that the script is paused then when you press the P again it un-pauses the game and closes the MSG box.

Now some games dont have pause thats why the MSG box is important.

kagaden,
  I do have a solution for you buddy.So as of now you are shelled to MALA.exe and Mala does not have a launch on start.

But if you shell to a diffrent app an AHK script that does this

Run, HyperAttract.exe
Run, Mala.exe

Not only will it run on startup without user interference but Mala will also load up.
So while it doesnt fix the "service" problem you get the same results.
If your interested let me know and Ill build it really quick.

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 227
  • Last login:November 19, 2018, 06:58:18 pm
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #24 on: January 27, 2009, 12:50:30 am »
I was thinking about this also for the AHK script I wrote. What I was thinking about doing was Define and "Pause key" So lets say Button P for arguments sake. When you press P not only will it Pause the emulator but Suspend the script and throw up a MSG Box saying that the script is paused then when you press the P again it un-pauses the game and closes the MSG box.

Now some games dont have pause thats why the MSG box is important.

kagaden,
  I do have a solution for you buddy.So as of now you are shelled to MALA.exe and Mala does not have a launch on start.

But if you shell to a diffrent app an AHK script that does this

Run, HyperAttract.exe
Run, Mala.exe

Not only will it run on startup without user interference but Mala will also load up.
So while it doesnt fix the "service" problem you get the same results.
If your interested let me know and Ill build it really quick.

Thanks Brian, I actually tinkered with the idea of putting it in a batch file like you mentioned and running it similarly. The only problem was I wasn't sure how windows would like a batch file being shelled, or if that's even possible. Your idea of putting it in an exe script sounds better, but TheShanMan pointed out to me that he created a "load on mala launch" plugin that's on the mala plugins page. I'm not sure how I missed it because I know I've been through there a couple times. I installed it today and everything appears to be working great :D

I'll let you know if anything else comes up with HyperAttract, but it looks really stable to me :) Thanks a million for it again, and TheShanMan for the plugin. If you need anything let me know, bout all I'm good for is testing hehe :D

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 227
  • Last login:November 19, 2018, 06:58:18 pm
Re: Front End that returns to itself from a game?
« Reply #25 on: February 03, 2009, 02:14:36 am »
Is the application just a script? anyway, I think it can been added to the utility page to the wiki.

If people use gameport controller like me, XPadder can property been used, so it still can been used.


Brian,

Would you like this application wiki'ed for others use? I think it's solid, I've been using it for an additional week without any issues.   ;D

Space Fractal,

It's a small program, is it possible to host it on the wiki as well, link it from the post attachment here, or would we need an external source?

-K
« Last Edit: February 03, 2009, 02:16:41 am by kagaden »

Space Fractal

  • Wiki Master
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1887
  • Last login:April 10, 2013, 05:07:30 pm
  • Space Fractal
    • Space Fractal
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #26 on: February 03, 2009, 02:31:58 am »
I dosent think it can upload files to the wiki, hence I just linked to this thread in the wiki. I think in your first post could post a direct link to the application:
http://forum.arcadecontrols.com/index.php?topic=88532.msg930117#msg930117

Currectly in work: Greedy Mouse || Previous Work: MultiFE Frontend, ArcadeMusicBox Jukebox || Music for various games (Tardis.dk + Greatflash.co.uk).

brian_hoffman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 131
  • Last login:July 02, 2011, 09:02:20 pm
Re: Front End that returns to itself from a game?
« Reply #27 on: February 03, 2009, 07:34:58 pm »
Is the application just a script? anyway, I think it can been added to the utility page to the wiki.

If people use gameport controller like me, XPadder can property been used, so it still can been used.


Brian,

Would you like this application wiki'ed for others use? I think it's solid, I've been using it for an additional week without any issues.   ;D

Space Fractal,

It's a small program, is it possible to host it on the wiki as well, link it from the post attachment here, or would we need an external source?

-K


I'd love it to be available to anyone who would like it. Thanks :) Im glad you are still finding it usefull  :cheers:

SpaceFractal,
 Thanks for taking the time to add this to the Wiki.

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 227
  • Last login:November 19, 2018, 06:58:18 pm
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #28 on: February 05, 2009, 03:22:03 am »
Awesome guys, I've hijacked my first post and added on the application and Brian's post with Brian's permission.

Thanks again Brian for the fantastic application :) It saves me about 18 hours a day of monitor energy, worry free!  :cheers:

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 227
  • Last login:November 19, 2018, 06:58:18 pm
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #29 on: December 06, 2009, 07:20:25 pm »
So I've switched over to gamepads (U360's) from keyboard encoding. As is mentioned in the thread, HyperAttract doesn't work anymore, it'll quit out of my games and then prevents further loading until it's given a keyboard/mouse hardware event. I tried getting around this by mapping my controls with Joy2Key, however that doesn't quite seem to pick up the same as a real hardware event. HyperAttract will still drop my game.

Is there any way in ahk to watch for input from gamepads? Is there any way I can tweak this script to work with them?

Thanks a million,

-K


SophT

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 45
  • Last login:March 13, 2014, 08:22:43 am
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #30 on: December 07, 2009, 06:45:36 pm »
ahk joypad keystrokes look like this:

joy1 (first joypad, button1)
2joy1 (second joypad, button1)
2joy2
2joy3 (etc..)

so you could define some hotkeys like

joy1::A
joy2::B
2joy1::C
2joy2::D

I would just try xPadder though.

TheShanMan

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1904
  • Last login:April 23, 2016, 02:55:21 pm
    • My Arcade (updated 1/30/13)
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #31 on: December 07, 2009, 06:55:22 pm »
What about analog joysticks? I would love to use this if it worked with joysticks (especially if I could get it to call a dll to check for mame being paused as I mentioned earlier in this thread).
My Collection: Mame cab, 34 dedicated cabs, pin, skeeball, coin op air hockey table, and token machine (VAPS, pics at Arcade Crusade, updated 1/30/13 with Sprint 2, Centipede, and Bubbles)

Add Ambience to your mame cab setup

brian_hoffman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 131
  • Last login:July 02, 2011, 09:02:20 pm
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #32 on: December 07, 2009, 07:53:37 pm »
Ill scour the AHK forums, at the time I wrote this script it could not hook gamepads.

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 227
  • Last login:November 19, 2018, 06:58:18 pm
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #33 on: December 07, 2009, 09:46:14 pm »
Thanks guys, especially Brian for coming back to this thread after all this time and for the original application :) I'm a scripting noob but I'm looking around for workarounds to this also. I'm willing to try Xpadder but I'm afraid it'll have the same problem as Joy2Key does and won't properly keep HyperAttract from closing out of games. It doesn't look like freeware so I'd like to try it (or hear of it being successful) before I buy it.

Watching the inputs on the buttons would ideally let you know if someone was not at the controls any longer... but maybe the screen not updating could potentially be another way? Though this get's a bit messy/unreliable with attract modes in arcade games. :( Are there any other ways to tell? Do USB's go idle or can you watch their packets perhaps, so if there are no packets it'd exit? Just throwing out a couple fairly bad alternate ideas here :P


protokatie

  • I DO try to be insulting and horrible to my fellow Terran
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1396
  • Last login:March 27, 2012, 09:36:43 pm
  • Is anyone here a member of team retard?
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #34 on: December 07, 2009, 11:46:11 pm »
This is one of my radical idea replies, but if worse comes to worse, you could have a cheap radioshack proximity sensor detect if someone was in front of the machine. Basically, have the sensor hooked up to a sprung relay that went to a keyboard controller. If it detected someone there, it would hold down on a button not used by MAME, and when they went away, the relay would switch off and your AHK/HA script could do its work.

Just in case you can't find a software solution. (Also, added new thought, a pressure plate in front of the cab that tells a relay to provide power to the monitor.. OK, even that one is too rediculous for me....)
--- Yes I AM doing this on purpose, and yes I DO realize it is pissing you off.

---If my computers were cats, my place would look like an old widows house, with half of the cats having obvious health problems

brian_hoffman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 131
  • Last login:July 02, 2011, 09:02:20 pm
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #35 on: December 09, 2009, 01:14:54 pm »

Ha, those are interesting ideas, I think a better idea may simply be to use the IPAC for the buttons and the U360s for the joystick, obviously if your using the sticks your using the buttons to, so the program would still work.

Obviously a software solution would be best, it appears AHK still cannot hook gamepad and writing or calling a DLL is outside my scope of knowledge.

With all that said, I have an older version of Xpadder before they went commercial that is free. Id be more than happy to share, unless it is against forum rules.

Brian Hoffman

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 227
  • Last login:November 19, 2018, 06:58:18 pm
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #36 on: December 09, 2009, 03:10:54 pm »
I'd use the Jpac, but it's actually been pretty horrible for buttons so far. There's a problem where pressing 3x punch or kick buttons was throwing out a random punch/kick before the 3x use. The buttons would also wig out every once in awhile or simply stop responding until the emulator was reset which was rather annoying. I'd prefer not to use keyboard encoding further because of those past experiences.

If you could pm me about xpadder that'd be great. I'll use it as a trial and if it works I'll definitely purchase it for updated versions :)

Thanks again Brian,
-K

kagaden

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 227
  • Last login:November 19, 2018, 06:58:18 pm
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #37 on: December 09, 2009, 03:22:01 pm »
If AHK can see gamepad inputs, would it be possible to run a loop with a timer that was reset each time one of those gamepad inputs were pressed? Or can AHK not see gamepad inputs at all when they're pressed? If possible I'd like to do it manually even though it doesn't have a hook library (or is that required?) :(.

brian_hoffman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 131
  • Last login:July 02, 2011, 09:02:20 pm
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #38 on: December 09, 2009, 05:23:11 pm »
If AHK can see gamepad inputs, would it be possible to run a loop with a timer that was reset each time one of those gamepad inputs were pressed? Or can AHK not see gamepad inputs at all when they're pressed? If possible I'd like to do it manually even though it doesn't have a hook library (or is that required?) :(.

NOW THAT!........ Is a great idea.
AHK can see joypad input. You have my code, If you want to edit it go ahead, Im trying to wrap my head around my finals that are due this weekend.

Joy5::
Run Notepad
WinWait Untitled - Notepad
WinActivate
Send This is the text that will appear in Notepad.{Enter}
return


:Joy1 through Joy32: The buttons of the joystick. To help determine the button numbers for your joystick, use this test script. Note that hotkey prefix symbols such as ^ (control) and + (shift) are not supported (though GetKeyState can be used as a substitute). Also note that the pressing of joystick buttons always "passes through" to the active window if that window is designed to detect the pressing of joystick buttons.

OR
I just read this, I use A_TimeIdlePhysical ,  perhaps changing that to A_timeidle can make it work with joysticks, as the description states "keyboard, mouse, or other input." That can also explain why joytokey didnt work either.

A_TimeIdle    The number of milliseconds that have elapsed since the system last received keyboard, mouse, or other input. This is useful for determining whether the user is away. This variable will be blank unless the operating system is Windows 2000, XP, or beyond. Physical input from the user as well as artificial input generated by any program or script (such as the Send or MouseMove commands) will reset this value back to zero. Since this value tends to increase by increments of 10, do not check whether it is equal to another value. Instead, check whether it is greater or less than another value. For example: IfGreater, A_TimeIdle, 600000, MsgBox, The last keyboard or mouse activity was at least 10 minutes ago.

A_TimeIdlePhysical    
Similar to above but ignores artificial keystrokes and/or mouse clicks whenever the corresponding hook (keyboard or mouse) is installed; that is, it responds only to physical events. (This prevents simulated keystrokes and mouse clicks from falsely indicating that a user is present.) If neither hook is installed, this variable is equivalent to A_TimeIdle. If only one hook is installed, only its type of physical input affects A_TimeIdlePhysical (the other/non-installed hook's input, both physical and artificial, has no effect).

Try the new EXE I attached, put it in the same folder as the other one. Make sure the other one is not running. At the very least joytokey should reset the timer. This ZIP does NOT include a watcher.ini . Once feedback is recieve and it works well we can put a new package together. For users that want to try this version that have not tried the first, please be sure to grab it for the needed ini from the first download. Thanks.

Kadagen: I see you live in the OC, I live in Riverside, perhaps we can have a beer sometime.
« Last Edit: December 09, 2009, 06:09:34 pm by brian_hoffman »

brian_hoffman

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 131
  • Last login:July 02, 2011, 09:02:20 pm
Re: HyperAttract - Program that exits an emulator after specified idle time.
« Reply #39 on: December 09, 2009, 05:41:29 pm »
Dupe post, *sorry*