Main > Main Forum
Accepting coins on PC games
<< < (2/2)
nitz:
One way to stop the game would be to take a snap of the screen after a game ends (assuming there is at least some portion of it that is the same everytime and doesn't appear throughout the game) and cut out the unique portion of it such as the words "game over" and save it to a bmp file. You could have autohotkey continuously search for that image and when it finds it, it disables all keys unless the credit variable is still greater than 0.

I wouldn't mind writing this script for you as this would be pretty easy for me - it would probably take me like 5-10 minutes tops...
Nacimroc:
It would be fantastic if you could.  I have no games in mind at the minute though (although need for speed would be my ideal game).
nitz:
OK, I came up with this (attached) - it's really kinda more a template than anything, but it works and you should be able to figure out how you could modify it to fit any game. Download and install autohotkey if you haven't already, and change the file extension on credit.txt to credit.ahk. You'll want to take a look at it to see how it works and how you can make changes. It's set up so you can test it in Notepad!

Notes:
For now I assumed that you have the mame defaults for player 1, and didn't bother setting up for player 2, but you should be able to figure out what changes/additions you would need to make to set it up for your configuration. Also, I'm assuming you can set the controls in your game to whatever you want. Having the control key send "a" is really rather arbitrary. And if you're wondering why I don't just have control sending control, it's because this would cause control to be sent ad infinitum as each control that is sent tells the script to send another control! (There might be a workaround for this, but can't remember it ATM).

Also, I've got it set up to simply reset the coin count to 0 and disable all keys after 5 seconds of inactivity - of course you could set it to how ever much time you want. Setting up to decrease the coin count based on a game over image is a bit more complicated, but we'll go into it sometime if you think you want that.

Let me know what you think! :cheers:
Nacimroc:
Thanks for that. I think I can actually follow it. Will give it go and let you know!
Navigation
Message Index
Previous page

Go to full version