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 

Fix !ban *!*@* in lol.tcl

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
eXtremer
Op


Joined: 07 May 2008
Posts: 138

PostPosted: Tue Aug 12, 2008 12:37 pm    Post subject: Fix !ban *!*@* in lol.tcl Reply with quote

Hi all.
I'm using lol.tcl, I've noticed today that the bot reacts on the !ban *!*@* mask, this is what happens:

Code:
<@eXtremer> !ban *!*@*
*** Bot sets mode: +b *!*@*
*** [Banned]: Bot eXtremer nick1 nick2
*** BAN on you detected!!! (*!*@*)
*** eXtremer sets mode: -bo *!*@* Bot
*** You were kicked by Bot (Requested, (18:55/12.08.2008), by eXtremer)
*** Rejoined #channel


Could smb help me to make chanes to the code, so the bot would not ban on *!*@* mask, thanks in advance.

Here is the code:

Code:
### !BAN <nick|mask> [time] [reason]

proc pub_lol_ban {nick host hand chan arg} {
   set arg [charfilter $arg]
   global lol botnick
   if {![check $hand $nick $host]} {
      if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
            puthelp "NOTICE $nick :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 $nick :\002Usage:\002 [string trim $lol(cmdchar)]ban <nick|mask> \[time\] \[reason\]"
      return 0
   }
   set who [lindex $arg 0]
   if {[strlwr $who] == [strlwr $botnick]} {
      puthelp "NOTICE $nick :Yeah right, like I'm going to let you ban ME!"
      return 0
   }
   
   set ti [lindex $arg 1]
   if {[isnumber $ti]} {
      set reason [lrange $arg 2 end]
   } {
      set ti ""
      set reason [lrange $arg 1 end]
   }

   if {$reason == ""} { set reason "requested" }
   
   if {[onchan $who $chan]} {
      if { $lol(bantype) == 0 } {
         set ipmask [lindex [split [maskhost $who![getchanhost $who $chan]] "@"] 1]
         set usermask [lindex [split [getchanhost $who $chan] "@"] 0]      
         set banmask *!*$usermask@$ipmask
      } else {
         set banmask [getchanhost $who $chan]
                 set banmask "*!*[string range $banmask [string first @ $banmask] e]"
      }   
   } else {        
      set banmask [lindex $arg 0]
      if {[string first "!" $banmask] == -1 && [string first "@" $banmask] == -1} {
         if {[isnumber [string index $banmask 0]]} {
            set banmask *!*@$banmask
         } else {
             set banmask $banmask*!*@*
         }
      }
      if {[string first "!" $banmask] == -1} { set banmask *!*$banmask }
      if {[string first "@" $banmask] == -1} { set banmask $banmask*@* }
   }
                  
   if {![botisop $chan]} { return 0 }
   putserv "MODE $chan +b $banmask"

     foreach chanuser [chanlist $chan] {
         if {[string match [strlwr $banmask] [strlwr "$chanuser![getchanhost $chanuser $chan]"]] && $chanuser != $botnick } {
         if {[nick2hand $chanuser $chan] != "*"} {
            if {$hand != [nick2hand $chanuser $chan]} {
               if {[matchattr [nick2hand $chanuser $chan] o|o $chan] && ![matchattr $hand o|o $chan]} {
                                 puthelp "NOTICE $nick :Sorry, you must be an operator to ban an operator."
                  return 0
               }
               if {([matchattr [nick2hand $chanuser $chan] m|m $chan] || [matchattr [nick2hand $who $chan] b]) && ![matchattr $hand m|m $chan]} {
                                 puthelp "NOTICE $nick :Sorry, you must be a master to ban a master or a bot."
                  return 0
               }
            }
         }
                putkick $chan $chanuser $reason
      }
       }   

   switch $ti {
      ""
      {
         newchanban $chan $banmask $nick $reason
         puthelp "NOTICE $nick :New mask added : $banmask"
      }
      0
      {
         newchanban $chan $banmask $nick $reason $ti
         puthelp "NOTICE $nick :New mask added permanently : $banmask"
      }
      default
      {
         newchanban $chan $banmask $nick $reason $ti
         puthelp "NOTICE $nick :New mask added for $ti minutes : $banmask"
      }
   }
   return 0
}
Back to top
View user's profile Send private message
Nor7on
Op


Joined: 03 Mar 2007
Posts: 185
Location: Spain - Barcelona

PostPosted: Tue Aug 12, 2008 12:48 pm    Post subject: Reply with quote

Ask the autor.

Code:
# HomePage: http://www.leonini.net/
#
# ORIGINAL AUTHOR: Lorenzo Leonini alias RB_____
#    E-MAIL: lolstoolz@leonini.net   ICQ: 22245831
#
# NEW MAINTENER: Yoann SERVANT alias Thor
#   E-MAIL: yservant@free.fr   ICQ: 50383313
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
eXtremer
Op


Joined: 07 May 2008
Posts: 138

PostPosted: Tue Aug 12, 2008 1:42 pm    Post subject: Reply with quote

Nor7on wrote:
Ask the autor.

Code:
# HomePage: http://www.leonini.net/
#
# ORIGINAL AUTHOR: Lorenzo Leonini alias RB_____
#    E-MAIL: lolstoolz@leonini.net   ICQ: 22245831
#
# NEW MAINTENER: Yoann SERVANT alias Thor
#   E-MAIL: yservant@free.fr   ICQ: 50383313


I already said in a post, I've contacted him once but he said that LoL Toolz is already history for him, he is not offering support anymore Sad
Waiting for other coders help..
Back to top
View user's profile Send private message
eXtremer
Op


Joined: 07 May 2008
Posts: 138

PostPosted: Thu Aug 14, 2008 6:31 am    Post subject: Reply with quote

Nobody ? Sad
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu Aug 14, 2008 7:57 am    Post subject: Reply with quote

Change this part, which is flawed. There are lots of things wrong in this script, namely using list commands on strings and other clumsy behavior. But let us just do what you asked us to do.

Simply change this, which looks if the botnick is banned..there are other ways to ban the bot and this script is lame.
Code:
   set who [lindex $arg 0]
   if {[strlwr $who] == [strlwr $botnick]} {
      puthelp "NOTICE $nick :Yeah right, like I'm going to let you ban ME!"
      return 0
   }
   
   set ti [lindex $arg 1]
   if {[isnumber $ti]} {
      set reason [lrange $arg 2 end]
   } {
      set ti ""
      set reason [lrange $arg 1 end]
   }

   if {$reason == ""} { set reason "requested" }
   
   if {[onchan $who $chan]} {
      if { $lol(bantype) == 0 } {
         set ipmask [lindex [split [maskhost $who![getchanhost $who $chan]] "@"] 1]
         set usermask [lindex [split [getchanhost $who $chan] "@"] 0]     
         set banmask *!*$usermask@$ipmask
      } else {
         set banmask [getchanhost $who $chan]
                 set banmask "*!*[string range $banmask [string first @ $banmask] e]"
      }   
   } else {       
      set banmask [lindex $arg 0]
      if {[string first "!" $banmask] == -1 && [string first "@" $banmask] == -1} {
         if {[isnumber [string index $banmask 0]]} {
            set banmask *!*@$banmask
         } else {
             set banmask $banmask*!*@*
         }
      }
      if {[string first "!" $banmask] == -1} { set banmask *!*$banmask }
      if {[string first "@" $banmask] == -1} { set banmask $banmask*@* }
   }
                 
   if {![botisop $chan]} { return 0 }

This will detect all bans placed against the bot, which *!*@* will be detected as a ban against the bot, because it is. This makes the script somewhat less lame, but all the list commands on string problems still make this script lame to a certain degree.
Code:
   set who [lindex [split $arg] 0]
   if {![botisop $chan]} {
      puthelp "NOTICE $nick :There is nothing I can do without having @op silly!"
      return 0
   }
   
   set ti [lindex [split $arg] 1]
   if {[isnumber $ti]} {
      set reason [lrange [split $arg] 2 end]
   } {
      set ti ""
      set reason [lrange [split $arg] 1 end]
   }

   if {$reason == ""} { set reason "requested" }
   
   if {[onchan $who $chan]} {
      if { $lol(bantype) == 0 } {
         set ipmask [lindex [split [maskhost $who![getchanhost $who $chan]] "@"] 1]
         set usermask [lindex [split [getchanhost $who $chan] "@"] 0]     
         set banmask *!*$usermask@$ipmask
      } else {
         set banmask [getchanhost $who $chan]
                 set banmask "*!*[string range $banmask [string first @ $banmask] e]"
      }   
   } else {       
      set banmask [lindex [split $arg] 0]
      if {[string first "!" $banmask] == -1 && [string first "@" $banmask] == -1} {
         if {[isnumber [string index $banmask 0]]} {
            set banmask *!*@$banmask
         } else {
             set banmask $banmask*!*@*
         }
      }
      if {[string first "!" $banmask] == -1} { set banmask *!*$banmask }
      if {[string first "@" $banmask] == -1} { set banmask $banmask*@* }
   }
                 
   if {[string match -nocase $banmask "[maskhost $::botnick![getchanhost $::botnick $chan]]"]} {
     puthelp "NOTICE $nick :Yeah right, like I'm going to let you ban ME!"
     return 0
   }

Posting a reply such as "Anyone?" (aka ferris bueller) or "Nobody?" (aka you) as the only part of it implies you are an impatient bastard and think everybody should cater to your whims instantly. The fact you have to wait even a day pisses you off because someone should have helped you. Um,. this is arrogance. For future knowledge, appearing this way is actually detrimental to your cause. It actually makes it less likely help will arrive... Rolling Eyes
_________________
speechles' eggdrop tcl archive


Last edited by speechles on Thu Aug 14, 2008 8:15 am; edited 1 time in total
Back to top
View user's profile Send private message
eXtremer
Op


Joined: 07 May 2008
Posts: 138

PostPosted: Thu Aug 14, 2008 8:11 am    Post subject: Reply with quote

speechles wrote:

Posting a reply such as "Anyone?" (aka ferris bueller) or "Nobody?" (aka you) as the only part of it implies you are an impatient bastard and think everybody should cater to your whims instantly. The fact you have to wait even a day pisses you off because someone should have helped you. Um,. this is arrogance. For future knowledge, appearing this way is actually detrimental to your cause. It actually makes it less likely help will arrive... Rolling Eyes


I c that you have somethin` against me and I c u FAQin` love to offence, I don't need u`r [censored]` help if I'm helped this way, after 2 days without a reply, what I'm supposed to do..?
So FAQ U if you have somethin` against me...

P.S. 10x for "the help", you actually should remain speechles!
Evil or Very Mad
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu Aug 14, 2008 8:20 am    Post subject: Reply with quote

extreme d00d wrote:
I c that you have somethin` against me and I c u FAQin` love to offence, I don't need u`r [censored]` help if I'm helped this way, after 2 days without a reply, what I'm supposed to do..?
So FAQ U if you have somethin` against me...

P.S. 10x for "the help", you actually should remain speechles!
Evil or Very Mad

Actually, I've seen you ridicule Incith when he misquoted some silly url. You even went as far as to paste a giant JPG of a 404 into the post. This makes you appear arrogant friend. Also, by seeing the use of the [censored] in your post, you've used the f-word? :O

And to follow your logic "I don't need u`r [censored]` help if I'm helped this way"... Then you add this "P.S. 10x for "the help", you actually should remain speechles! Evil or Very Mad".. So you don't want my help, but thanks for the help??? What it actually seems like is your angry that you cannot script such a simple change yourself that you feel we should all drop what we are doing to script it for you? The world doesn't work this way sir. You need to learn by osmosis. If you immerse yourself in something you do not understand for long enough, pretty soon you will understand it. Also, not to nit pick, but your use of internet shorthand and clumsy english leave much to be conveyed. It's difficult to understand much of your whatever your post was...

PS... My pseudonym choice, speechless (irc usually limits to 9 chars so drop that last s), isn't so much as meant for myself. It's the condition you are left in after I speak. Someone on usenet once said: "Your handle must be the reaction you leave on people when you open your mouth." - Larry Laffer

PPS... I have nothing against you at all. I just have something against the "If you whine for it, they will build it" mentality. The time commitment involving tcl advice to your personal endeavors comes at no charge.. This is free help, so if it never arrives, this is destiny. Accept it, don't contribute more pleas for help. Haven't you ever seen Angels in the Outfield? You have to build it, they will come. They being those such as yourself is now. You want to become a you, not a they. Wink
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
slennox
Owner


Joined: 22 Sep 2001
Posts: 593

PostPosted: Fri Aug 15, 2008 6:32 pm    Post subject: Reply with quote

Locking this thread. Thread bumping isn't allowed as stated in the forum description, nor are personal attacks.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Script Requests 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