This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

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

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Locked
e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

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

Post by eXtremer »

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

Code: Select all

<@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: Select all

### !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
}
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

Ask the autor.

Code: Select all

# 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
e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

Post by eXtremer »

Nor7on wrote:Ask the autor.

Code: Select all

# 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 :(
Waiting for other coders help..
e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

Post by eXtremer »

Nobody ? :(
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

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: Select all

   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: Select all

   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... :roll:
Last edited by speechles on Thu Aug 14, 2008 8:15 am, edited 1 time in total.
e
eXtremer
Op
Posts: 138
Joined: Wed May 07, 2008 5:33 am

Post by eXtremer »

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... :roll:
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:
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

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:
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. ;)
User avatar
slennox
Owner
Posts: 593
Joined: Sat Sep 22, 2001 8:00 pm
Contact:

Post by slennox »

Locking this thread. Thread bumping isn't allowed as stated in the forum description, nor are personal attacks.
Locked