Was fiddling around with something, and in in tcl-commands.doc I found the
myip command.
Tried this, from partyline:
.tcl putserv "privmsg mynick : [myip] "
and the bot promptly sent me a ten digit number.
What is it? some sort of encoding of the bot's true ip number?
nml375 wrote:It is the 32bit representation of your IP-address. Given the IP-address aaa.bbb.ccc.ddd, the 'long-IP' would be (2^24)*aaa+(2^16)*bbb+(2^8)*ccc+ddd.
Thanks for explaining.
It is interesting. How would one make use of it though?
# longip: Converts the long value of an ip to it's dotted quad ip.
proc longtoip {long} {
format "%u.%u.%u.%u" [expr $long>>24] [expr ($long>>16)&255] [expr ($long>>8)&255] [expr $long&255];
}