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.

enforce bans

Help for those learning Tcl or writing their own scripts.
Post Reply
h
helperis
Voice
Posts: 5
Joined: Wed Apr 09, 2008 8:49 am

enforce bans

Post by helperis »

I need script like +enforce bans. But i need to bot in kick message write not (Banned) but (Banned by nick -KICK COUNT-)

There is something but don't working:

Code: Select all

bind mode - * mode_proc

proc mode_proc {nick uhost hand chan mode target} {

	#need kick counter code:
	set kickcount 0

	if {[botisop]} {
		if {$mode eq "+b"} {
			putkick $chan $nick "\(banned by \002$nick\002 -${kickcount}-\)"
		}
	} else {
		putserv "PRIVMSG $chan :I'm not op'd!";
	}
Sorry for my english :roll:
User avatar
YooHoo
Owner
Posts: 939
Joined: Thu Feb 13, 2003 10:07 pm
Location: Redwood Coast

Post by YooHoo »

There are several kick counter scripts in the archives, maybe you might wanna give one of them a go :wink:
h
helperis
Voice
Posts: 5
Joined: Wed Apr 09, 2008 8:49 am

Post by helperis »

first i need:
on channel ban to bot enforce banned user and kick him with message
(banned by nick)

kick counter later :wink:

And maybe i need go to "script requests" forum? :roll:
h
helperis
Voice
Posts: 5
Joined: Wed Apr 09, 2008 8:49 am

Post by helperis »

Thanks forum.egghelp.org
if anyone need this script:

Code: Select all

set kickcount 0 
proc countkicks {} { 
 incr ::kickcount 
}

bind mode - "* +b" enforcebans 
  
proc enforcebans {nick uhost hand chan mc ban} { 
  if {![string match -nocase [string map {"\\" "\\\\" "\[" "\\["} $ban] $::botname]} { 
    foreach n [chanlist $chan] { 
      if {[string match -nocase [string map {"\\" "\\\\" "\[" "\\["} $ban] $n![getchanhost $n $chan]]} { 
        putkick $chan $n "Banned by \002$nick\002... - [countkicks] -" 
      } 
    } 
  } else { 
    pushmode $chan -o $nick 
  } 
}
Post Reply