### !DELUSER <nick>
proc pub_lol_deluser {me b c chan arg} {
set arg [charfilter $arg]
global lol botnick
if {![check $c $me $b]} {
if {$lol(silent) == 1 || [checksilent $c]} {return 0}
puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
return 0
}
if {[llength $arg] != 1} {
puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]deluser <nick>"
return 0
}
set nick [lindex $arg 0]
set bot [strlwr $botnick]
set hand [nick2hand $nick $chan]
if {![onchan $nick $chan]} {
puthelp "NOTICE $me :Sorry, but I don't see $nick in $chan."
return 0
}
if {[strlwr $nick] == $bot} {
puthelp "NOTICE $me :Yeah right, like I'm going to let you delete ME!"
return 0
}
if {[getting-users]} {
puthelp "NOTICE $me :Sorry, but I'm transferring the userfile, try later."
return 0
}
if {![validuser $hand]} {
puthelp "NOTICE $me :$nick is not a registered user."
return 0
}
if {[matchattr $hand n]} {
puthelp "NOTICE $me :You can't delete a bot owner."
return 0
}
deluser $hand
boot $hand "You have been deleted"
puthelp "NOTICE $me :$nick has been removed from the userlist."
puthelp "NOTICE $nick :You have been removed from the userlist by $me."
if {[botisop $chan]} {pushmode $chan -o $nick}
return 0
}
Is it possible to delete a username even if he is not on the channel ?!
Thanks in advance.
nml375 wrote:Use the native .-user command from the dcc partyline.
I know about the .-user partyline command, but there are local Owners that don't have acc to partyline (Only me, for security reasons & other..) that can't delete a user, so I need this pub cmd to work.
### !DELUSER <nick>
proc pub_lol_deluser {me b c chan arg} {
set arg [charfilter $arg]
global lol botnick
if {![check $c $me $b]} {
if {$lol(silent) == 1 || [checksilent $c]} {return 0}
puthelp "NOTICE $me :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
return 0
}
if {[llength $arg] != 1} {
puthelp "NOTICE $me :\002Usage:\002 [string trim $lol(cmdchar)]deluser <nick>"
return 0
}
set nick [lindex $arg 0]
set bot [strlwr $botnick]
set hand [nick2hand $nick $chan]
if {![onchan $nick $chan]} {
puthelp "NOTICE $me :Sorry, but I don't see $nick in $chan."
return 0
}
if {[strlwr $nick] == $bot} {
puthelp "NOTICE $me :Yeah right, like I'm going to let you delete ME!"
return 0
}
if {[getting-users]} {
puthelp "NOTICE $me :Sorry, but I'm transferring the userfile, try later."
return 0
}
if {![validuser $hand]} {
puthelp "NOTICE $me :$nick is not a registered user."
return 0
}
if {[matchattr $hand n]} {
puthelp "NOTICE $me :You can't delete a bot owner."
return 0
}
deluser $hand
boot $hand "You have been deleted"
puthelp "NOTICE $me :$nick has been removed from the userlist."
puthelp "NOTICE $nick :You have been removed from the userlist by $me."
if {[botisop $chan]} {pushmode $chan -o $nick}
return 0
}
Is it possible to delete a username even if he is not on the channel ?!
Thanks in advance.
In order for eggdrop to convert a nickname into a handle, it needs to "see" the nickname => that is, the nickname has to be on a channel your eggdrop is monitoring. Further, this code tells your eggdrop to only look in the channel where the command was issued. Since the nickname is not there, this will return "*" indicating no such user... And the script will abort.
You could try removing the channel parameter on that line, but even so, this code would only work if the nickname is seen in one of your eggdrop's channels...
In order for eggdrop to convert a nickname into a handle, it needs to "see" the nickname => that is, the nickname has to be on a channel your eggdrop is monitoring. Further, this code tells your eggdrop to only look in the channel where the command was issued. Since the nickname is not there, this will return "*" indicating no such user... And the script will abort.
You could try removing the channel parameter on that line, but even so, this code would only work if the nickname is seen in one of your eggdrop's channels...
Understood nml375, thank you 4 exaplaining...but there has to be a way to fix the script. Nobody knows how to ? Or can smb give me another code ?
In order for eggdrop to convert a nickname into a handle, it needs to "see" the nickname => that is, the nickname has to be on a channel your eggdrop is monitoring. Further, this code tells your eggdrop to only look in the channel where the command was issued. Since the nickname is not there, this will return "*" indicating no such user... And the script will abort.
You could try removing the channel parameter on that line, but even so, this code would only work if the nickname is seen in one of your eggdrop's channels...
Understood nml375, thank you 4 exaplaining...but there has to be a way to fix the script. Nobody knows how to ? Or can smb give me another code ?
just replace [nick2hand $nick $chan] with [nick2hand $nick] and it will work
Blackshadow, it will only work under certain conditions, as mentioned in my previous post.
If we exclude the case of the user not being online at all, an "all case" solution would require a who/whois-request for the nickname in question, parsing of the response.
This would then have to be used to search the userlist for a match, which finally would be used to remove the user record.
This kind of scripting requires caution however, as you'd end up using raw bindings - and if not done properly, will screw up your eggdrop.
A much simpler approach would be to require the operator to know the handle rather than the nickname, as we wouldn't have to bother with various lookups...