So you wish to create a file, with a list of users. Is this of eggdrop overall, or just a channel.
I am guessing just a channel
Code: Select all
proc fileusers {chan file} {
if {![validchan $chan]} { return -1 }
set l1 [chanlist $chan]
set l2 {}
set l3 {}
foreach u $l1 {
if {[isop $u $chan]} {
lappend l3 "@"
} elseif {[isvoice $u $chan]} {
lappend l3 "+v"
} else {
lappend l3 ""
}
#lappend l3 [lindex [split [getchanhost $nick $chan] @] 0]
lappend l3 [nick2hand $u $chan]
lappend l3 [getchanidle $u $chan]
#lappend l3 [maskhost "${u}[getchanhost $u $chan]"]
lappend l3 "${u}[getchanhost $u $chan]"
lappend l2 [join $l3 {,}]
set l3 {}
}
set fp [open "${file}.users" w]
puts $fp [join l1 {,}]
catch {close $fp}
set fp [open "${file}.status" w]
puts $fp [join $l2 \n]
catch {close $fp}
}
It was not clear what you wanted for username or hostmask.
As such, it currently uses the username from the "nick!username@host". You can comment out that line, and uncomment the toher, to use the handle they have on the bot.
Also, the hostmask was not clear. Do you want a mask (*!*user@*.host) or the IRC userhost (nick!user@host). It currently uses the userhost.