| View previous topic :: View next topic |
| Author |
Message |
eXtremer Op
Joined: 07 May 2008 Posts: 138
|
Posted: Tue Sep 02, 2008 1:26 pm Post subject: !deluser is not working if nick is not on chan |
|
|
<@eXtremer> !deluser nick
-Bot- Sorry, but I don't see nick in #testing.
| Code: | ### !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. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Sep 02, 2008 1:30 pm Post subject: |
|
|
Use the native .-user command from the dcc partyline. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
eXtremer Op
Joined: 07 May 2008 Posts: 138
|
Posted: Wed Sep 03, 2008 2:18 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
eXtremer Op
Joined: 07 May 2008 Posts: 138
|
Posted: Fri May 08, 2009 7:57 am Post subject: |
|
|
The same question...maybe someone knows how to fix it ? Or at least give me another code (script) that will work as I wish.
Thank you. |
|
| Back to top |
|
 |
BLaCkShaDoW Op

Joined: 11 Jan 2009 Posts: 115 Location: Romania
|
Posted: Fri May 08, 2009 2:51 pm Post subject: Re: !deluser is not working if nick is not on chan |
|
|
| eXtremer wrote: | <@eXtremer> !deluser nick
-Bot- Sorry, but I don't see nick in #testing.
| Code: | ### !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. |
You should remove this :
| Code: | if {![onchan $nick $chan]} {
puthelp "NOTICE $me :Sorry, but I don't see $nick in $chan."
return 0
} |
_________________ BLaCkShaDoW Production @ WwW.TclScripts.Net |
|
| Back to top |
|
 |
eXtremer Op
Joined: 07 May 2008 Posts: 138
|
Posted: Sat May 09, 2009 6:41 am Post subject: Re: !deluser is not working if nick is not on chan |
|
|
| BLaCkShaDoW wrote: | You should remove this :
| Code: | if {![onchan $nick $chan]} {
puthelp "NOTICE $me :Sorry, but I don't see $nick in $chan."
return 0
} |
|
I removed the lines but now the Bot says that the User I want to delete is not a registered one =>
DCC:
.userlist +o #chan
List of my users : Enigma ClubH0uSe ReSpEkT Bastty- sAd\\ monck dns AndreuLs Semafoare ZyklonB kid^ Igorash Pisi` desc MrKry Nicushor W1nd0ws op mira- Aycha
On chan:
<+Me> !deluser Enigma
-Bot- Enigma is not a registered user. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat May 09, 2009 10:21 am Post subject: |
|
|
It's related to this line:
| Code: | | set hand [nick2hand $nick $chan] |
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... _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
eXtremer Op
Joined: 07 May 2008 Posts: 138
|
Posted: Sat May 09, 2009 11:18 am Post subject: |
|
|
| nml375 wrote: | It's related to this line:
| Code: | | set hand [nick2hand $nick $chan] |
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 ? |
|
| Back to top |
|
 |
BLaCkShaDoW Op

Joined: 11 Jan 2009 Posts: 115 Location: Romania
|
Posted: Mon May 11, 2009 9:13 am Post subject: |
|
|
| eXtremer wrote: | | nml375 wrote: | It's related to this line:
| Code: | | set hand [nick2hand $nick $chan] |
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 Production @ WwW.TclScripts.Net |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Mon May 11, 2009 9:48 am Post subject: |
|
|
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... _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
|