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.

channel specefic on/off switch for the tcl

Old posts that have not been replied to for several years.
Locked
p
pakistani1
Voice
Posts: 26
Joined: Wed Apr 20, 2005 11:35 pm
Location: Pakistan Zindabad
Contact:

channel specefic on/off switch for the tcl

Post by pakistani1 »

hello !!
can some one plz help me put a channel specific [.chanset #name <+/- >repeat ] on/ off switch for the following repeat script
i put the setudef flag repeat line
but i do not know where to put the
if {![channel get $chan repeat]} { return 0 } line
thanx in advance

Code: Select all

setudef flag repeat 
set repeat-kick 3
set redura 40
set rekick "4Repeating Is Forbidden!!"
bind pubm - * repeat_pubm
proc repeat_pubm {nick uhost hand chan text} {
	if [matchattr $hand f] {return 0}
	global repeat_last repeat_num repeat-kick banm5 channel botnick
	global remask rekick redura
	set remask *!*@[lindex [split [getchanhost $nick $chan] "@"] 1] 
	if [info exists repeat_last([set n [string tolower $nick]])] {
		if {[string compare [string tolower $repeat_last($n)] \
        [string tolower $text]] == 0} {
			if {[incr repeat_num($n)] >= ${repeat-kick}} {
				if {[isop $nick $chan] == "0"} {
						putserv "MODE $chan +mib $remask"
						putserv "KICK $chan $nick :$rekick" 
						utimer $redura "putserv {MODE $chan -mi}"
					unset repeat_last($n)
				unset repeat_num($n)
				}
			}
		return
		}
	}
	set repeat_num($n) 1
	set repeat_last($n) $text
}

bind nick - * repeat_nick
proc repeat_nick {nick uhost hand chan newnick} {
	if [matchattr $hand f] {return 0}
	global repeat_last repeat_num
	catch {set repeat_last([set nn [string tolower $newnick]]) \
		$repeat_last([set on [string tolower $nick]])}
		catch {unset repeat_last($on)}
		catch {set repeat_num($nn) $repeat_num($on)}
		catch {unset repeat_num($on)}
}

proc repeat_timr {} {
	global repeat_last
	catch {unset repeat_last}
	catch {unset repeat_num}
	timer 1 repeat_timr
}

if ![regexp repeat_timr [timers]] {     # tko
	timer 1 repeat_timr
}
!~!~!~!~!~ ::Long Live The REpubLic ::~!~!~!
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Before:

Code: Select all

if [matchattr $hand f] {return 0}
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Locked