Jump to content

[Solved] InetRead Add Function


zxtnt09
 Share

Recommended Posts

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
WEnd

Thanks Alot, :sweating:

Edited by zxtnt09
Solved
Link to comment
Share on other sites

?

#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

 

Link to comment
Share on other sites

?

#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

 

30xbjmg.png

:(

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

Compile the script and run the resulting Exe.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

  • Developers

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

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

Link to comment
Share on other sites

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 :(

Link to comment
Share on other sites

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

is 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

:(

Link to comment
Share on other sites

is that true ?

Have you tried? If yes, which errors did you get?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

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
WEnd

but i see this in %temp%, and i don't know is that work in another computer thats haven't Autoit.

2hp857a.png

is that work ? 

Link to comment
Share on other sites

As you use the @TempDir macro to write and read/execute the script it should work on any computer.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

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
WEnd

and got this error : 

oi8ylj.png

Link to comment
Share on other sites

You need to use the code Jos provided in post #9 to execute the au3 file!

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

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
 WEnd

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

  • Developers

Did you do both things I mentioned in my post since I am missing the first part?

Jos

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

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

×
×
  • Create New...