All pastes #392339 Raw Edit

Someone

public text v1 · immutable
·published 2007-03-12 20:20 UTC
rendered paste body
proc check:channel {chan applicant xuser} {
global settings check timerz
channel add $chan +secure
	set timerz($chan,1)  [utimer 6 [list puthelp "PRIVMSG $chan :Hello $applicant I am $::botnick from ${settings(suppchan)}. I am here to check $chan and see if I can give you an $settings(suppchan) bot"]]
	set timerz($chan,2)  [utimer 7 [list puthelp "PRIVMSG $chan :The procedure is goin to take over 2 minutes so please dont do anything untill than."]]
	set timerz($chan,3)  [utimer 8 [list puthelp "PRIVMSG $chan :Salut $applicant sunt $::botnick de la ${settings(suppchan)}. Sunt aici sa verific $chan si sa vad daca pot sati dau un bot $settings(suppchan)"]]
	set timerz($chan,4)  [utimer 9 [list puthelp "PRIVMSG $chan :Procedura va ocupa peste 2 minute asa ca te rog nu fa nimic."]]
	set timerz($chan,5)  [utimer 10 [list check:settings $chan $applicant]]
	set timerz($chan,6)  [utimer 20 [list check:bind]]
   	set timerz($chan,7)  [utimer 30 [list putquick "PRIVMSG $chan :!usage"]]
 	set timerz($chan,8)  [utimer 35 [list putquick "PRIVMSG $chan :!help"]]
	set timerz($chan,9)  [utimer 45 [list putquick "PRIVMSG $chan :!seen aqwzsx"]]
	set timerz($chan,11) [utimer 70 [list putquick "PRIVMSG $chan :Channel Check Complited I am now going to send you another bot that is going to be your permanent bot. Please do what he says."]]
	set timerz($chan,12) [utimer 75 [list channel remove $chan]]
        set timerz($chan,13) [utimer 80 [list register $chan $applicant $xuser]]
}





proc check:timersoff {chan phase} {
global timerz
	killutimer $timerz($chan,13)  
	killutimer $timerz($chan,12)  
	killutimer $timerz($chan,11)
	if { $phase == "3" } { return } 
	killutimer $timerz($chan,9)  
	if { $phase == "2" } { return } 
	killutimer $timerz($chan,8)
	if { $phase == "1" } { return } 
   	killutimer $timerz($chan,7) 


}

proc check:bind {} {
bind pubm -|- "% CORECT*USAGE*" check:purgeobot
bind pubm -|- "% *to*see*all*the*commands*" check:purgeobot:help
bind pubm -|- *remember*seeing* check:purgeobot:seen
bind pubm -|- *Nu*mi*amintesc* check:purgeobot:seen
bind pubm -|- *a*fost*vazut*ultima* check:purgeobot:seen
bind pubm -|- *was*last*seen* check:purgeobot:seen
bind mode -|- * check:purgemodeb
bind mode -|- * check:purgemodem
}

proc check:unbind {} {
unbind pubm -|- "% CORECT*USAGE*" check:purgeobot
unbind pubm -|- *remember*seeing* check:purgeobot:help
unbind pubm -|- *Nu*mi*amintesc* check:purgeobot:seen
unbind pubm -|- *a*fost*vazut*ultima* check:purgeobot:seen
unbind pubm -|- *was*last*seen* check:purgeobot:seen
unbind pubm -|- "% *to*see*all*the*commands*" check:purgeobot:seen
unbind mode -|- * check:purgemodeb
unbind mode -|- * check:purgemodem
}


################################
proc check:settings {chan x} {
global settings

			set file "search.db"
			set fdz [open $file r]
 			set conte [read $fdz]
 			close $fdz
			
if {[string match "*m*" [getchanmode $chan]]} {
	putquick "part $chan :purged as moderate mode detected. For info/help apply on $settings(suppchan) & \037\00302$settings(homepage)"
	channel remove $chan;
	check:unbind
	check:timersoff $chan 0
     }
if {![onchan $x $chan]} {
	putquick "part $chan :purged as the applicant $x is not on channel. For info/help apply on $settings(suppchan) & 
\037\00302$settings(homepage)"
	channel remove $chan;
	check:unbind
	check:timersoff $chan 0
	}
if { [llength [chanlist $chan]] < 5 } {
	putquick "part $chan :purged as you got [llength [chanlist $chan]] ppl which is less than 5 people requirement. For info/help apply on 
$settings(suppchan) & \037\00302$settings(homepage)"
	channel remove $chan;
	check:unbind
	check:timersoff $chan 0
	}
if {[string match -nocase "*$chan*" $conte]} {
	putquick "part $chan :purged as there is abuse record. For info/help apply on $settings(suppchan) & \037\00302$settings(homepage)"
	channel remove $chan;
	check:unbind
	check:timersoff $chan 0
		}
	
}



################################
proc check:purgeobot {nick uhost hand chan text} {
	global settings 
	putquick "part $chan :purged as there is another bot $nick. For info/help apply on $settings(suppchan) & \037\00302$settings(homepage)"
	channel remove $chan;
	check:unbind
    check:timersoff $chan 1
	return
}

proc check:purgeobot:help {nick uhost hand chan text} {
	global settings 
	putquick "part $chan :purged as there is another bot $nick. For info/help apply on $settings(suppchan) & \037\00302$settings(homepage)"
	channel remove $chan;
	check:unbind
    check:timersoff $chan 2
	return
}

proc check:purgeobot:seen {nick uhost hand chan text} {
	global settings 
	putquick "part $chan :purged as there is another bot $nick. For info/help apply on $settings(suppchan) & \037\00302$settings(homepage)"
	channel remove $chan;
	check:unbind
    check:timersoff $chan 3
	return
}

################################
proc check:purgemodem {nick host hand chan mc victim} {
	global settings
	if {[string equal $mc "+m"]} {
	putquick "part $chan :purged as moderate mode was enforced. For help apply on $settings(suppchan) & \037\00302$settings(homepage)"
	channel remove $chan; pub:save
	check:timersoff $chan 3
	return
}
}

proc check:purgemodeb {nick host hand chan mc victim} {
	global settings
	if {[string equal $mc "+b"] $$ [string match -nocase "*$victim*" $::botname]} {
	putquick "part $chan :purged as the bot was banned. For help apply on $settings(suppchan) & \037\00302$settings(homepage)"
	channel remove $chan; pub:save
	check:timersoff $chan 3
	return
}
}
#################################################################3
proc register {chan applicant xuser} {
global reg
	set reg(chan) $chan
	set reg(who)  $applicant
	set reg(x)    "$applicant $applicant $chan pub"
	set reg(mix)  [split *!*@${xuser}.users.undernet.org]
	putallbots "freechans"
	bind bot B chansfree bot:chansfree
}