PDA

View Full Version : Script question



SuburbanNoize767
08-02-2011, 10:06 PM
I am trying to figure out if there is a way for me to make a HL script that will essentially hold f2 during the start of a game to activate the eeprom.

Hypnoziz
08-02-2011, 10:13 PM
You can try:

Send, {F2 down}
Sleep, 1000
Send, {F2 up}
Adjust sleep timer to your needs. 1000=1 second.

Or try:

Loop X
{
Send, {F2}
Sleep, 50
}
Adjust X to the number of times you would like F2 pressed during the launch of the game.

SuburbanNoize767
08-02-2011, 10:47 PM
Thanks I'll give that a shot! I am trying to automate the Simpsons Bowling issue.

SuburbanNoize767
08-04-2011, 08:41 PM
I am having trouble coming up with a way of adding the script specific to one game. Do I add that to the HL.ahk? And if so what would the entry look like?

Sorry I am kind of new to all the scripting. Thanks in advance!

Hypnoziz
08-04-2011, 10:10 PM
Are you using HyperLaunch 2.0?

SuburbanNoize767
08-05-2011, 10:35 AM
Are you using HyperLaunch 2.0?

Yes

Hypnoziz
08-05-2011, 10:40 AM
Go to the Module script for that emulator and you can use:

(Taken from the MAME Module):

Run, %executable% %romName%, %emuPath%, Hide UseErrorLevel

if (%romName% = "simpbowl")
{
Send, {F2 Down}
Sleep, 1000
Send, {F2 Up}
}

Process, WaitClose, %executable%

if(ErrorLevel != 0){
if (ErrorLevel = 1){
Error = Failed Validity
}else if(ErrorLevel = 2){
Error = Missing Files
}else if(ErrorLevel = 3){
Error = Fatal Error
}else if(ErrorLevel = 4){
Error = Device Error
}else if(ErrorLevel = 5){
Error = Game Does Not Exist
}else if(ErrorLevel = 6){
Error = Invalid Config
}else if(ErrorLevel = 7 || ErrorLevel = 8 || ErrorLevel = 9){
Error = Identification Error
}else{
Error = Mame Error
}
MsgBox Mame Error - %Error%
}

ExitApp

CloseProcess:
return

SuburbanNoize767
08-05-2011, 08:28 PM
Go to the Module script for that emulator and you can use:

(Taken from the MAME Module):

Run, %executable% %romName%, %emuPath%, Hide UseErrorLevel

if (%romName% = "simpbowl")
{
Send, {F2 Down}
Sleep, 1000
Send, {F2 Up}
}

Process, WaitClose, %executable%

if(ErrorLevel != 0){
if (ErrorLevel = 1){
Error = Failed Validity
}else if(ErrorLevel = 2){
Error = Missing Files
}else if(ErrorLevel = 3){
Error = Fatal Error
}else if(ErrorLevel = 4){
Error = Device Error
}else if(ErrorLevel = 5){
Error = Game Does Not Exist
}else if(ErrorLevel = 6){
Error = Invalid Config
}else if(ErrorLevel = 7 || ErrorLevel = 8 || ErrorLevel = 9){
Error = Identification Error
}else{
Error = Mame Error
}
MsgBox Mame Error - %Error%
}

ExitApp

CloseProcess:
return

I tried using this script exactly and even changed the sleep time to sleep for 20 seconds and it still wont stop it from failing.

Hypnoziz
08-05-2011, 08:40 PM
if (%romName% = "simpbowl")
{
Send, {F2 Down}
Sleep, 1000
Send, {F3}
Sleep, 2000
Send, {F2 Up}
}
Try that one. Adjust the sleep timers here as well. Specifically the sleep timer after the "Send, {F3}" command.

SuburbanNoize767
08-05-2011, 08:46 PM
Run, %executable% %romName%, %emuPath%, Hide UseErrorLevel

if (%romName% = "simpbowl")
{
Send, {F2 Down}
Sleep, 5000
Send, {F3}
Sleep, 100000
Send, {F2 Up}
}

Process, WaitClose, %executable%

if(ErrorLevel != 0){
if (ErrorLevel = 1){
Error = Failed Validity
}else if(ErrorLevel = 2){
Error = Missing Files
}else if(ErrorLevel = 3){
Error = Fatal Error
}else if(ErrorLevel = 4){
Error = Device Error
}else if(ErrorLevel = 5){
Error = Game Does Not Exist
}else if(ErrorLevel = 6){
Error = Invalid Config
}else if(ErrorLevel = 7 || ErrorLevel = 8 || ErrorLevel = 9){
Error = Identification Error
}else{
Error = Mame Error
}
MsgBox Mame Error - %Error%
}

ExitApp

;Required
CloseProcess:
;Doesnt have to do anything but make sure to have the line before and after this line.
return


Thats what mine looks like right now and it isnt sending the f3 so I have to imagine that it isnt sending the f2 either

Been trying to troubleshoot it today and I cant seem to get the script to send any button presses in the context of the if statement.