Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

This script is a way of storing credits between games... basically I have a coin counter connected to my coin validator and my machine set at 10p a go so if I insert 20p I get 2 credits, 50p I get 5 credits and so forth...

This is all well and good but if I've inserted a pound and after a couple of credits I decide to play something else then those remaining credits are lost... "The horror!" I hear you shout :) I know I could just open the door and get my money back but I was bored in work today so I came up with this solution...

What it does is when the coin is inserted the credit is registered and stored in the AHK script and then I have an activate credit key set on my control panel (which is also the button I use for BACK in GameEx) so I can now stick as many credits as I like in and change games without fear of ripping myself off :)

My future plan is to use something like the LED-Wiz so that when the machine is in credit the coin mech lights will light up and when your out of credit they'll go off but I don't have an LED-Wiz at the moment

I think this might be handy for people with kids as you could just fire in a few credits for them and let them batter on, you don't need a coin counter as the script will store credit from any mech

I have replaced the key assigned to my coin input on my Ipac to control and 5 rather than 5 and I'm using control and 7 for the activate credit button, the script then changes these to 5 and 7 at the correct times, so you still keep MAME as 5 for inserting credit and I set GameEx to use 7 as previous screen


#NoTrayIcon ;you may want to remove this line till eveything is working
#SingleInstance force
SetKeyDelay, 20, 20 ;mame needs this set or keys aren't regestered from ahk

^5:: ;store inserted credits
credits++
return

#IfWinNotActive, GameEx
^7:: ;if there are credits in the bank 5 will be sent if not 7 will be sent
if credits > 0
{
send 5 ;send the credit to game
credits-- ;subtract it from the credit bank
return
}
else
{
send 7 ;if there's no credits left send 7 instead
return
}

#IfWinActive, GameEx
^7:: ;in GameEx 7 will always be sent as there's no need to activate credits
send 7
return

Hope someone gets some use out of my boredome :)

Stu

Posted

I love this idea! If you could get it to work with an LED (like a two digit counter) I'd be all about this! Does it work for emulators as well?

*I'm sick of my friends hanging out all the time and drinking up all my beer (not to mention puffin my... Um... Nevermind!) This is a great way to recoup some of the cost. ;)

Posted

my plan was to have a row of say 10 leds to show your last 10 credits which would then go out 1 at a time as you use the credits, I think this could be easily done with the led wiz... I took a look for a digit display but I can't find any that come with a kit and I don't know enough about electronics to try and wire 1 up... I had the script turning on the keyboard LEDs yesterday... I thought that might be enough to power a relay that could in turn switch on and off the the lights behind the coin mech but it there wasn't enough power to switch the 5v relay I had at home :( do you get lower powered relay? I can only find 5v or 12v

At the min it only works for Mame, Zinc and probably Model 2... it should work for any emu that has an insert coin button set to 5 like Mame... I'm not sure how I would go about making it work in other emulators as they don't have credit buttons... what about a timmer and if you add credit it would add 5 mins or what ever on to the timer. If the timmer reaches zero the script would send the escape key taking you back to GameEx? The problem I see is letting the user know their time is almost up without a display of some sort

Guest
This topic is now closed to further replies.
×
×
  • Create New...