From 19a54b46ff6dbb7e64482d4f0c92564cd51a7eea Mon Sep 17 00:00:00 2001 From: dms Date: Fri, 28 Jul 2000 15:26:45 +0000 Subject: [PATCH] loadConfig to spurt out correct message when infobot.config does not exist on fresh install git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@10 c11ca15a-4712-0410-83d8-924469b57eb5 --- files/infobot.config | 344 ------------------------------------------- files/sample.config | 15 +- src/core.pl | 5 +- 3 files changed, 10 insertions(+), 354 deletions(-) delete mode 100644 files/infobot.config diff --git a/files/infobot.config b/files/infobot.config deleted file mode 100644 index 98db4a2..0000000 --- a/files/infobot.config +++ /dev/null @@ -1,344 +0,0 @@ -# parameter settings file for the infobot -# kevin lenzo (lenzo@cs.cmu.edu) -# modified by xk -### - -# [str] Interface: [IRC/CLI] -set Interface IRC - -# IRC. -set ircNick InfoCup -set ircUser MrInfo -set ircName Mmmm Tasty Info -set ircUMode +iw -set join_channels #DEBIAN-bots #Odd - -# nickserv/chanserv support. -###set nickServ_pass PASSWORD -###set chanServ_ops #chan1 #chan2 - -# default quit message -set quitMsg BEE RICHT BAK - -##### -# logfile -##### - -# [file] where to put logging info. comment out to disable. -set logfile log/$ircUser.log - -# [str] Type of logging. -# DAILY -- Create a new log each day. -# DEFAULT -- One continuous log file. -set logType DAILY - -# [int] Maximum log size, if logfile is defined, in bytes. -set maxLogSize 10000000 - -##### -# Factoid DB Configuration -##### - -# [str] Ability to remember/tell factoids -# none -- disable. -# mysql -- ... -# pgsql -- postgresql (NOT SUPPORTED) -# dbm -- berkeley dbm (NOT SUPPORTED) -set DBType mysql - -# [str] DBM filename prefix // MYSQL/PGSQL database. -# eg: blootbot-factoids, blootbot-seen -# eg: /var/db/mysql/blootbot/factoids.* -set DBName botdb - -# [str] Hostname of database server -set SQLHost localhost - -# [str] mysql user allowed to insert,update,delete stuff from tables. -set SQLUser root - -# [str] mysql password. -set SQLPass ynnadpmp - -##### -# factoid-related configuration -##### - -# [bool] Factoid support. -set factoids true - -# [int] maximum length of factoid key. -set maxKeySize 32 - -# [int] maximum length of factoid value. -set maxDataSize 450 - -# [int] minimum length of unaddressed (message) question without question -# before it is answered involuntarily. -# This ignores the 'addressing' setting. -# 0 to disable. -set minVolunteerLength 0 - -# [str] when should the bot bother learning new factoids. -# ADDRESSED -- only learn when addressed. -# HUNGRY -- learn irrelevent of addressing. this will catch -# _everything_, use at your own risk. I tried this ages -# ago and it caught quite funny responses but who knows -# if my modifications will prevent this or not, perhaps -# IsInvalid must be disabled? -set learn ADDRESSED - -# [str] different behaviour with URLs. -# REQUIRE -- means it will need to be a url type (e.g. file:, http:) -# OPTIONAL -- will take anything -# REJECT -- will not accept any urls. this makes it easy to -# run 2 with different nicks and styles. -# ^^^ what's the point of this??? -set acceptUrl OPTIONAL - -# [0/1] tell so-and-so about such-and-such of a factoid. -set allowTelling 1 - -# [bool] profanity checking. -set profanityCheck false - -# [str] other bots to ask for factoids which they may have. -#set friendlyBots url purl script mrapi - -##### -# factoid related and unrelated features, mainly Extras. -##### - -# [str] addressing is when you name the bot. FIXME -# REQUIRE -- the bot only does something if addressed. -# OPTIONAL -- the bot responds (does not learn) irrelevent of -# addressing. -set addressing REQUIRE - -# should work. FIXME. -set addressCharacter ~ - -# [str] how the bot should send messages. -# PRIVATE -- reply to private messages only, rejecting public msgs. -# DEFAULT -- reply to public _and_ private queries. -set talkMethod DEFAULT - -# [str] how long the output string should be before it is changed from -# public to private. -# "+" before bot commands overrides this option temporarily. -###set minLengthBeforePrivate 192 - -# [int] maximum length of reply for Extras function before popping list to -# reduce number of elements. -set maxListReplyLength 300 - -# [int] maximum number of elements in list allowed for Extras function -# before popping elements to reduce total count. -set maxListReplyCount 15 - -# [0/1] allow people outside any channels the bot is on to use the bot -# for factoids and commands. -set disallowOutsiders 1 - -# [int] time, in seconds. (different messages) -set floodMessages 10:30 -# [int] same messages. -set floodRepeat 2:10 - -# [int] Amount of time for auto-ignore (flooding) to expire. -set ignoreAutoExpire 5 - -# [int] Amount of time for forced-online ignore to expire. minutes. -set ignoreTempExpire 60 - -##### -# Internal (simple) bot commands -##### - -# [0/1] irc-cli calculator. -set perlMath 1 - -# [0/1] ord/chr etc -set allowConv 1 - -# [0/1] do you want to allow DNS lookup -set allowDNS 1 - -# [0/1] Forking... enable for non-nix OS or to reduce mem usage. -# This should work for Win32 and MacOS. About time, hey :) -set forking 1 - -# [int] Backlog... ideal to see what happened to the bot on console. -# maximum number of lines to backlog. -set backlog 24 - -##### -# Miscellaneous... -##### - -# [int] Display a bit too much info about stuff. -# 0 -- disable. -# 1 -- standard. -# 2 -- extra. -set VERBOSITY 1 - -# [0/1] Warn messages. -set WARN 1 - -# [0/1] Debugging messages. -set DEBUG 1 - -# [0/1] Work In Progress... -set WIP 1 - -# debugging... -###set dumpvars 1 -###set dumpvarsAtExit 1 -# log to specific file or global log file. -###set dumpvarsLogFile dumpvars.log - -# [0/1] allow 'use strict', makes bot unreliable. -set useStrict 0 - -##### -# Extras -##### - -# [str] anything which requires LWP + http proxy. -# set httpProxy http://router.home.org:3128/ - -# [0/1] babelfish translator. jdf++. -set babelfish true - -# [0/1] offer free factoid cookies -set cookie true - -# [0/1] Countdown to specific dates -set countdown true - -# [0/1] Debian file and package search. -set debian true -# [int] how often to update the debian table, in days. -set debianRefreshInterval 7 -# [0/1] extra stuff... -set debianExtra true - -# [0/1] Frontend to dict.org's wordnet. -set dict true - -# [0/1] Freshmeat -set freshmeat true - -# [int] how often to update the freshmeat table, in hours. -set freshmeatRefreshInterval 2 - -# [chans|all] 10items/hour, might be annoying. -###set freshmeatAnnounce #debian-bots -# [bool] if factoid does not exist, check freshmeat for it. -set freshmeatForFactoid false - -# [0/1] insult server -set insult false - -# [0/1] karma -set karma true - -# [0/1] Frontend to kernel.org -set kernel true -set kernelAnnounce #debian-bots - -# [0/1] LART. -set lart true - -# [array] Channel limit adjuster. List of channels. -set limitcheck #debian-bots -# [int] Interval (or more than), in minutes. -set limitcheckInterval 30 -# [int] Adjust channel limit to 10 above total users in channel. -set limitcheckPlus 10 - -# [0/1] nickometer -set nickometer true - -# [0/1] Frontend to the stock market. -set quote true - -# [0/1] Display random text in the channel. -set randomQuote false - -# [str] Channels. -set randomQuoteChannels #debian-bots - -# [int] Interval (or more than), in minutes. -set randomQuoteInterval 60 - -# [0/1] Display random text in the channel. -set randomFactoid false - -# [str] Channels. -set randomFactoidChannels #debian-bots - -# [int] Interval (or more than), in minutes. -set randomFactoidInterval 60 - -# [0/1] Warn users about root. -###set rootWarn true -# passive -- be polite plus stuff, compliant to OPN, heh. -# aggressive -- ... -###set rootWarnMode passive - -# [0/1] Factoid search. -set search true - -# [0/1] persistant "seen". WARNING: this may cause memory leaks. -set seen true - -# [0/1] seen statistics for online users like idle time, total message -# count. -set seenStats true - -# [int] if someone's been away for more than xx days, delete their info. -# info. -set seenMaxDays 90 - -# [int] interval to flush cached seen info. in minutes. -set seenFlushInterval 60 - -# [0/1] slashdot headlines. -set slashdot true -set slashdotAnnounce #debian-bots - -# [0/1] frontend to ispell. -set spell true - -# [0/1] Advanced topic management. -set topic true - -# [0/1] User Information Services. -set userinfo true - -# [0/1] Uptime daemon -set uptime true - -# [0/1] weather.com. FIXME -set weather false - -# [str] Wingate checking and banning mechanism. -###set wingate #debian -# [int] seconds. minimum time to check. -set wingateInterval 60 -# [str] Wingate. -set wingateBan true -# [str] Wingate. -set wingateKick DIE DIE DIE - -# google search.. simon++ . expanded to www search using several -# engines since it was so easy once you have WWW::Search. -# use "update" if you want it to update the db, or comment -# out if you don't want it. requires WWW::Search, not included. -# use "forceupdate" to force a db update on every google search. -# [0/1] -set wwwsearch true - -# [0/1] Unit conversion tool. -set units true diff --git a/files/sample.config b/files/sample.config index 729b725..9791952 100644 --- a/files/sample.config +++ b/files/sample.config @@ -42,18 +42,17 @@ set maxLogSize 10000000 # [str] Ability to remember/tell factoids # none -- disable. -# mysql -- ... -# pg -- postgresql (NOT SUPPORTED) -# dbm -- berkeley dbm (NOT SUPPORTED) +# mysql -- MySQL +# pgsql -- PostGreSQL (NOT SUPPORTED YET) +# dbm -- Berkeley DBM ### REQUIRED by factoids,freshmeat,karma,seen,... set DBType mysql # [str] DBM filename prefix // MYSQL/PGSQL database. +# eg: blootbot-factoids, blootbot-seen +# eg: /var/db/mysql/blootbot/factoids.* set DBName blootbot -# [str] Database name on server. -set SQLName blootbot - # [str] Hostname of database server set SQLHost localhost @@ -183,7 +182,7 @@ set backlog 24 # [bool] Display a bit too much info about stuff. # 0 -- disable. # 1 -- minimal. -# 2 -- some crap. +# 2 -- extra. set VERBOSITY 1 # [0/1] Warn messages. @@ -211,7 +210,7 @@ set useStrict 0 # [str] anything which requires LWP + http proxy. ###set httpProxy http://HOSTNAME:PORT/ -# [0/1] babelfish translator. jdf++. FIXME +# [0/1] babelfish translator. jdf++. FIXME [DOES NOT WORK] set babelfish false # [0/1] offer free factoid cookies diff --git a/src/core.pl b/src/core.pl index b53e981..a93ce4e 100644 --- a/src/core.pl +++ b/src/core.pl @@ -216,8 +216,9 @@ sub loadConfig { if (!open(FILE, $file)) { &ERROR("FAILED loadConfig ($file): $!"); - &status("Please make sure the configuration file exists."); - exit 1; + &status("Please copy files/sample.config to files/infobot.config"); + &status(" and edit files/infobot.config, modify to tastes."); + exit 0; } my $count = 0; -- 2.39.2