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 

!deluser is not working if nick is not on chan

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
eXtremer
Op


Joined: 07 May 2008
Posts: 138

PostPosted: Tue Sep 02, 2008 1:26 pm    Post subject: !deluser is not working if nick is not on chan Reply with quote

<@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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue Sep 02, 2008 1:30 pm    Post subject: Reply with quote

Use the native .-user command from the dcc partyline.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
eXtremer
Op


Joined: 07 May 2008
Posts: 138

PostPosted: Wed Sep 03, 2008 2:18 am    Post subject: Reply with quote

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
View user's profile Send private message
eXtremer
Op


Joined: 07 May 2008
Posts: 138

PostPosted: Fri May 08, 2009 7:57 am    Post subject: Reply with quote

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
View user's profile Send private message
BLaCkShaDoW
Op


Joined: 11 Jan 2009
Posts: 115
Location: Romania

PostPosted: Fri May 08, 2009 2:51 pm    Post subject: Re: !deluser is not working if nick is not on chan Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
eXtremer
Op


Joined: 07 May 2008
Posts: 138

PostPosted: Sat May 09, 2009 6:41 am    Post subject: Re: !deluser is not working if nick is not on chan Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat May 09, 2009 10:21 am    Post subject: Reply with quote

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
View user's profile Send private message
eXtremer
Op


Joined: 07 May 2008
Posts: 138

PostPosted: Sat May 09, 2009 11:18 am    Post subject: Reply with quote

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
View user's profile Send private message
BLaCkShaDoW
Op


Joined: 11 Jan 2009
Posts: 115
Location: Romania

PostPosted: Mon May 11, 2009 9:13 am    Post subject: Reply with quote

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 Razz
_________________
BLaCkShaDoW Production @ WwW.TclScripts.Net
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon May 11, 2009 9:48 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases 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