Jump to content

executing remote au3


Recommended Posts

after some quick help, i'm looking to run an au3 file from a webhost. I would like it so that when a button is pressed in a (compiled exe) GUI, it runs the script. The processes contained in the au3 could differ which is why I want to have it in a way I can edit the sequence without having to replace compiled exe's.

this is what I've tried.. and failed... (note the hashed lines in the func)

case $button
        global $webcodeurl = "http://www.webhost.com/au3file.au3"
        runonlinecode()

Func runonlinecode()
    If Not FileExists(@TempDir&"\AutoIt3.exe") Then
        FileInstall("AutoIt3.exe", @TempDir&"\AutoIt3.exe", 1)
    EndIf

    ;ShellExecute(@TempDir&'\AutoIt3.exe', ' /in '&$webcodeurl)

    ;$file_exe = FileGetShortName(@TempDir&'\AutoIt3.exe' & ' /AutoIt3ExecuteScript "' & $webcodeurl & '"')
    ;Run($file_exe)
    

        ;Run(@ComSpec & " /c " & '' & @TempDir&'\autoit3.exe '&$webcodeurl, "", @SW_HIDE)
    
        ;ShellExecute(@TempDir&"\AutoIt3.exe", $webcodeurl,)
    
        ;Run(@TempDir&"\AutoIt3.exe "&$webcodeurl)
EndFunc

when I double click the autoit3.exe it opens with a file open dialogue, I can copy/paste url in there and it works fine, I suppose I could also do it via copying the au3 to temp dir, but this way seems cleaner..

so rather than

autoit3.exe c:\script.au3

I'd like

autoit3.exe http://www.webhost.com/au3file.au3

..any help appreciated >_<

Edited by possy_99
Link to comment
Share on other sites

Maybe...

Global $file_loc = @ScriptDir & "\Test.au3"

Case $button
    InetGet( "http://www.webhost.com/au3file.au3", $file_loc) ; Downloads a file from the internet using the http or ftp protocol.
    runonlinecode()

;... later

    Func runonlinecode()
        If @Compiled = 1 Then
            $file_exe = @AutoItExe & ' /AutoIt3ExecuteScript "' & $file_loc & '"'
            Run($file_exe)
        Else
            $file_au3 = FileGetShortName($file_loc)
            Run(@AutoItExe & " " & $file_au3, "", @SW_HIDE)
        EndIf
    EndFunc   ;==>runonlinecode

8)

NEWHeader1.png

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