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.

Capital and Lower-case bans not being recognized by a script

Old posts that have not been replied to for several years.
Locked
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Capital and Lower-case bans not being recognized by a script

Post by Sir_Fz »

Here goes the script:

Code: Select all

bind mode - "* +b" channel:ban

proc channel:ban {nick uhost hand chan mc ban} {
  if {[string match "$ban" "$::botname"] && [botisop $chan]} {
    putquick "MODE $chan -bo $ban $nick"
    putquick "PRIVMSG Chanserv@Services.dal.net :deop $chan $nick"
    if {[matchattr $hand mn|mn $chan] == 0} {
      set mask "*!*@[lindex [split $uhost @] 1]"
      putkick $chan $nick "Don't Ban me, You know that's not a good idea."
      putquick "MODE $chan +b $mask"
    }
  }
}
scripted recently by the help of caezer.

it doesn't work when for example:
the bot's nick is Bot
*if an op bans Bot!*@*; the script works
*if an op bans bot!*@*; the script doesn't work
also (considering the bot's host is HoST.net):
*if an op bans *!*@HoST.net; the script works
*if an op bans *!*@hosT.net or *!*@Host.net or...(u do the permutation:p); the script doesn't work

hope u got what the problem is, and can somebody answer my last reply in the "Action Advertise detecting" post :P
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

use 'string match -nocase ...'
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

ok, how please ?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

replace from:

Code: Select all

if {[string match "$ban" "$::botname"] && [botisop $chan]} { 
to:

Code: Select all

if {[string match -nocase "$ban" "$::botname"] && [botisop $chan]} {
and btw, is caesar not caezer :P
Once the game is over, the king and the pawn go back in the same box.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Thanx, I'll learn this one :P
and yeah I realized that its caesar adter i posted this thread :P
Locked