| View previous topic :: View next topic |
| Author |
Message |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Fri Jan 01, 2010 3:29 pm Post subject: what is that number, returned by [myip] ? |
|
|
Hello,
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?
Thanks |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Fri Jan 01, 2010 3:46 pm Post subject: |
|
|
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. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Tue Jan 05, 2010 2:20 pm Post subject: |
|
|
| 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^ *ccc+ddd. |
Thanks for explaining.
It is interesting. How would one make use of it though? |
|
| Back to top |
|
 |
username Op

Joined: 06 Oct 2005 Posts: 196 Location: Russian Federation, Podolsk
|
Posted: Tue Jan 05, 2010 3:39 pm Post subject: |
|
|
You may convert it into normal ip useing this proc from fsck function library v1.19 by perpleXa: | Code: | # 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];
}
|
_________________ Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/ |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Wed Jan 06, 2010 12:16 pm Post subject: |
|
|
willyw,
One of the main uses for the 'longip' version with eggdrops are for dcc chat/send requests _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|