zxtnt09

[Solved] InetRead auto refresh

4 posts in this topic

#1 ·  Posted (edited)

Hi guys,

After i use that, all of thing is good and perfect,

Local $dData = InetRead("http://example.com/my.html",1)
$my = BinaryToString(StringReplace($dData, "0A", "0D0A"), 4)

but now how can i reload that after x time ?!

by this ( top script ) , i need to relunch the script to see modified,

now! how can i update data after X time !?

for example : 

in "my.html" we have number "3" , i try to change it to "5", now we need to relunch script to see "3" => "5",

how we can use that without relunch script.

thanks alot and sorry for my bad english & too long question. :sweating:

Edited by zxtnt09
example.html => example.com , Solved

Share this post


Link to post
Share on other sites



Global $dOldData = ""
Global $xSeconds = 60

While 3
    Local $dData = InetRead("http://example.com/my.html",1)
    $my = BinaryToString(StringReplace($dData, "0A", "0D0A"), 4)
    If $dOlddata <> $dData Then
        ;do something
        $dOlddata = $dData
    EndIf
    Sleep($xSeconds)
Wend

 

1 person likes this

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites

Thanks, but it was make infinity loop !

Can it used without "while" loop ?!

Something like :

AutoRefresh,AutoUpdate,...

Thanks :wub:

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

  • Similar Content

    • caramen
      By caramen
      Hello guys. 
      I totaly reworked a script to get less problem(Melba23) and i used a topic to copy an existing script and modified it. 
      Since my last post it was bad evaluated as a spam bot but by my fault since i have not explained the purpose of it corectly. (Yes i got ugly english)
       
      Then FIRST OF ALL the purpose of this script is to allow a call center to complet multiple fields in internet explorer and optionnaly; i am gonna see that after the principal code to configure multiple email that can be send. I know there is some UDF for outlook etc... but i want a single script to do all. this is the way i want to do that. 
       
      Ok this is my complete code for the moment. 
      #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Misc.au3> $dll = DllOpen("user32.dll") Global $EnvoyerMess1Sub1 Global $EnvoyerMess2Sub1 Global $EnvoyerMess3Sub1 Global $EnvoyerMess4Sub1 Global $EnvoyerMess5Sub1 Global $EnvoyerMess1Sub2 Global $EnvoyerMess2Sub2 Global $EnvoyerMess3Sub2 Global $EnvoyerMess4Sub2 Global $EnvoyerMess5Sub2 Global $EnvoyerMess1Sub3 Global $EnvoyerMess2Sub3 Global $EnvoyerMess3Sub3 Global $EnvoyerMess4Sub3 Global $EnvoyerMess5Sub3 Global $EnvoyerMess1Sub4 Global $EnvoyerMess2Sub4 Global $EnvoyerMess3Sub4 Global $EnvoyerMess4Sub4 Global $EnvoyerMess5Sub4 Global Const $SettingsFile = @SCRIPTDIR & '\Settings.ini' $Setting1 = IniRead ($SettingsFile, 'Stats', 'Utilisation', "ERROR") IniWrite ($SettingsFile, 'Stats', 'Utilisation',$Setting1+1) $Valeur1 = IniRead ($SettingsFile, 'NomMenu', 'Menu1', "ERROR") $Valeur2 = IniRead ($SettingsFile, 'NomMenu', 'Menu2', "ERROR") $Valeur3 = IniRead ($SettingsFile, 'NomMenu', 'Menu3', "ERROR") $Valeur4 = IniRead ($SettingsFile, 'NomMenu', 'Menu4', "ERROR") $Valeur11 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu1.1', "ERROR") $Valeur12 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu1.2', "ERROR") $Valeur13 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu1.3', "ERROR") $Valeur14 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu1.4', "ERROR") $Valeur15 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu1.5', "ERROR") $Valeur21 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu2.1', "ERROR") $Valeur22 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu2.2', "ERROR") $Valeur23 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu2.3', "ERROR") $Valeur24 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu2.4', "ERROR") $Valeur25 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu2.5', "ERROR") $Valeur31 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu3.1', "ERROR") $Valeur32 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu3.2', "ERROR") $Valeur33 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu3.3', "ERROR") $Valeur34 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu3.4', "ERROR") $Valeur35 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu3.5', "ERROR") $Valeur41 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu4.1', "ERROR") $Valeur42 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu4.2', "ERROR") $Valeur43 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu4.3', "ERROR") $Valeur44 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu4.4', "ERROR") $Valeur45 = IniRead ($SettingsFile, 'NomMenu', 'SousMenu4.5', "ERROR") $Message11 = IniRead ($SettingsFile, 'Messages', 'Message11', "ERROR") $Message12 = IniRead ($SettingsFile, 'Messages', 'Message11', "ERROR") $Message13 = IniRead ($SettingsFile, 'Messages', 'Message11', "ERROR") $Message14 = IniRead ($SettingsFile, 'Messages', 'Message11', "ERROR") $Message15 = IniRead ($SettingsFile, 'Messages', 'Message11', "ERROR") $Message21 = IniRead ($SettingsFile, 'Messages', 'Message21', "ERROR") $Message22 = IniRead ($SettingsFile, 'Messages', 'Message22', "ERROR") $Message23 = IniRead ($SettingsFile, 'Messages', 'Message23', "ERROR") $Message24 = IniRead ($SettingsFile, 'Messages', 'Message24', "ERROR") $Message25 = IniRead ($SettingsFile, 'Messages', 'Message25', "ERROR") $Message31 = IniRead ($SettingsFile, 'Messages', 'Message31', "ERROR") $Message32 = IniRead ($SettingsFile, 'Messages', 'Message32', "ERROR") $Message33 = IniRead ($SettingsFile, 'Messages', 'Message33', "ERROR") $Message34 = IniRead ($SettingsFile, 'Messages', 'Message34', "ERROR") $Message35 = IniRead ($SettingsFile, 'Messages', 'Message35', "ERROR") $Message41 = IniRead ($SettingsFile, 'Messages', 'Message41', "ERROR") $Message42 = IniRead ($SettingsFile, 'Messages', 'Message42', "ERROR") $Message43 = IniRead ($SettingsFile, 'Messages', 'Message43', "ERROR") $Message44 = IniRead ($SettingsFile, 'Messages', 'Message44', "ERROR") $Message45 = IniRead ($SettingsFile, 'Messages', 'Message45', "ERROR") BuildHiddenGUI() While 1 Sleep ( 10 ) If _IsPressed("04", $dll) Then CallCustomContextMenu() $msg = GUIGetMsg() Switch $msg ;~ ===================================================== Case $EnvoyerMess1Sub1 ;~ MouseClick("left") Send(""&$Message11) Case $EnvoyerMess2Sub1 Send(""&$Message12) Case $EnvoyerMess3Sub1 Send(""&$Message13) Case $EnvoyerMess4Sub1 Send(""&$Message14) Case $EnvoyerMess5Sub1 Send(""&$Message15) ;~ ====================================================== Case $EnvoyerMess1Sub2 Case $EnvoyerMess2Sub2 Case $EnvoyerMess3Sub2 Case $EnvoyerMess4Sub2 Case $EnvoyerMess5Sub2 ;~ ====================================================== Case $EnvoyerMess1Sub3 Case $EnvoyerMess2Sub3 Case $EnvoyerMess3Sub3 Case $EnvoyerMess4Sub3 Case $EnvoyerMess5Sub3 ;~ ======================================================= Case $EnvoyerMess1Sub4 Case $EnvoyerMess2Sub4 Case $EnvoyerMess3Sub4 Case $EnvoyerMess4Sub4 Case $EnvoyerMess5Sub4 ;~ ====================================================== Case $ConfigITEM EndSwitch WEnd DllClose($dll) Func BuildHiddenGUI() Global $Contextmenu, $msg, $GUI, $aTSR Global $SubMenu1, $folderitem, $programitem, $fileitem, $ConfigITEM, $otheritem Global $folderitem1, $folderitem2, $programitem1, $programitem2 $aTSR = _GetTotalScreenResolution() $GUI = GuiCreate("GUI Context Menu",1,1, $aTSR[0], 1,BitOR($WS_POPUP,$WS_BORDER),BitOr($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW)) WinSetTrans( $GUI, '', 1) GUISetState() $Contextmenu = GUICtrlCreateContextMenu() $SubMenu1 = GUICtrlCreateMenu(""&$Valeur1, $Contextmenu) $EnvoyerMess1Sub1 = GUICtrlCreateMenuItem(""&$Valeur11, $SubMenu1) $EnvoyerMess2Sub1 = GUICtrlCreateMenuItem(""&$Valeur12, $SubMenu1) $EnvoyerMess3Sub1 = GUICtrlCreateMenuItem(""&$Valeur13, $SubMenu1) $EnvoyerMess4Sub1 = GUICtrlCreateMenuItem(""&$Valeur14, $SubMenu1) $EnvoyerMess5Sub1 = GUICtrlCreateMenuItem(""&$Valeur15, $SubMenu1) $SubMenu2 = GUICtrlCreateMenu(""&$Valeur2, $Contextmenu) $EnvoyerMess1Sub2 = GUICtrlCreateMenuItem(""&$Valeur21, $SubMenu2) $EnvoyerMess2Sub2 = GUICtrlCreateMenuItem(""&$Valeur22, $SubMenu2) $EnvoyerMess3Sub2 = GUICtrlCreateMenuItem(""&$Valeur23, $SubMenu2) $EnvoyerMess4Sub2 = GUICtrlCreateMenuItem(""&$Valeur24, $SubMenu2) $EnvoyerMess5Sub2 = GUICtrlCreateMenuItem(""&$Valeur25, $SubMenu2) $SubMenu3 = GUICtrlCreateMenu(""&$Valeur3, $Contextmenu) $EnvoyerMess1Sub3 = GUICtrlCreateMenuItem(""&$Valeur31, $SubMenu3) $EnvoyerMess2Sub3 = GUICtrlCreateMenuItem(""&$Valeur32, $SubMenu3) $EnvoyerMess3Sub3 = GUICtrlCreateMenuItem(""&$Valeur33, $SubMenu3) $EnvoyerMess4Sub3 = GUICtrlCreateMenuItem(""&$Valeur34, $SubMenu3) $EnvoyerMess5Sub3 = GUICtrlCreateMenuItem(""&$Valeur35, $SubMenu3) $SubMenu4 = GUICtrlCreateMenu(""&$Valeur4, $Contextmenu) $EnvoyerMess1Sub4 = GUICtrlCreateMenuItem(""&$Valeur41, $SubMenu4) $EnvoyerMess2Sub4 = GUICtrlCreateMenuItem(""&$Valeur42, $SubMenu4) $EnvoyerMess3Sub4 = GUICtrlCreateMenuItem(""&$Valeur43, $SubMenu4) $EnvoyerMess4Sub4 = GUICtrlCreateMenuItem(""&$Valeur44, $SubMenu4) $EnvoyerMess5Sub4 = GUICtrlCreateMenuItem(""&$Valeur45, $SubMenu4) GUICtrlCreateMenuItem("", $contextmenu) ; separator $ConfigITEM = GUICtrlCreateMenuItem("Configuration", $contextmenu) EndFunc Func CallCustomContextMenu() Local $contextmenu, $msg Global $newsubmenu, $folderitem, $programitem, $fileitem, $otheritem Global $folderitem1, $folderitem2, $programitem1, $programitem2 Local $pos Global $GUI, $aTSR WinActivate ($GUI) ControlClick ( $GUI, "", "", "right", 1, $aTSR[0], 1) EndFunc Func _GetTotalScreenResolution() Local $aRet[2], $VirtualDesktopWidth, $VirtualDesktopHeight Global Const $SM_VIRTUALWIDTH = 78 Global Const $SM_VIRTUALHEIGHT = 79 $VirtualDesktopWidth = DllCall("user32.dll", "int", "GetSystemMetrics", "int", $SM_VIRTUALWIDTH) $aRet[0] = $VirtualDesktopWidth[0] $VirtualDesktopHeight = DllCall("user32.dll", "int", "GetSystemMetrics", "int", $SM_VIRTUALHEIGHT) $aRet[1] = $VirtualDesktopHeight[0] Return $aRet EndFunc Func WinGroupActive() AutoItSetOption("WinTitleMatchMode", 4) If WinActive("classname=ExploreWClass") _ Or WinActive("classname=CabinetWClass") _ Or WinActive("classname=#32770") _ Or WinActive("classname=DV2ControlHost") _ Or WinActive("classname=MMCMainFrame") _ Or WinActive("[CLASS:Progman; Title:Program Manager]") Then Return True Else Return False EndIf EndFunc  
      By this way the script is very more clear about the purpose. When i use middle mouse click i got a context menu that apear. Then i can send the preconfigured message in the ini file that will alow me to send particular message without spending much time on it. 
      First question : 
      When i push middle click on a particular windows how to get back focus on it ??
      plz dont make attention on the declared fonction that are unused i am gonna clean that at the end. 
    • Valnurat
      By Valnurat
      Who could help me to convert this vbs to AuoIT?
      on error resume next dim oCPAppletMgr 'Control Applet manager object. dim oClientAction 'Individual client action. dim oClientActions 'A collection of client actions. 'Get the Control Panel manager object. set oCPAppletMgr=CreateObject("CPApplet.CPAppletMgr") if err.number <> 0 then Wscript.echo "Couldn't create control panel application manager" WScript.Quit end if 'Get a collection of actions. set oClientActions=oCPAppletMgr.GetClientActions if err.number<>0 then wscript.echo "Couldn't get the client actions" set oCPAppletMgr=nothing WScript.Quit end if 'Display each client action name and perform it. For Each oClientAction In oClientActions if oClientAction.Name = "Request & Evaluate Machine Policy" then wscript.echo "Performing action " + oClientAction.Name oClientAction.PerformAction end if if oClientAction.Name = "Software Metering Usage Report Cycle" then wscript.echo "Performing action " + oClientAction.Name oClientAction.PerformAction end if if oClientAction.Name = "Updates Source Scan Cycle" then wscript.echo "Performing action " + oClientAction.Name oClientAction.PerformAction end if if oClientAction.Name = "Request & Evaluate User Policy" then wscript.echo "Performing action " + oClientAction.Name oClientAction.PerformAction end if if oClientAction.Name = "Hardware Inventory Collection Cycle" then wscript.echo "Performing action " + oClientAction.Name oClientAction.PerformAction end if if oClientAction.Name = "Software Inventory Collection Cycle" then wscript.echo "Performing action " + oClientAction.Name oClientAction.PerformAction end if if oClientAction.Name = "Application Global Evaluation Task" then wscript.echo "Performing action " + oClientAction.Name oClientAction.PerformAction end if if oClientAction.Name = "Software Updates Assignments Evaluation Cycle" then wscript.echo "Performing action " + oClientAction.Name oClientAction.PerformAction end if if oClientAction.Name = "Discovery Data Collection Cycle" then wscript.echo "Performing action " + oClientAction.Name oClientAction.PerformAction end if if oClientAction.Name = "MSI Product Source Update Cycle" then wscript.echo "Performing action " + oClientAction.Name oClientAction.PerformAction end if if oClientAction.Name = "Standard File Collection Cycle" then wscript.echo "Performing action " + oClientAction.Name oClientAction.PerformAction end if next set oClientActions=nothing set oCPAppletMgr=nothing  
    • xiantez
      By xiantez
      Hello AutoIT community. 
      I am attempting to make a script that will login to my bank account and retrieve one of my account balances and display it in a MsgBox, however it am having some difficulty getting the correct value.... The MsgBox keep displaying a value of "0" instead of the actual string in between the source code I'm looking for.... Any help would be greatly appreciated!
      $readtext = InetRead("https://www.xxxbanksitexxx.com/das/cgi-bin/session.cgi?screenid=SIGNON_PORTAL_PAUSE&amp;LOB=CONS",1)
      $source = BinaryToString($readtext)
      $text =  _StringBetween($source,'CHECKING XXXXXXXXXX&nbsp;', ' "> ')

      MsgBox(0,"balance",$text)     ;This keeps returning a value of "0"

              Case $GUI_EVENT_CLOSE
                 GUIDelete($Form1)
                  ExitLoop
               Case $Button2
                  GUIDelete($Form1)
                  ExitLoop
          EndSwitch
      WEnd
       
       
    • zxtnt09
      By zxtnt09
      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, 
    • morganlove
      By morganlove
      Ever since I upgraded to Windows 10, scripts using Inetget and InetRead no longer seem to recognize Internet Explorer cookies. This makes them useless for websites that require you to be logged in to. Has there been some sort of change to IE cookies because of the upgrade and new Edge browser? Is there a way around this?