egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help customizing a script - adding user IP to the list

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
m4rtin
Voice


Joined: 31 May 2007
Posts: 1

PostPosted: Wed Dec 26, 2007 4:12 am    Post subject: Help customizing a script - adding user IP to the list Reply with quote

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:
nick - 255.255.255.0
nick2 - 192.168.1.100
etc


The current code I have now is:
Code:

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
Back to top
View user's profile Send private message
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sat Jan 05, 2008 10:55 pm    Post subject: Reply with quote

From tcl-commands.doc:

Code:
  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
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber