This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

How do i resolve my ip

Old posts that have not been replied to for several years.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

How do i resolve my ip

Post by Ofloo »

I got a dynamic ip and i would like to use my ip in a script, the problem is the server has hidden ips you can't resolve them it has some strange figurs in it what i do to get a var = $ip ????
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

Use "winipcfg" in windows.

Use ifconfig in *nix.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

i know but i want the bot to do it auto and make a var for it so i can use that var in a script
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

like when i got like 20 bots on dynamic ip (windrops) and i want to use an ip in a script, suppose i need to update 20 bots there ips daily that would be unhuman ... but i am not talking about 20 i will have more ...
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

this

Code: Select all

set s [socket -server "" -myaddr [info hostname] 0];
set ip [lindex [fconfigure $s -sockname] 0]
close $s
might work.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

how do i use this i tryed $ip but .. ??
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

You use this in the place of the normal "set ip" information.

Have you even tried?
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

sorry i am kinda new to this but is it in the config script (eggdrop.conf) or did i understand wrong ??
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Put it where ever you like. You asked for a variable containing the ip. The example i showed you should provide you with one.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

if that is the case i did it and still won't resolve the var $ip in a script ??

on trigger i get this

[09:03]Tcl error [send_ipinfo]: can't read "ip": no such variable
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

this works but crashed every time when i rehash, on startup np but on rehash crash .. ?

Code: Select all

set myip [regexp -inline {\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}} [exec ipconfig] ]
the above is one line
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Ofloo wrote:[09:03]Tcl error [send_ipinfo]: can't read "ip": no such variable
Did you create/import the variable inside the proc?
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

hmm no i just put it in top of the script like a var
example

bind ...
bind ...

set ...
set your script

proc ...
proc ...

so what do i exactly do with it ? not sur what you mean ..
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

If you want to use a global variable inside a proc you have to import it or address it directly. But this particular value is better suited for creation on-the-fly when you need it...

make it a proc and call that proc where ever you need the ip

Code: Select all

proc myIP {} {
    set s [socket -server "" -myaddr [info hostname] 0]; 
    set ip [lindex [fconfigure $s -sockname] 0] 
    close $s
    set ip
}
then insert [myIP] where you want the ip to appear
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

oh my mestake see what you mean :( sorry hehe

i see what you mean tnx verry mutch
Locked