itlad Posted February 8, 2010 Share Posted February 8, 2010 Hello folks, I'd like to write a tiny script to display an informational window on the screen that shows the host's IP address. I used autoit a couple of years ago and found it pretty handy. However,it's been a while since I could write some fun script using AutoIT again, and I can hardly take a minute to read the documentation from the top again just now. If anyone would like to take a minute to show me what is the function to use or something, that would be much appreciated Thanks very much. Link to comment Share on other sites More sharing options...
martin Posted February 8, 2010 Share Posted February 8, 2010 Hello folks,I'd like to write a tiny script to display an informational window on the screen that shows the host's IP address.I used autoit a couple of years ago and found it pretty handy. However,it's been a while since I could write some fun script using AutoIT again, and I can hardly take a minute to read the documentation from the top again just now.If anyone would like to take a minute to show me what is the function to use or something, that would be much appreciated Thanks very much.Well maybe you'd better find that minute and look in the help under the section "User Defined Functions Reference".Bloody cheek, use your own minutes up. 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...
itlad Posted February 8, 2010 Author Share Posted February 8, 2010 well, I had a look earlier but then the only thing I have found so far is the function TCPNameToIP. Thing is I am not supposed to know the hostname in the first place. Maybe I can provide the TCPNameToIP function with the windows %COMPUTERNAME% environment variable ? if so, is there a particular way to access Windows variables with AutoIT ? Cheers Link to comment Share on other sites More sharing options...
jvanegmond Posted February 8, 2010 Share Posted February 8, 2010 You can use TCPNameToIP with the @ComputerName macro (same as %COMPUTERNAME%), but much easier is to use @IpAddress1 macro. Environment variables not already in macros can be accessed with EnvGet. github.com/jvanegmond Link to comment Share on other sites More sharing options...
darkjohn20 Posted February 8, 2010 Share Posted February 8, 2010 (edited) If you want your external address use the Inet library (_GetIP) If not then use @IpAddress1 Then use GuiCtrlSetData or ControlSetText to put this in your text box. Edited February 8, 2010 by darkjohn20 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