cyanidemonkey Posted December 26, 2005 Posted December 26, 2005 Hi guys, This is proberly out of date, but when I tried the _GetIP() I got displayed HTML I found changing: $ip = StringTrimLeft($ip, StringInStr($ip, "<TITLE>Your ip is ") + 17) to: $ip = StringTrimLeft($ip, StringInStr($ip, "<TITLE>Your ip is ") + 139) fixed it. I guess www.whatismyip.com have changed the HTML a little? I then modified the way it pulled the IP from the text string... Func _GetIP() Local $ip If InetGet("http://checkip.dyndns.org/", @TempDir & "\~ip.tmp") Then $ip = FileRead(@TempDir & "\~ip.tmp", FileGetSize(@TempDir & "\~ip.tmp")) FileDelete(@TempDir & "\~ip.tmp") $ip = StringReplace($ip, "<html><head><title>Current IP Check</title></head><body>Current IP Address: ", "") $ip = StringReplace($ip, "<!-- proxy --></body></html>", "") Return $ip Else SetError(1) Return EndIf EndFunc Hope this is useful, if there is a new way of getting you WAN IP instead of _GetIP, sorry 'bout this post My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator
w0uter Posted December 26, 2005 Posted December 26, 2005 (edited) i had a post like this too a long time ago.http://www.autoitscript.com/forum/index.ph...ndpost&p=121173 Edited December 26, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
MSLx Fanboy Posted December 26, 2005 Posted December 26, 2005 I think XML does a better job than HTML for finding specific information Func GetIP() Local $xmldoc = ObjCreate('Microsoft.XMLDOM'), $ip If Not IsObj($xmldoc) Then Return -1 $xmldoc.async = False $xmldoc.load ('http://xml.showmyip.com/') For $x In $xmldoc.documentElement.childNodes If $x.NodeName = "ip" Then $ip = $x.text ExitLoop EndIf Next $xmldoc = 0 Return $ip EndFunc Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate())
cyanidemonkey Posted December 27, 2005 Author Posted December 27, 2005 Hey the xml version looks cool MSLx Fanboy, when I tried to run it I got an unknown function error for ObjCreate. Where can I find this? Cheers. My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator
Moderators SmOke_N Posted December 27, 2005 Moderators Posted December 27, 2005 Do you have the beta version of AutoIt? The address is in my signature for it. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
MSLx Fanboy Posted December 27, 2005 Posted December 27, 2005 I've been working on a script that checks the IP of the system every hour, and if it changes, it notifies www.dyndns.com with the new address. As soon as I fix a bug, I'll post it up Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate())
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