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.

Need a litle help with script.

Old posts that have not been replied to for several years.
Locked
k
kodikas

Need a litle help with script.

Post by kodikas »

Ok.I have one script that kick+ban people that joins with bad nick and send a msg to them.I Whant that this script only kick people without baning them.

Code: Select all

bind join - * BandNick

proc BandNick {nick uhost hand chan} {
 putlog "$nick $uhost $hand $chan"
 global botnick BandNickChan BandNicks channel text
 if {(([lsearch -exact [string tolower $BandNickChan] [string tolower $chan]] != -1)  || ($BandNickChan == "*"))} {
  set temp 0
	foreach i [string tolower $BandNicks] {
	if {[string match *$i* [string tolower $nick]]} {
	set temp 1
 	}
 	}
	if {!$temp} { return }
  if {([ matchattr $hand n])} {
   return 1
   } elseif {[matchattr $hand 4]} {
   newchanban $chan $nick $botnick $BadReason perm
   chattr $hand +k4
   return 1
   } else {
   set BadReason ":D"
   newchanban $chan $nick $botnick $BadReason 60
   putserv "KICK $chan $nick :Cambia de nick por Favor..."
   putserv "PRIVMSG $nick :0,4Hola Disculpa La Molestia, pero estas Usando un NickName no permitido"
   putserv "PRIVMSG $nick :Por Favor Cambia de nick Si es quew Deseas Volver a entrar al Canal, "
   putserv "PRIVMSG $nick :Si Deseas cambiar de NickName (el nombre con el que estas ahora) Escribe: /Nick NickName"
   putserv "PRIVMSG $nick :Recuerda no ponerte nick's que contengan estas palabras: Activ, Pasiv, Sex, cm, put, Follado,"
   putserv "PRIVMSG $nick :Moderno, cacher, ping, verg, dotad, y nick's Obsenos o seras Baneado del canal, Gracias!"
   return 0
  }
 }
}

putlog "0,4Tcl Cargado Exitosamente :D"
Thanks a lot everyone for help
User avatar
KrzychuG
Master
Posts: 306
Joined: Sat Aug 16, 2003 2:51 pm
Location: Torun, Poland
Contact:

Post by KrzychuG »

I think that replacing:

Code: Select all

   } elseif {[matchattr $hand 4]} { 
   newchanban $chan $nick $botnick $BadReason perm 
   chattr $hand +k4 
   return 1 
   } else { 
   set BadReason ":D" 
   newchanban $chan $nick $botnick $BadReason 60
by

Code: Select all

   } else {
Should be enough ;)
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Just replace your script code by this entire
code, this should work.

It will only kick the nick out and not
ban it, both even if its an owner (+n)
or even if its an unrecognized (normal)
user to the bot.

Code: Select all

bind join - * BandNick 

proc BandNick {nick uhost hand chan} { 
 putlog "$nick $uhost $hand $chan" 
 global botnick BandNickChan BandNicks channel text 
 if {(([lsearch -exact [string tolower $BandNickChan] [string tolower $chan]] != -1)  || ($BandNickChan == "*"))} { 
  set temp 0 
   foreach i [string tolower $BandNicks] { 
   if {[string match *$i* [string tolower $nick]]} { 
   set temp 1 
    } 
    } 
   if {!$temp} { return } 
  if {([ matchattr $hand n])} { 
   return 1 
   } elseif {[matchattr $hand 4]} { 
   putquick "KICK $chan $nick :$BadReason"
   chattr $hand +k4 
   return 1 
   } else { 
   set BadReason ":D" 
   putquick "KICK $chan $nick :$BadReason"
   putserv "KICK $chan $nick :Cambia de nick por Favor..." 
   putserv "PRIVMSG $nick :0,4Hola Disculpa La Molestia, pero estas Usando un NickName no permitido" 
   putserv "PRIVMSG $nick :Por Favor Cambia de nick Si es quew Deseas Volver a entrar al Canal, " 
   putserv "PRIVMSG $nick :Si Deseas cambiar de NickName (el nombre con el que estas ahora) Escribe: /Nick NickName" 
   putserv "PRIVMSG $nick :Recuerda no ponerte nick's que contengan estas palabras: Activ, Pasiv, Sex, cm, put, Follado," 
   putserv "PRIVMSG $nick :Moderno, cacher, ping, verg, dotad, y nick's Obsenos o seras Baneado del canal, Gracias!" 
   return 0 
  } 
 } 
}
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked