Westi Posted July 24, 2004 Posted July 24, 2004 Maybe useful for computers behind routers or with NAT or ip masquerading:This is the updated version from: IP Help !MyIP.au3expandcollapse popupOpt("TrayIconHide", 1) Opt("MustDeclareVars", 1) Dim $INI, $POS, $IP, $URLS, $URL, $I, $IPTMP, $FS, $FILE, $LINE, $LINE1 $INI = @ScriptDir & "\myip.ini" If FileExists($INI) = 0 Then IniWrite($INI, "URL", "1", "dynupdate.no-ip.com") IniWrite($INI, "URL", "2", "www.bpftpserver.com") IniWrite($INI, "URL", "3", "www.minasithil.org") IniWrite($INI, "URL", "4", "ressourcen.snooweatinganima.de") IniWrite($INI, "URL", "5", "dasdeck.de/staff/valentin/tools") IniWrite($INI, "URL", "6", "julien.games-fed.com") IniWrite($INI, "URL", "7", "www.dorm.org/~dorm") IniWrite($INI, "URL", "8", "www.ois.uic.edu/pubtools") IniWrite($INI, "URL", "9", "www.espresso.iki.fi/pub/php") IniWrite($INI, "URL", "10", "www.vtcz.ch") IniWrite($INI, "URL", "11", "pmh.compunet.hu/tenzor") IniWrite($INI, "URL", "12", "www.spunge.org/~oblivion") IniWrite($INI, "URL", "13", "Dev.trag.nl") IniWrite($INI, "URL", "14", "naholyr.free.fr") IniWrite($INI, "URL", "15", "mgt.heinrich.free.fr") IniWrite($INI, "URL", "16", "www.liero-masters.host.sk") IniWrite($INI, "URL", "17", "www.zoo-gate.fi") IniWrite($INI, "URL", "18", "filezilla.sourceforge.net/misc/") IniWrite($INI, "URL", "19", "cipres.cec.uchile.cl/~hvergara") IniWrite($INI, "URL", "20", "www.nicoland.de/scripts") IniWrite($INI, "URL", "URLS", "20") IniWrite($INI, "URL", "Warning1", "Don't add addresses in another format!(No leading: http:// etc.)") IniWrite($INI, "URL", "Warning2", "The program searches for a script called: ip.php") IniWrite($INI, "URL", "Warning3", "The output from ip.php is the pure IP address!(No leading: Your IP is:)") EndIF $POS = 0 $IP = 0 $URLS = IniRead($INI, "URL", "URLS", "") ;delete forgotten tempfiles For $I = 1 To $URLS FileDelete(@ScriptDir & "\" & $POS + 1 & ".htm") Next While $POS < $URLS FileDelete(@ScriptDir & "\" & $POS - 1 & ".htm") $POS = $POS + 1 $IPTMP = @ScriptDir & "\" & $POS & ".htm" $URL = IniRead($INI, "URL", $POS, "") $IP = URLDownloadToFile("http://" & $URL & "/ip.php", $IPTMP) $FS = FileGetSize($IPTMP) ;Who can made it easier ?! If FileExists ($IPTMP) = 0 Then ContinueLoop If $FS > 16 Then ContinueLoop Else If $FS < 8 then ContinueLoop EndIf If $FS <= 16 then ExitLoop Wend If $POS >= $URLS then Error("NO URL AVAILABLE." & @CR & "ARE YOU OFFLINE!?" & @CR & "EXIT!") $FILE = FileOpen($IPTMP, 0) If $FILE = -1 Then Error("Unable to open " & $URL) $LINE = FileReadLine($FILE) ;check the result $LINE1 = StringReplace($LINE, ".", "") If StringIsDigit($LINE1) Then ;do something with the output, $line is your IP ;ClipPut($LINE) ;WinSetTitle ( "FRITZ!web DSL", "", $line ) MsgBox(0, "Current IP Address:", $LINE) Else ;show the error in default browser instead of IE RunWait(@ComSpec & " /c start " & $IPTMP, "", @SW_HIDE) ;pause script to load the file Sleep(1000) EndIf FileClose($FILE) FileDelete($IPTMP) Exit Func Error($TXT) MsgBox(48, "Error", $TXT) Exit EndFunc
Nutster Posted July 26, 2004 Posted July 26, 2004 (edited) Westi, What are you doing to generate the image in your signature? I would love to see the script/source you are using. I see my information in the image, but it says that I am running Mozilla/Netscape 5. I am actually running Netscape 7.1, not 5. Others may not see what I am talking about, but hopefully Westi understands. Edited July 26, 2004 by Nutster David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd...
msb5150 Posted July 26, 2004 Posted July 26, 2004 That picture is created from a PHP script run everytime that picture is accessed. PHP has default variables for your ip address and browser type. Upon the aforementioned access the script takes the ip address and browser type variables and parses them into one of several pictures (along with one of several messages) chosen at random. You can find out how to create your own here: http://www.iceteks.com/articles.php?act=vi...le=textsig&p=1&
ezzetabi Posted July 26, 2004 Posted July 26, 2004 (edited) I made also a script for taking the real external ip, here it is: URLDownloadToFile("http://www.whatismyipaddress.com/index.asp","temp") $ip = FileReadLine("temp",1) FileDelete("temp") $ip = StringReplace($ip,"Our server doesn't like your browser (non-existant " & _ "user agent), try something more standard. Here's your IP address: ","") MsgBox(64,"IP address","Your IP address is:" & @lf & $Ip) It uses the free service of whatismyipaddress.com . Edited July 26, 2004 by ezzetabi
Westi Posted July 26, 2004 Author Posted July 26, 2004 Westi, What are you doing to generate the image in your signature? I would love to see the script/source you are using. I see my information in the image, but it says that I am running Mozilla/Netscape 5. I am actually running Netscape 7.1, not 5.You've copied the url, so you can see: www.danasoft.com/sig/Scan1.jpgGoto danasoft and make your own.I 've never see the php source and don't know why you use such an old browser. http://www.autoitscript.com/fileman/users/public/Westi/scan1.png@ezzetabiWhat's the output of the script, if you're offline or the site is unavailable ?I use this for online games, messenger and Ultr@VNC.We know to take the external IP, but others don't...This is what i get:http://www.autoitscript.com/fileman/users/public/Westi/wrong.pngMy script returns : 80.133.112.215Westi
ezzetabi Posted July 26, 2004 Posted July 26, 2004 (edited) I do not know what to say... It worked until today... I do not know why now it gives that parsing error... We are stuck in your implementation I guess Edited July 26, 2004 by ezzetabi
Nutster Posted July 26, 2004 Posted July 26, 2004 It is probably better to use Westi's version because that generates less bandwidth. On WhatIsMyIP.com, there is now a notice asking that his page not be loaded from automated scripts because this is eating a lot of his bandwidth. David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd...
CyberSlug Posted August 21, 2004 Posted August 21, 2004 A modification of ezzetabi's script: FileChangeDir(@TempDir);make the Temp folder the current directory URLDownloadToFile("http://www.whatismyipaddress.com/", "ip_temp") $ip = FileReadLine("ip_temp",1) FileDelete("ip_temp") $ip = StringReplace($ip, "Nonexistant User-Agent. IP address: ","") MsgBox(4096,"IP address", "Your IP address is " & $ip);simple message box Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
mcfr1es Posted August 28, 2004 Posted August 28, 2004 (edited) http://whatismyip.comurldownloadtofile, parse, end of story *edit* oops, you beat me to it - oh well Edited August 28, 2004 by mcfr1es Roger! You son of a big pile o' Monkey Nuts.
dnsi Posted March 28, 2006 Posted March 28, 2006 What is this anyways??? My Programs:Flip-Flop File Encryption SysyemMULTIPLAYER-SOCKETSERVERHide An Archive In A Picture
Moderators big_daddy Posted March 28, 2006 Moderators Posted March 28, 2006 (edited) @dnsiYou might consider changing your sig if you read the forum rules.So try to limit sigs to:- A couple of inches in size- If it contains an image, have consideration for everyone that has to download it (filesize)- No "Your IP is nn.nn.nn.nn" images. Edited March 28, 2006 by big_daddy
Lakes Posted March 30, 2006 Posted March 30, 2006 A modification of ezzetabi's script: FileChangeDir(@TempDir);make the Temp folder the current directory URLDownloadToFile("http://www.whatismyipaddress.com/", "ip_temp") $ip = FileReadLine("ip_temp",1) FileDelete("ip_temp") $ip = StringReplace($ip, "Nonexistant User-Agent. IP address: ","") MsgBox(4096,"IP address", "Your IP address is " & $ip);simple message box Gives the wrong IP address and No User-Agent; Http requests to this site require a valid user-agent string to be passed. 2015 - Still no flying cars, instead blankets with sleeves.
jackyyll Posted March 31, 2006 Posted March 31, 2006 Why even download the file? Cant you just get the source of it using _INetGetSource('www.url.com/ip.php') ? And then parse the results if needed?
Developers Jos Posted March 31, 2006 Developers Posted March 31, 2006 Why even download the file? Cant you just get the source of it using _INetGetSource('www.url.com/ip.php') ? And then parse the results if needed?-or- #include<inet.au3> $ip = _GetIP() 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.
Lakes Posted March 31, 2006 Posted March 31, 2006 -or- #include<inet.au3> $ip = _GetIP() The beta help file needs a better search function... Thanks for the help, anyway! 2015 - Still no flying cars, instead blankets with sleeves.
Developers Jos Posted March 31, 2006 Developers Posted March 31, 2006 The beta help file needs a better search function... Open Search page and type "IP" and hit List_Topics... second hit ... not bad i would say 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.
Lakes Posted April 1, 2006 Posted April 1, 2006 Open Search page and type "IP" and hit List_Topics... second hit ... not bad i would say I`m sure that the last time it only listed the Macros.if you type getIP in the search tab it does`nt return a listing, but if you type the same thing in the Index, it does!Not exactly consistent.... 2015 - Still no flying cars, instead blankets with sleeves.
Developers Jos Posted April 1, 2006 Developers Posted April 1, 2006 (edited) I`m sure that the last time it only listed the Macros.if you type getIP in the search tab it does`nt return a listing, but if you type the same thing in the Index, it does!Not exactly consistent....Some people are never happy ... The index is a sorted list of keywords and ignores leading underscores, but the search doesn't..If your not happy with that you need to write to our friends at Microsoft since we are using standard Helpfile functionality ...oh and when you type "get ip address" is does show up , which to me looks like a more logical search..... Edited April 1, 2006 by JdeB 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.
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