KyJelly Posted February 16, 2006 Share Posted February 16, 2006 i'm trying to convert this script to the new version but am having some problems. this is what i have so far: ; Script Version 81.a ; Script to run Project Tempest ver 0.9 ;[start all] runwait("pt.exe", "c:\emulators\jaguar\project tempest") WinActive("Project Tempest") mouseclick,("leftclick", 13, 60) mouseclick,("leftclick", 13, 80) WinActive("Open ROM File") paste,<rom> send("enter") WinActive("Project Tempest") ; Start the game (F2). send("F2") ;[Full Screen] send("Esc") ;[tidy up] waitforhotkey,Esc ; Stop the game - F3. send("F3") ; Close Project Tempest. WinClose("Project Tempest") i think paste is all i need to convert. also i'll be passing via command line the location of the rom, so i'm guessing <rom> is how i use it? if i wanted to pass 2 paramaters for instance making the run function acccept a location and also pasting the rom param how would i do that? if you could help me i'de be very greatful Link to comment Share on other sites More sharing options...
KyJelly Posted February 16, 2006 Author Share Posted February 16, 2006 (edited) here is after some other work i've done but it's still not right.bold lines are the trouble areas; Script Version 81.a; Script to run Project Tempest ver 0.9;[start all]run($CmdLine[1])WinwaitActive("Project Tempest")mouseclick("leftclick", 13, 60)mouseclick("leftclick", 13, 80)WinActive("Open ROM File")send($CmdLine[2], 1)send("{enter}")WinwaitActive("Project Tempest"); Start the game (F2).send("{F2}");[Full Screen]send("{Esc}");[tidy up]; Stop the game - F3.hotkeyset("{esc}", send("{f3}")); Close Project Tempest.WinClose("Project Tempest") Edited February 16, 2006 by KyJelly Link to comment Share on other sites More sharing options...
ChrisL Posted February 16, 2006 Share Posted February 16, 2006 What is your $CMDLine? I don't think you can use that as a variable name as it's reserved for AutoIT hotkeyset("{esc}", "sendKey") Func sendKey() Send ("{F3}") Endfunc here is after some other work i've done but it's still not right.bold lines are the trouble areas ; Script Version 81.a ; Script to run Project Tempest ver 0.9 ;[start all] run($CmdLine[1]) WinwaitActive("Project Tempest") mouseclick("leftclick", 13, 60) mouseclick("leftclick", 13, 80) WinActive("Open ROM File") send($CmdLine[2], 1) send("{enter}") WinwaitActive("Project Tempest") ; Start the game (F2). send("{F2}") ;[Full Screen] send("{Esc}") ;[tidy up] ; Stop the game - F3. hotkeyset("{esc}", send("{f3}")) ; Close Project Tempest. WinClose("Project Tempest") [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
ChrisL Posted February 16, 2006 Share Posted February 16, 2006 (edited) If your calling the compiled application from the command line with 2 arguments Like "MyProgram.exe Notepad 7" then... If $cmdline[0] = 2 Then $Var1 = $cmdline[1] $Var2 = $cmdline[2] EndIf ;[start all] hotkeyset("{esc}", "sendKey"); << Calls sendKey Function at the bottom run($var1) WinwaitActive("Project Tempest") mouseclick("leftclick", 13, 60) mouseclick("leftclick", 13, 80) WinActive("Open ROM File") send($var2, 1) send("{enter}") WinwaitActive("Project Tempest") ; Start the game (F2). send("{F2}") ;[Full Screen] send("{Esc}") ;[tidy up] ; Stop the game - F3. ; Close Project Tempest. Func sendKey() Send ("{F3}") WinClose("Project Tempest"); <<I'm guessing this should be part of your hotkey function? Endfunc Edited February 16, 2006 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
KyJelly Posted February 16, 2006 Author Share Posted February 16, 2006 (edited) the syntax will be similar to this jagscript.exe "c:\emulators\jaguar\project tempest\pt.exe" "c:\emulators\jaguar\roms\rom.jag" so i want to pass the executable to the first one and the rom name to the second one. the second one will be pasted into a text box. Edited February 16, 2006 by KyJelly Link to comment Share on other sites More sharing options...
ChrisL Posted February 16, 2006 Share Posted February 16, 2006 the syntax will be similar to thisjagscript.exe "c:\emulators\jaguar\project tempest\pt.exe" "c:\emulators\jaguar\roms\rom.jag"so i want to pass the executable to the first one and the rom name to the second one.the second one will be pasted into a text box.OK as above then, I moved the winClose into the sendKey func as I guess you want it to close the window after the F3 key to close [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
KyJelly Posted February 16, 2006 Author Share Posted February 16, 2006 OK as above then, I moved the winClose into the sendKey func as I guess you want it to close the window after the F3 key to closeit really wouldn't matter would it? Link to comment Share on other sites More sharing options...
ChrisL Posted February 16, 2006 Share Posted February 16, 2006 the thing is, this script is just going to run through once then close, is that what you want it to do or is it part of something bigger? If its part of something bigger and the script does other stuff and stays running until you press esc and you want the other window/game/application to stay open then yes it does matter because it would get to the line and close the window. [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
KyJelly Posted February 16, 2006 Author Share Posted February 16, 2006 it just runs once through do i need to declare the variables? i'm getting an error about that, but i'm not passing any cmdlines yet either Link to comment Share on other sites More sharing options...
ChrisL Posted February 16, 2006 Share Posted February 16, 2006 it just runs once through do i need to declare the variables? i'm getting an error about that, but i'm not passing any cmdlines yet either If your not passing any variables via cmdline then yes, declare them above the If $cmdline[0] = 2 Then line So set the path when you declare them, but if you pass it a CMDline it will change them to the new values. If this runs through once then exits why do you need the hotkey, surely its never going to get to it [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
KyJelly Posted February 16, 2006 Author Share Posted February 16, 2006 good question i guess i really dont need it so with my example var1=c:\emulators\jaguar\project tempest\pt.exe var2=c:\emulators\jaguar\roms\rom.jag ??? Link to comment Share on other sites More sharing options...
ChrisL Posted February 16, 2006 Share Posted February 16, 2006 (edited) I would have thought this is what you were aiming for, it will run through then sit there and wait for you to press esc, then send F3 and close the window.. or have \i got what your trying to do totally arse about face? Edit* Should this be winwaitactive? WinActive("Open ROM File") expandcollapse popup$Var1="c:\emulators\jaguar\project tempest\pt.exe" $Var2="c:\emulators\jaguar\roms\rom.jag" If $cmdline[0] = 2 Then $Var1 = $cmdline[1] $Var2 = $cmdline[2] EndIf ;[start all] hotkeyset("{esc}", "sendKey"); << Calls sendKey Function at the bottom run($var1) WinwaitActive("Project Tempest") mouseclick("leftclick", 13, 60) mouseclick("leftclick", 13, 80) WinActive("Open ROM File") send($var2, 1) send("{enter}") WinwaitActive("Project Tempest") ; Start the game (F2). send("{F2}") ;[Full Screen] send("{Esc}") While 1 Sleep (1000); Idle around waiting for you to press esc to tidy up Wend ;[tidy up] ; Stop the game - F3. ; Close Project Tempest. Func sendKey() Send ("{F3}") WinClose("Project Tempest"); <<I'm guessing this should be part of your hotkey function? Endfunc Edited February 16, 2006 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
KyJelly Posted February 16, 2006 Author Share Posted February 16, 2006 i need it to close the app after hitting the esc key esc in the app minimizes ans f3 stops emulation Link to comment Share on other sites More sharing options...
ChrisL Posted February 16, 2006 Share Posted February 16, 2006 i need it to close the app after hitting the esc keyesc in the app minimizes ans f3 stops emulationGive the above a go, and also look at the edit about winwaitactive! [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
KyJelly Posted February 16, 2006 Author Share Posted February 16, 2006 (edited) well the mouse click function isn't working because the app keeps opening in different places!!! is there a way to open the "file" menu then select another item in it called "open rom..." then do my text paste? maybe something with...WinMenuSelectItem("project tempest", "", "&File", "open rom..." ) ? Edited February 16, 2006 by KyJelly Link to comment Share on other sites More sharing options...
KyJelly Posted February 16, 2006 Author Share Posted February 16, 2006 yes! i got it: if $cmdline[0] = 2 Then $Var1 = $cmdline[1] $Var2 = $cmdline[2] EndIf ;[start all] hotkeyset("{esc}", "sendKey") run($var1) WinwaitActive("Project Tempest") send("!f") send("{enter}") WinActive("Open ROM File") send($var2, 1) send("{enter}") WinwaitActive("Project Tempest") ; Start the game (F2). send("{F2}") While 1 Sleep (1000) Wend ;[tidy up] ; Stop the game - F3. ; Close Project Tempest. Func sendKey() Send ("{F3}") WinClose("Project Tempest") Endfunc thanks so much for your help ChrisL Link to comment Share on other sites More sharing options...
ChrisL Posted February 17, 2006 Share Posted February 17, 2006 No problem, glad you got it sorted [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now