Sign in to follow this  
Followers 0
Vowles

Compile makes program not function.

18 posts in this topic

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by Vowles

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

run(@comspec & ' /c ' & @ProgramFilesDir & "\Playnet\Playgate\PlayGate.exe 1","",@SW_HIDE)

Edited 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.

 

Share this post


Link to post
Share on other sites

Cant get that to work at all

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Share this post


Link to post
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...

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

run(""&$program&" 1")

try removing the "" before the $program string? why is it there?


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

&" 1"
already has the closing quotes

remove the ""& at the beginning and try it.


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

#11 ·  Posted (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 by Vowles

Share this post


Link to post
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.


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

try putting either a / in front of the switch or -


 

Spoiler

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

For if more than one program is selected, Dont need to be there really I can take it out.

Edited by Vowles

Share this post


Link to post
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?

Share this post


Link to post
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.

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
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() ??

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0