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.
Old posts that have not been replied to for several years.
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Wed May 21, 2003 3:15 pm
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 ????
ppslim
Revered One
Posts: 3914 Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England
Post
by ppslim » Wed May 21, 2003 6:07 pm
Use "winipcfg" in windows.
Use ifconfig in *nix.
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Wed May 21, 2003 6:09 pm
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
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Fri May 23, 2003 11:22 am
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
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Fri May 23, 2003 12:11 pm
this
Code: Select all
set s [socket -server "" -myaddr [info hostname] 0];
set ip [lindex [fconfigure $s -sockname] 0]
close $s
might work.
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Sat May 24, 2003 7:13 pm
how do i use this i tryed $ip but .. ??
ppslim
Revered One
Posts: 3914 Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England
Post
by ppslim » Sun May 25, 2003 10:02 am
You use this in the place of the normal "set ip" information.
Have you even tried?
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Mon May 26, 2003 4:49 am
sorry i am kinda new to this but is it in the config script (eggdrop.conf) or did i understand wrong ??
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Mon May 26, 2003 5:04 am
Put it where ever you like. You asked for a variable containing the ip. The example i showed you should provide you with one.
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Mon May 26, 2003 5:08 am
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
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Mon May 26, 2003 5:11 am
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
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Mon May 26, 2003 5:24 am
Ofloo wrote: [09:03]Tcl error [send_ipinfo]: can't read "ip": no such variable
Did you create/import the variable inside the proc?
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Mon May 26, 2003 6:54 am
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
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Mon May 26, 2003 6:57 am
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
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Mon May 26, 2003 6:59 am
oh my mestake see what you mean
sorry hehe
i see what you mean tnx verry mutch