egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

what is that number, returned by [myip] ?

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Fri Jan 01, 2010 3:29 pm    Post subject: what is that number, returned by [myip] ? Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Fri Jan 01, 2010 3:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Tue Jan 05, 2010 2:20 pm    Post subject: Reply with quote

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^Cool*ccc+ddd.


Thanks for explaining.

It is interesting. How would one make use of it though?
Back to top
View user's profile Send private message
username
Op


Joined: 06 Oct 2005
Posts: 196
Location: Russian Federation, Podolsk

PostPosted: Tue Jan 05, 2010 3:39 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Jan 06, 2010 12:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber