# Welcome To Baby Siter... # This script is ment for collecting www and ftp sites... # use it as you will... you can contact me for any reason at.. # ressu@rai.rauma.fi # # this script seems to be quite slow so.. be patient... # # version summary: # 1.0 the first released baby siter... # 1.1 some bug fixes and added commands... # 2.0 Totally rewrote the whole script.. # 2.1 added config file... and some new options & commands # 2.1.1 Fixed Some fatal bugs! # # ok... so by the request of xopy.. i'm finally adding the configurable # options... the configuration can be found in /bs-files/bs.conf # edit it as you will... bind pub * !status status bind pub * !site showurl bind pub * !add addurl bind pub * !credits creds bind pub * !help helppi bind pub * !remove rmurl bind pub * !all sendall proc logit { note } { putlog "-=BS=- $note" } proc msgit { nick message } { putmsg $nick "-=BS=- $message" } proc addurlfile {} { set starturl [open bs-files/urllist w] puts $starturl {http://rai.rauma.fi/~ressu/bs/} puts $starturl {ZaNaGa} set datum [exec date] puts $starturl $datum puts $starturl {1} puts $starturl {ZaNaGa} close $starturl } proc addconffile {} { logit "creating config-file, please edit it to suite your needs!" logit "it can be found at /bs-files/bs.conf" set bcf [open bs-files/bs.conf w] puts $bcf {no_anon_add 0} puts $bcf {rm_all ,dummy,} puts $bcf {verbosity 0} puts $bcf {beg_lvl 30} puts $bcf {allow_all 1} close $bcf } proc make_bs_structure {} { logit "creating the directory structure & the readme file..." exec mkdir bs-files set sorsa [open bs-files/readme.uu w] puts $sorsa {begin 664 bs-files/README.gz M'XL("'HCY3,``U)%041-10!U5 M4QNDLP+IM/?LKI2Z2+C/R,^26KOC5&ZNJ9PW,?0EP.BL:YU82EYH8V@.P?LT MHZ?D,U9=1.[#CD?@^#Z]FED=*;6<46NT&3+5/(4;LLW87V2_R"6!'C)TFRY9 MPM2)[/AN9J:Q$3('+Y^TT.SS`N)EZ?RHQAB!_&>)?$D2^Y60ZFS*0D;';CMW M_=19+W*4)^TX'JC3T8RD(6;&)8:2TICY*Q2D,(QQTQQ M)LZ4>BHDB5%S5 M]L&OQ#5+NJ-W^H`&Q5"+=$HVW0-H;'H%.XGPS#O:#K$'/^6R&$=G MH3*>39`$&"01X;3"#8;`.+X1O>?WTZ-T?HJ&.;BO9?2GVUKQ9D2.#*.L"XW3F?WKX#Q)'P%78'PZN:\(9\BV0PIYG;E=F[BV0_"@'`\ M&KS(I=W(\[#G!$B'D3FNOA;"*RN5-%\TG;:!Q;?(A* MBK,LC]O(?P=..=UJ?U@%<<:J_!*L>FV=S$KDE(;W4=LJZJ'756/5/T*C$)NE #!@`` ` end} close $sorsa exec uudecode bs-files/readme.uu exec rm bs-files/readme.uu if {[glob -nocomplain bs] == "bs"} then { exec rm bs logit "Removing the old bs program..." } if {[glob -nocomplain urllist] == "urllist"} then { exec mv urllist bs-files/urllist logit "Moving the urllist-file..." } } if {[glob -nocomplain bs-files] == ""} then { make_bs_structure } if {[glob -nocomplain bs-files/urllist] == ""} then { addurlfile } if {[glob -nocomplain bs-files/bs.conf] == ""} then { addconffile } set urlfile [open bs-files/urllist r+] set lines -1 for {set i 0 } {$i < 999} {incr i} { for {set um 0} {$um < 5} {incr um} { if [eof $urlfile] then { continue } else { for {set um 0} {$um < 5} {incr um} { gets $urlfile site } incr lines } eof $urlfile } } logit "$lines sites included in sitelist" close $urlfile proc bs_program {} { logit "it seems like you don't have the 'bs' program" logit "so i'll make one... this might take a while" # i had to make this uuencoded so the extra chars wouldnt mix this up.. # sorry about that # thanx to xopy & FungoStar about this... set sorsa [open bs.uu w+] puts $sorsa {begin 644 bs.c.gz M'XL(""4+Y3,``V)S+F,`C59M;]LV$/YL_8JSBC26HRI6AZ%(%!7(@'88FF4? MAF$#;&.0)?>*-^.'1A#`H+G:@M* MRA)R68-L:U@DBRTT7+$Z"+21_G]L52'K>W@46_()Q,X'8,A=S`@B]!%0Q*K4L3`0NF_5MKP=,5O-?& M>Z--P6I&6U+RYM`^*4OXT6*OV[2@,PU4K(:V+H/@T+CD:ZXL&8.O!3(G9)&L M\2`7I,D62CI%ZF/N#SQ7/("/>10^?'6CK%TPCX^9>G M3S#FXC,O6=3AZS),L?9SOT1/=4/KV'4[=Y2N./1Y//$K5N%3F5=:L'2%[TW! MT\*GVON8[WB"!X]BP2++JF13JJ*.`Z%S(-(PC.$'SQD`(#U\5MBK*A]U-?") M^V3N1:1D_W(U"O4&8&=11B:<.)<5HT2\3,.Y#V[M>A[$,4Q.T=TG*5<-1KYB ML)4M9HOAY.K^RJ%LTU408+_C%@&IQ_0P0XY.@@!+=8E,OF2J&>ET^IA"W]#2 M^DR^,M`]-.IR&IGD/L0X&^_"B#8W-Q[9&7M:7,0U:JH?)KS$Z/7:>Q?.X^O9 MY)HLC(VUU?DR_8^)"3TK[IQU:VTT1,`4!RM=5\9S-U*>9T"-_6"`!;^YZ1SM M#C#^#X[*]'YNX=#*PIA#77-%1SC4>O'DB`1)PXZ%[KVTVHZZEM.Z>4`SY%-V MK%E/3S.UAS@,A)4-ZWNC"AJ/^'R(-8)>FH;`T$&>!^5#'.>,YEW=X.GE71/44O1744LOEE+.[(Z8P<%/*E= M;S9ZDTO7TTGYX",0%P_>OH4S:KP1C?["?!KZFFE/J*,[`3LTZ:IH;ODS+1CU M\SVP[0_G:>C@3LG'EGQ_:"A_ROIVP?6BLYH+K"XU@W[8KZJ]V_&K?96!:Z\8 MGVN(O5)K\-(ZDETU>*];YY3?+I[NFXCFM^/O.]"7=3'@KPO]@4A+V;#1OE]W *SE=*>/> bs-files/urllist exec rm urltmplist incr lines } } } proc rmurl { nick place handle chan str } { glob lines if {$str == "" || $str == " " || $str == " "} then { msgit $nick "stupid moron! you need to give me a site to remove!" } else { set urlfile [open bs-files/urllist r+] set newfile [open newlist w] set urltmpfile [open trm w] for {set i 0} {$i < 1} {} { if [eof $urlfile] then { msgit $nick "no url matching $str" set i 1 set oktodel 2 } else { gets $urlfile target set rmline [lindex $target [lsearch $target *$str*]] if {$rmline != ""} then { set i 1 puts $urltmpfile $target gets $urlfile author puts $urltmpfile $author gets $urlfile date puts $urltmpfile $date gets $urlfile safety gets $urlfile request if [validuser $handle] then { set ahandle $handle } else { set ahandle $nick } if { $author == $ahandle } then { set oktodel 1 } elseif { $request == $ahandle } then { set oktodel 0 incr safety -1 } elseif {$safety == "1"} then { set oktodel 1 } else { set oktodel 0 } incr safety 1 puts $urltmpfile $safety puts $urltmpfile $ahandle } else { puts $newfile $target for { set e 0 } { $e < 4 } { incr e 1} { gets $urlfile kept puts $newfile $kept } } } } for {set i 0} {$i < 1} {} { if [eof $urlfile] then { set i 1 } else { gets $urlfile target if {$target == "" || $target == " "} then {} else { puts $newfile $target } } } if {[bcl $handle] == "1" && [validuser $handle]} then {set oktodel 1} if {$oktodel == "0"} then { msgit $nick "can't delete $rmline , (you eiter are the author of the site or are the first to report it in...or maeby you have reported it before...)" } elseif {$oktodel == "2"} {} else { msgit $nick "found $rmline , deleting!" incr $lines -1 } close $urlfile close $urltmpfile close $newfile if {$oktodel == "1"} then { exec rm trm exec mv newlist bs-files/urllist } elseif {$oktodel == "2"} {} else { exec cat trm >> newlist exec mv newlist bs-files/urllist exec rm trm } } } proc notehim { nick } { global lines if {$lines < [bs_conf_look beg_lvl]} then { msgit $nick "please add more sites... we only have $lines sites at the moment" } } proc creds { nick place handle chan rest } { global bsfe putmsg $chan "$bsfe" putmsg $chan "Special Thanx to xopy & FungoStar for the help they gave me." putmsg $chan "and ofcourse to everyone that have added sites to the bot!" } proc helppi { nick place handle chan rest } { global bsfe msgit $nick "there are these commands to use with $bsfe" msgit $nick "!help - GEEZH!! !site - Show a site" msgit $nick "!add - add a site !credits - Who helped me?" msgit $nick "!all - send all sites in a file" msgit $nick "!remove - remove a site..." } proc status { nick palce handle chan rest } { global lines global bsfe msgit $chan "I am using $bsfe" msgit $chan "my database includes $lines sites at the moment" msgit $chan "You can use !help to get help on the commands" } logit "$bsfe loaded.." logit {Special thanx to xopy & FungoStar for the help they gave for this}