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.

Add/Remove IP in a file on Join/Quit

Old posts that have not been replied to for several years.
Locked
r
rantanplan

Add/Remove IP in a file on Join/Quit

Post by rantanplan »

Hello,i'm looking for a small script that writes the IP adress of peoples nick to a text file when they join my channel.. And then when they part/quit, their IP adress is removed from the file..
Any help?
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

To resolve the host you can use the dns module.

Here's an example..

Code: Select all

bind join - * jip
proc jip {n u h c} {
 set uh [lindex [split $u @] 1]
 set ip [dnslookup $uh resip]
 # ...
}

proc resip {i h s} {
 if {$i!="0.0.0.0"} {
   return $i
  } {
   return $h
 }
}
You'll find more info about reading/writing to a file here.

Good Luck!
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

you better maintain those hosts/IPs in a list, saving it periodically in a file
Locked