heatsink Posted March 23, 2010 Share Posted March 23, 2010 (edited) Hi, I am trying to implement a "network checker" into a script I have written, and I have the pinger set to be pretty much the first thing that happens, the problem is, if it doesn't get a reply, no matter if I have a timeout, the GUI will not initialize unless it gets a reply. This is what I have: $computername = EnvGet("computername") $username = EnvGet("username") $ipaddress = @IPAddress1 $var = Ping("google.com", 1200) If $var Then $networkstatus = "Online!" Else $networkstatus = "Network Error!" EndIf $Form1 = GUICreate("Thing", 323, 290, 229, 142) $Pic1 = GUICtrlCreatePic("\\server\picture.jpg", 8, 8, 159, 74, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) $computernamebox = GUICtrlCreateInput($computername, 96, 104, 217, 21) $Label1 = GUICtrlCreateLabel("Computer Name:", 8, 104, 83, 17) $Label2 = GUICtrlCreateLabel("User Name:", 32, 136, 60, 17) $usernamebox = GUICtrlCreateInput($username, 96, 136, 217, 21) $Label3 = GUICtrlCreateLabel("IP Address:", 32, 168, 58, 17) $Input1 = GUICtrlCreateInput($ipaddress, 96, 168, 217, 21) $Label4 = GUICtrlCreateLabel("Network Status:", 200, 32, 80, 17) $Label5 = GUICtrlCreateLabel($networkstatus, 178, 48, 126, 31, $SS_CENTER) Edited March 23, 2010 by heatsink Link to comment Share on other sites More sharing options...
JohnOne Posted March 23, 2010 Share Posted March 23, 2010 There is not enough of your code to determine why. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
IchBistTod Posted March 23, 2010 Share Posted March 23, 2010 Its simply AutoIt. When you attempt to make a connection the timeout is VERY long regardless of what it is set to. A bug in existence since forever. Advice. Ping in another process and use comau3.au3 (copy-data inter-script communication) to emulate multi threading. [center][/center][center]=][u][/u][/center][center][/center] Link to comment Share on other sites More sharing options...
spudw2k Posted March 23, 2010 Share Posted March 23, 2010 This thread has a solution to perform a threaded ping. http://www.autoitscript.com/forum/index.php?showtopic=106354&view=findpost&p=766946 Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
martin Posted March 23, 2010 Share Posted March 23, 2010 This thread has a solution to perform a threaded ping.#766946There is also a udf in my signature to allow repeated pings to various IPs in the background so your script is not slowed, with the option to have an icon for each address set according to the connected state. A user defined function can be called when the connected state of an IP changes. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
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