Vowles Posted July 24, 2005 Posted July 24, 2005 I have a simple script that opens a program, Clicks on buttons then exits. It works fine in .au3 format but when I compile it, it dont work. run("C:\Program Files\Playnet\Playgate\PlayGate.exe 1","") Would how Iam running the program be the cause? Note: The 1 is a needed parameter when opening the program.
t0ddie Posted July 24, 2005 Posted July 24, 2005 (edited) run("C:\Program Files\Playnet\Playgate\PlayGate.exe 1") Edited July 24, 2005 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.
Vowles Posted July 24, 2005 Author Posted July 24, 2005 (edited) Nope that didnt fix it. Little info- Playgate is a launcher for a game called WW2OL. Now when I run the program I dont see the launcher at all but get a "playgate" error which is showing that the program is getting called but not correcrtly some where. Found the problem, The para-meter "1" isnt working. Is there a way I can run the program like it was being run from a short cut? But still why does it work as .au3 and not .exe? Edited July 24, 2005 by Vowles
GaryFrost Posted July 24, 2005 Posted July 24, 2005 (edited) run(@comspec & ' /c ' & @ProgramFilesDir & "\Playnet\Playgate\PlayGate.exe 1","",@SW_HIDE) Edited July 24, 2005 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Vowles Posted July 25, 2005 Author Posted July 25, 2005 (edited) Come on I need this fixed? Think it may be a bug in the compile process or something? expandcollapse popup#include <GUIConstants.au3> GUICreate("WW2OL Launcher",270,200) $filemenu = GuiCtrlCreateMenu ("File") $exititem = GuiCtrlCreateMenuitem ("Exit",$filemenu) $helpmenu = GuiCtrlCreateMenu ("Help") $aboutitem = GuiCtrlCreateMenuitem ("About",$helpmenu) GuiSetState() $Auto = IniRead("Config.ini","Config","AutoLaunch","0") $program = IniRead("Config.ini","Config","Path2Program","A2") $okbutton = GuiCtrlCreateButton ("Play WW2OL",85,100,100,20) GUICtrlCreateLabel("WW2OL Launcher By Vowlesy",65,40) GUICtrlCreateLabel("www.2-Para.co.uk",90,70) GuiCtrlCreateCheckbox("AutoLaunch", 5, 150, 80, 20) GuiCtrlSetState($Auto, $GUI_CHECKED) GUISetCursor(-3) GUISetBkColor (0x005000) While 1 $msg = GUIGetMsg() if $Auto = -1 Then $msg = $okbutton endif if $program = "A2" Then $program = 1 $program = FileOpenDialog("Locate PlayGate.exe","C:\","Program (*.exe)",1,"PlayGate.exe") If @error Then MsgBox(4096,"","No File(s) chosen") $program = "A2" Else $program = StringReplace($program, "|", @CRLF) MsgBox(4096,"","You chose " & $program) EndIf endif Select Case $msg = $GUI_EVENT_CLOSE OR $msg = $exititem ExitLoop Case $msg = $okbutton run(""&$program&" 1") sleep(1000) ControlClick("Logon to Playnet.com","","Button1") sleep(1000) ControlClick("Logon to Playnet.com","","Button4") ExitLoop Case $msg = $aboutitem Msgbox(0,"About","Created by Vowlesy of 2-Para! [www.2-para.co.uk]") EndSelect Edited July 25, 2005 by Vowles
seandisanti Posted July 25, 2005 Posted July 25, 2005 Come on I need this fixed? Think it may be a bug in the compile process or something?expandcollapse popup#include <GUIConstants.au3> GUICreate("WW2OL Launcher",270,200) $filemenu = GuiCtrlCreateMenu ("File") $exititem = GuiCtrlCreateMenuitem ("Exit",$filemenu) $helpmenu = GuiCtrlCreateMenu ("Help") $aboutitem = GuiCtrlCreateMenuitem ("About",$helpmenu) GuiSetState() $Auto = IniRead("Config.ini","Config","AutoLaunch","0") $program = IniRead("Config.ini","Config","Path2Program","A2") $okbutton = GuiCtrlCreateButton ("Play WW2OL",85,100,100,20) GUICtrlCreateLabel("WW2OL Launcher By Vowlesy",65,40) GUICtrlCreateLabel("www.2-Para.co.uk",90,70) GuiCtrlCreateCheckbox("AutoLaunch", 5, 150, 80, 20) GuiCtrlSetState($Auto, $GUI_CHECKED) GUISetCursor(-3) GUISetBkColor (0x005000) While 1 $msg = GUIGetMsg() if $Auto = -1 Then $msg = $okbutton endif if $program = "A2" Then $program = 1 $program = FileOpenDialog("Locate PlayGate.exe","C:\","Program (*.exe)",1,"PlayGate.exe") If @error Then MsgBox(4096,"","No File(s) chosen") $program = "A2" Else $program = StringReplace($program, "|", @CRLF) MsgBox(4096,"","You chose " & $program) EndIf endif Select Case $msg = $GUI_EVENT_CLOSE OR $msg = $exititem ExitLoop Case $msg = $okbutton run(""&$program&" 1") sleep(1000) ControlClick("Logon to Playnet.com","","Button1") sleep(1000) ControlClick("Logon to Playnet.com","","Button4") ExitLoop Case $msg = $aboutitem Msgbox(0,"About","Created by Vowlesy of 2-Para! [www.2-para.co.uk]") EndSelect<{POST_SNAPBACK}>what is the error that you're getting? sorry, i don't have the game or the launcher, so i am not able to duplicate or test code on this end. i've never had any problems passing arguments to an executable either compiled or with an .au3, so the error text may help troubleshoot...
Somerset Posted July 25, 2005 Posted July 25, 2005 run(""&$program&" 1") try removing the "" before the $program string? why is it there?
Vowles Posted July 25, 2005 Author Posted July 25, 2005 Its there because the program needs to be called with a para-meter of "1". My problem is when its in .au3 form (script) it works fine. After I compile it. it stops working.
Somerset Posted July 25, 2005 Posted July 25, 2005 &" 1" already has the closing quotes remove the ""& at the beginning and try it.
Vowles Posted July 25, 2005 Author Posted July 25, 2005 (edited) Ah cheers but still compile wont run the program correctly. By that I mean the program isnt gettined called with the "1" para-meter no matter how I script it. Edited July 25, 2005 by Vowles
Somerset Posted July 25, 2005 Posted July 25, 2005 Else $program = StringReplace($program, "|", @CRLF) MsgBox(4096,"","You chose " & $program) EndIf please explain to me what is with the pipeline? | why are you replacing something that isn't there? just asking sorry if it seems i am nit picking.
Somerset Posted July 25, 2005 Posted July 25, 2005 try putting either a / in front of the switch or -
Vowles Posted July 25, 2005 Author Posted July 25, 2005 (edited) For if more than one program is selected, Dont need to be there really I can take it out. Edited July 25, 2005 by Vowles
Vowles Posted July 25, 2005 Author Posted July 25, 2005 Hmm, It cant be my scripting because doing run ("C:\Program Files\Playnet\Playgate\Playgate.exe 1") Works again as .au3 form but not when compiled. So compiling it must cancel it some how?
seandisanti Posted July 25, 2005 Posted July 25, 2005 Hmm, It cant be my scripting because doingrun ("C:\Program Files\Playnet\Playgate\Playgate.exe 1")Works again as .au3 form but not when compiled. So compiling it must cancel it some how?<{POST_SNAPBACK}>it's possible that they have their launcher watching to see if it is being run programatically. that is an anti-debugging trick i've seen before. I'm not sure how to get around it, except the obvious option of leaving it in .au3.
Vowles Posted July 26, 2005 Author Posted July 26, 2005 Well I found a way around it. (Made autoit write a ShortCut and .bat file to run it then run the .bat file). But still, Maybe Run() should have a "args" ..arg. Like FileCreateShortCut() ??
eltorro Posted July 26, 2005 Posted July 26, 2005 Well I found a way around it. (Made autoit write a ShortCut and .bat file to run it then run the .bat file). But still, Maybe Run() should have a "args" ..arg. Like FileCreateShortCut() ??<{POST_SNAPBACK}>have You triedrun ('"C:\Program Files\Playnet\Playgate\Playgate.exe" 1')Sometimes this works. Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code
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