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.

Help customizing a script - adding user IP to the list

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
m
m4rtin
Voice
Posts: 1
Joined: Thu May 31, 2007 3:55 pm

Help customizing a script - adding user IP to the list

Post by m4rtin »

Hi, I'm trying to find a way to modify a modified version of Write Channel Nicklist 2 File by SpOoK.

What I'm trying to do is to add the users IP address after the nick. Like this

Code: Select all

nick - 255.255.255.0
nick2 - 192.168.1.100
etc
The current code I have now is:

Code: Select all

set ver "1.1-opp"
set dumpfile "/nicklist.txt"
set channel "#channelname"

# Bind Events we want to catch...
# Note: Remove the following 6 lines for timer only update. Reccomended for larger channels.
bind sign - "$channel %" nicklist:make
bind part - "$channel %" nicklist:make
bind splt - "$channel %" nicklist:make
bind join - "$channel %" nicklist:make
bind kick - "$channel %" nicklist:make
bind nick - "$channel %" nicklist:make
bind mode - "$channel %" nicklist:make

bind raw - "353" nicklist_opp:make

proc nicklist:make {args} {
global channel
putserv "NAMES $channel"
}

proc nicklist_opp:make {from keyword argz} {

global dumpfile channel botnick

set nicklist [split [lindex [split [string trim $argz] ":"] 1] " "]

set templist ""
set ownerlist ""
set protlist ""
set oplist ""
set hoplist ""
set voicelist ""
set userlist ""

foreach user $nicklist {
if {[string first "~" $user] == 0} {
lappend ownerlist $user
} elseif {[string first "!" $user] == 0} {
lappend protlist $user
} elseif {[string first "@" $user] == 0} {
lappend oplist $user
} elseif {[string first "%" $user] == 0} {
lappend hoplist $user
} elseif {[string first "+" $user] == 0} {
lappend voicelist $user
} else {
lappend userlist $user
}
}

set ownerlist [lsort -dictionary $ownerlist]
set protlist [lsort -dictionary $protlist]
set oplist [lsort -dictionary $oplist]
set hoplist [lsort -dictionary $hoplist]
set voicelist [lsort -dictionary $voicelist]
set userlist [lsort -dictionary $userlist]

foreach user $ownerlist {
lappend templist $user
}
foreach user $protlist {
lappend templist $user
}
foreach user $oplist {
lappend templist $user
}
foreach user $hoplist {
lappend templist $user
}
foreach user $voicelist {
lappend templist $user
}
foreach user $userlist {
lappend templist $user
}

set outputfile [open $dumpfile w]

foreach user $templist {
puts $outputfile $user
}

close $outputfile

putlog "Saving $channel NickList..."

return 1
}
if {![info exists nicklist_running]} {
timer 60 nicklist:make
set nicklist_running 1
}
nicklist:make
putlog "Write Channel Nicklist to File v$ver by SpOoK loaded."
Thanks in advanse!


Regards,
Martin
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

From tcl-commands.doc:

Code: Select all

  dnslookup <ip-address/hostname> <proc> [[arg1] [arg2] ... [argN]]
    Description: This issues an asynchronous dns lookup request. The
      command will block if dns module is not loaded; otherwise it will
      either return immediately or immediately call the specified proc
      (e.g. if the lookup is already cached).

      As soon as the request completes, the specified proc will be called
      as follows:

       <proc> <ipaddress> <hostname> <status> [[arg1] [arg2] ... [argN]]

      status is 1 if the lookup was successful and 0 if it wasn't. All
      additional parameters (called arg1, arg2 and argN above) get
      appended to the proc's other parameters.
    Returns: nothing
    Module: core
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Post Reply