Jump to content

Compile makes program not function.


Recommended Posts

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.

Link to comment
Share on other sites

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 by Vowles
Link to comment
Share on other sites

Come on I need this fixed? Think it may be a bug in the compile process or something?

#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 by Vowles
Link to comment
Share on other sites

Come on I need this fixed? Think it may be a bug in the compile process or something?

#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...
Link to comment
Share on other sites

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 by Vowles
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

<{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.
Link to comment
Share on other sites

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 tried

run ('"C:\Program Files\Playnet\Playgate\Playgate.exe" 1')

Sometimes this works.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...