The NEW Build Your Own Arcade Controls
Main => Software Forum => Topic started by: Connorsdad on December 01, 2013, 06:26:47 am
-
I want to add a script that will stop my monitor from rotating when a key is pressed, just in case my micro switches fail. I think the coin buttons would be a good idea as they are on the front of my cp and I could press them in a millisecond if things went wrong. What I have so far, please go easy as I am a complete noob re ahk.
5::
run smccmd --resume --speed 0,,Hide
send {5 down}{5 up}
return
6::
run smccmd --resume --speed 0,,Hide
send {6 down}{6 up}
return
I think that the {key down}{key up} is telling the script to restart instead of doing what I want which is pressing 5 to insert a coin, as in 5::5. Any help is much appreciated.
-
I'm quite new to AHK but the following might work?
5::
run, smccmd --stop, Hide
send, {5 down}
Send, {5 up}
return
6::
run, smccmd --stop, Hide
send, {6 down}
send, {6 up}
return
-
5::
run smccmd --resume --speed 0,,Hide
send, {5 down}
Send, {5 up}
return
6::
run smccmd --resume --speed 0,,Hide
send, {6 down}
send, {6 up}
return
Thanks but that didn't work either
-
Oh bugger. Hmm.
How about SendInput, {6 down}{6 up}? Is the motor stopping part of the code working but it's not sending the keystrokes? As i understand it you're wanting the keys 5 and 6 to be kind of "pass through" keys, you press them and want them to function normally but you also want them to send the motor stop command?
Also, are you the awesome guy who does a lot of charity work for your son? I follow your builds on OCuK.
-
Thats correct I do want them to work as pass through keys :)
Awesome guy yes ;)
But not the one from OCuK.
-
I've worked it out. The script is kind of getting into an endless loop.
What's happening is you are monitoring key 5. When you press 5, the script also presses 5. When 5 is pressed, the script presses 5 again.
Hope this helps, you may need to rebind some keys!
-
I know but I don't how to alter the script to get it to do what I want.
Sent from my SM-N9005 using Tapatalk
-
in MAME bind coin1 and coin2 to something else, e.g N and M
5::
run smccmd --resume --speed 0,,Hide
send, {N down}
Send, {N up}
return
6::
run smccmd --resume --speed 0,,Hide
send, {M down}
send, {M up}
return
-
I have 5 and 6 set for quite a few emulators, would be a mare to change. I'll sort it one way :)
Sent from my SM-N9005 using Tapatalk
-
But I could change the ipac config to something else then send 5 and 6. Hmmmmm
Sent from my SM-N9005 using Tapatalk
-
Sussed it :)
From the AutoHotKey help:
"($) This is usually only necessary if the script uses the Send command to send the keys that comprise the hotkey itself, which might otherwise cause it to trigger itself."
$5::
run smccmd --resume --speed 0,,Hide
send, {5 down}
Send, {5 up}
return
$6::
run smccmd --resume --speed 0,,Hide
send, {6 down}
send, {6 up}
return
-
Wahey, ahk is awesome. Just like you are. You got a cabinet build log out anything? Also, what motor do you use? I have a rotating set up too and now you've got me all paranoid
Sent from my GT-I9505G using Tapatalk
-
Just seen your WIP pictures, wow. I loved griff's Marvel vs Capcom Revolution and wanted to replicate it myself, alas my small house ended up being the limiting factor. I ended up going for a much smaller foot print build. Do you have the MAME auto-rotation scripts sorted? i wrote a number of things you might find useful: A marquee changing script and i made my own auto-rotation script as the one i was using was a bit buggy (for instance, it would rotate Mortal Kombat) as it used a string comparison, e.g the romname for mortal kombat is MK so it checked a large file for "MK" and if it found it, it rotates.
VID_20131106_090749.mp4 (http://www.youtube.com/watch?v=KMcufVFWh3s#) is a video showing the marquee stuff.
-
Loving the marquee monitor :)
I'm good for scripts thanks, I too have various scripts I made specifically for the different emulators I run. I also use the Mame rotation script from this forum which is great.
Sent from my SM-N9005 using Tapatalk
-
I think i tried the one from this forum which had the bug i mentioned in it. Is it a rotation.exe with a rotation.ini? rotation.ini has like set2_vertical= in it?
-
The one I used was created by DNA Dan and resident AHK guru, nitz. There's no bug, read from this post on to see what you need to add;
http://forum.arcadecontrols.com/index.php/topic,110471.msg1234270.html#msg1234270 (http://forum.arcadecontrols.com/index.php/topic,110471.msg1234270.html#msg1234270)
-
Ahh yeah, i never saw the lines to "fix" the certain roms. Anyhow, here's my version if you are interested. Doesn't use any work arounds. And here's the INI file:
http://pastebin.com/KAgJz3xK (http://pastebin.com/KAgJz3xK)
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
IniRead, RotcurrState, Rotation.ini, defaults, defrotate
IniRead, RotState, Rotation.ini, %1%, Rotate
if (RotState = 1) {
iniwrite, 1, Rotation.ini, defaults, defrotate
; Run, irotate.exe /rotate=90
ExitApp
}
Else {
if (RotcurrState = 1) {
; Run, irotate.exe /rotate=90
iniwrite, 0, Rotation.ini, defaults, defrotate
}
ExitApp
}
-
Sussed it :)
From the AutoHotKey help:
"($) This is usually only necessary if the script uses the Send command to send the keys that comprise the hotkey itself, which might otherwise cause it to trigger itself."
$5::
run smccmd --resume --speed 0,,Hide
send, {5 down}
Send, {5 up}
return
$6::
run smccmd --resume --speed 0,,Hide
send, {6 down}
send, {6 up}
return
Works fine with everything bar mame, coin buttons no longer register for certain games :(