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.

invalid command name? [solved]

Help for those learning Tcl or writing their own scripts.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Well, looking at that .dccstatus output, it would seem your eggdrop is behind a masquerading router.

Code: Select all

...
<FredGibson> 14   C0A8000B  1026 DJCharlie JCharlie@kjsr.net chat  flags: cPtEp/0 
...
C0A8000B translates to 192.168.0.11, which is within the 192.168.0.0/16 net dedicated for private networks, and which cannot be present on the internet. Since your eggdrop can see this address, it would thus also have to reside within the same network, behind a masquerading router (NAT).

There are several ways of checking your public IP. Unless your irc network cloaks your true hostname, simply check the host part of your eggdrop's nick!user@host. You could also visit http://checkip.dyndns.org using a browser located behind the very same NAT. You could also do a DNS-lookup of the dyndns hostname, as long as this is kept updated by your router.

Once you have the IP address, you'll have to set nat-ip to that address, and rehash.
NML_375
D
DJCharlie
Voice
Posts: 37
Joined: Wed May 06, 2009 10:45 am
Contact:

Post by DJCharlie »

But what do I do when the IP changes, since it's dynamic? Can I set it to the dyndns-supplied domainname?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

As I recall, nat-ip has to be an IP address. Thus, you'd have to alter this setting each time your public IP address changes. You could use the init-server evnt binding to update the nat-ip value on the fly, using some creative scripting though...

This scriptlet should retrieve the IP from the foobar.dyndns.org hostname and update nat-ip everytime your eggdrop connects to a server...

Code: Select all

bind evnt - init-server evnt:init_server

proc evnt:init_server {type} {
  dnslookup foobar.dyndns.org evnt:got_dnsreply
}

proc evnt:got_dnsreply {ip hostname status} {
  if {$status == 1} {
    set nat-ip $ip
  }
}
NML_375
D
DJCharlie
Voice
Posts: 37
Joined: Wed May 06, 2009 10:45 am
Contact:

Post by DJCharlie »

Ok, changed it to the router's address, and it works, except for one little problem...

Code: Select all

<FredGibson> [17:03] Sending /mnt/music/C/Collective Soul/Collective Soul - Better Now.mp3 to DJCharlie.
<FredGibson> [17:04] Lost dcc get Collective_Soul_-_Better_Now.mp3 from DJCharlie!irc
Client side shows this:

Code: Select all

* DCC RECV connection established to FredGibson [67.140.173.178:4500]
* DCC RECV Collective_Soul_-_Better_Now.mp3 from FredGibson complete [67720 cps]
But the file never actually makes it to the destination.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

That would suggest that the client closes the connection prematurely. Unfortunately, I don't have any good ideas as to why right now.
NML_375
D
DJCharlie
Voice
Posts: 37
Joined: Wed May 06, 2009 10:45 am
Contact:

Post by DJCharlie »

I don't know why, but it's working now.

Next question... How can I optimize the search function? It was mentioned up-thread to use glob, but I have no clue how to do that, and my DJs are searching through 471,000+ files.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

To use the glob command, start by reading the manpage http://www.tcl.tk/man/tcl8.4/TclCmd/glob.htm

Optimizing a search-set of 471,000+ files with simple file operations is not a simple task. You could look at using some kind of DB storage like mysql for that (though this brings a different issue of sync:ing the database and files...).
NML_375
D
DJCharlie
Voice
Posts: 37
Joined: Wed May 06, 2009 10:45 am
Contact:

Post by DJCharlie »

Yeah. Considering we get new music (legally, from the labels!) weekly, keeping a db in sync would be a pain.

I'll try out globbing though. Anything to shave off a few seconds. :) Thanks again!
Post Reply