Code: Select all
.tcl foreach u [userlist] {if {$u != "yourbothandle"} {deluser $u}}
.save
1.) connect to your shell account.stevegarbz wrote:Is there a way to mass delete ALL the users in the userfile? I don't want to do 160 deletes seperate because some idiot didn't know what he was doing?
You do not have to add yourself, flags, owner status, etc.awyeah wrote:That's totally deleting the user file and creating a new one. I think no one would do that, because they would have to add themselves, their flags etc and owner settings back in again. Only remove all the other users, except yourself which is obvious.
Code: Select all
foreach user [userlist] {
if {![matchattr $user n]} { deluser $user }
}
I have been toying with the above and have so far come up with the following:MeTroiD wrote:Would delete all users except the owners. :\Code: Select all
foreach user [userlist] { if {![matchattr $user n]} { deluser $user } }
Code: Select all
set userdel(trigger) "$::botnick"
set cmdchar_ "!"
proc cmdchar { } {global cmdchar_; return $cmdchar_}
bind pub - [cmdchar]$userdel(trigger) pub_userdel
proc pub_userdel {nick uhost hand chan rest} {
global userdel
set rest [stripcodes bcruag $rest]
if {![matchattr $hand n]} {sendnotc "notice $nick :I don't like you."; return}
set cmd [strlwr [lindex $rest 0]]
if {[string match {userdel} $cmd]} {
set thechan [strlwr [lindex $rest 1]]
if {$thechan != ""} {
set thechan [chanaddapt $thechan]
} elseif {$thechan == ""} {
set thechan $chan
}
if {![validchan $thechan]} {sendnotc "notice $nick :I'm not on $thechan."; return}
sendnotc "notice $nick :\002***\002 Deleting user list of $thechan \002***"
if {[userlist $thechan] == ""} {
sendnotc "notice $nick :No Entries."
} else {
foreach user [userlist |nmov $thechan] {
if {[matchattr $user bof]} { continue }
deluser $user
}}
sendnotc "notice $nick :\002*** Users deleted! ***"
} else {sendnotc "notice $nick :Error! Use: $::cmdchar_$userdel(trigger) userdel \[channel\]."; return}
}
# chanaddapt - checks channel name and adds # if needed.
proc chanaddapt {chan} {
if {[string index $chan 0] != "#" && [string index $chan 0] != "&"} {
set newchan #$chan
return $newchan
}
return $chan
}
# end chanaddapt
proc sendnotc {text} {
putquick "$text"
}