zxtnt09 Posted October 10, 2015 Posted October 10, 2015 (edited) Hi guys,* Sorry for my many questions,------------------------------------------------i use that and it's true and fine,Local $dData = InetRead("http://example.com/my.html",1) $my = BinaryToString(StringReplace($dData, "0A", "0D0A"), 4)now how can i add functions in "my.html" and autoit run that function,it's meant when ever "Read" data from website, use that serve as "Autoit Function",something like that : In "my.html" we have this : MsgBox (1,"This is from website","this is from website")In script we have this : #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) GuiSetState() Local $dData = InetRead("http://example.com/my.html",1) $my = BinaryToString(StringReplace($dData, "0A", "0D0A"), 4) ;this place is for MsgBox from "my.html" While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndThanks Alot, Edited October 11, 2015 by zxtnt09 Solved
mikell Posted October 11, 2015 Posted October 11, 2015 ?#include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) GuiSetState() Local $dData = BinaryToString(InetRead("http://example.com/my.html", 1)) $tmp = @tempdir & "\test.au3" FileWrite($tmp, $dData) ShellExecute($tmp) FileDelete($tmp) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
zxtnt09 Posted October 11, 2015 Author Posted October 11, 2015 ?#include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) GuiSetState() Local $dData = BinaryToString(InetRead("http://example.com/my.html", 1)) $tmp = @tempdir & "\test.au3" FileWrite($tmp, $dData) ShellExecute($tmp) FileDelete($tmp) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
mikell Posted October 11, 2015 Posted October 11, 2015 Hmm sorry, the file was deleted too fast #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) GuiSetState() Local $dData = "msgbox(0,'', 'this is a test')" ;BinaryToString(InetRead("http://example.com/my.html", 1)) $tmp = @tempdir & "\test.au3" FileWrite($tmp, $dData) ShellExecute($tmp) sleep(1000) FileDelete($tmp) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd zxtnt09 1
zxtnt09 Posted October 11, 2015 Author Posted October 11, 2015 but , if i have not any autoit, it wont be work is that true ?
water Posted October 11, 2015 Posted October 11, 2015 Compile the script and run the resulting Exe. zxtnt09 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Developers Jos Posted October 11, 2015 Developers Posted October 11, 2015 You can use the compiled script also as the stub to run the file, but make sure you use the "#pragma compile(AutoItExecuteAllowed, true)".RunWait('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $tmp & '"')Jos zxtnt09 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
zxtnt09 Posted October 11, 2015 Author Posted October 11, 2015 Compile the script and run the resulting Exe.it is true, ( when i was compile that and run that it is true ) but if i send that to my friend ( have not Autoit ) is that worked for him too ? because it was make a test.au3 in %temp% directory,and run that from %temp%, and if my friend haven't autoit it won't be run
zxtnt09 Posted October 11, 2015 Author Posted October 11, 2015 You can use the compiled script also as the stub to run the file, but make sure you use the "#pragma compile(AutoItExecuteAllowed, true)".RunWait('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $tmp & '"')Josis that true ? #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) GuiSetState() Local $dData = BinaryToString(InetRead("http://example.com/my.html", 1)) $temp = @TempDir & "\" RunWait('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $tmp & '"') While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
mikell Posted October 11, 2015 Posted October 11, 2015 No problem if you compile the script using the directives as Jos saidBTW use ShellExecuteWait instead of ShellExecute so you can remove the sleep() zxtnt09 1
water Posted October 11, 2015 Posted October 11, 2015 is that true ? Have you tried? If yes, which errors did you get? zxtnt09 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
zxtnt09 Posted October 11, 2015 Author Posted October 11, 2015 Have you tried? If yes, which errors did you get? i use that,#include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) GuiSetState() Local $dData = BinaryToString(InetRead("http://example.com/my.html", 1)) $tmp = @Tempdir & "\test.au3" FileWrite($tmp, $dData) RunWait('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $tmp & '"') FileDelete($tmp) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndbut i see this in %temp%, and i don't know is that work in another computer thats haven't Autoit.is that work ?
water Posted October 11, 2015 Posted October 11, 2015 As you use the @TempDir macro to write and read/execute the script it should work on any computer. zxtnt09 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
zxtnt09 Posted October 11, 2015 Author Posted October 11, 2015 As you use the @TempDir macro to write and read/execute the script it should work on any computer.i use that from another computer : #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) GuiSetState() Local $dData = BinaryToString(InetRead("http://example.com/my.html", 1)) $tmp = @tempdir & "\test.au3" FileWrite($tmp, $dData) ShellExecute($tmp) sleep(1000) FileDelete($tmp) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndand got this error :
Developers Jos Posted October 11, 2015 Developers Posted October 11, 2015 is that true ? Of course not ... I am just bullshitting. zxtnt09 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
water Posted October 11, 2015 Posted October 11, 2015 You need to use the code Jos provided in post #9 to execute the au3 file! zxtnt09 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
zxtnt09 Posted October 11, 2015 Author Posted October 11, 2015 (edited) You need to use the code Jos provided in post #9 to execute the au3 file!#include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 500, 500) GuiSetState() Local $dData = BinaryToString(InetRead("http://example.com/my.html", 1)) $tmp = @tempdir & "\test.au3" FileWrite($tmp, $dData) RunWait('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & $tmp & '"') FileDelete($tmp) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndi use that , but it wasn't be work, If run .au3 file : It's worked fine but,In compiled : no error , no result , no Edited October 11, 2015 by zxtnt09
Developers Jos Posted October 11, 2015 Developers Posted October 11, 2015 Did you do both things I mentioned in my post since I am missing the first part?Jos zxtnt09 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
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