From 0fbfef3c124ae0abe85dbf5eb4625520f0772487 Mon Sep 17 00:00:00 2001
From: dms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Date: Tue, 19 Feb 2002 12:27:08 +0000
Subject: [PATCH] - patch from Morten Brix Pedersen:     * Moved around in
 sample.config, the most important things are now       in the top. So it's
 easy to "get started" with a simple bot.     * Changed top comments in
 blootbot.servers     * Modified some messages to console to be more
 descriptive.  Now it       just prints the right error using the $! variable.
 - removed ircII.servers

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@552 c11ca15a-4712-0410-83d8-924469b57eb5
---
 INSTALL                    |   2 +-
 files/blootbot.servers     |   2 +-
 files/ircII.servers        |   7 --
 files/sample/sample.config | 138 +++++++++++++++++--------------------
 src/DynaConfig.pl          |   8 +--
 src/Files.pl               |   4 +-
 src/Misc.pl                |   6 +-
 src/core.pl                |   2 +-
 src/logger.pl              |   4 +-
 src/modules.pl             |   2 +-
 10 files changed, 77 insertions(+), 98 deletions(-)
 delete mode 100644 files/ircII.servers

diff --git a/INSTALL b/INSTALL
index 92ec88b..6240171 100644
--- a/INSTALL
+++ b/INSTALL
@@ -4,7 +4,7 @@ Method of installation.
 - Move files/sample/sample.config to files/blootbot.config
 - Edit files/blootbot.config, modify to taste.
 - Edit files/blootbot.chan to set which channels to join.
-- Edit files/blootbot.server to modify list of IRC servers to connect.
+- Edit files/blootbot.servers to modify list of IRC servers to connect.
 
 - Install the following Perl modules:
 	- Net::IRC perl module
diff --git a/files/blootbot.servers b/files/blootbot.servers
index d87b08e..83e9a8c 100644
--- a/files/blootbot.servers
+++ b/files/blootbot.servers
@@ -1,5 +1,5 @@
 ###
-### ircII.servers
+# blootbot.servers: line separated list of servers to connect to
 ###
 
 irc.home.org
diff --git a/files/ircII.servers b/files/ircII.servers
deleted file mode 100644
index d87b08e..0000000
--- a/files/ircII.servers
+++ /dev/null
@@ -1,7 +0,0 @@
-###
-### ircII.servers
-###
-
-irc.home.org
-irc.linux.com
-irc.openprojects.net
diff --git a/files/sample/sample.config b/files/sample/sample.config
index dab9d1d..25a99da 100644
--- a/files/sample/sample.config
+++ b/files/sample/sample.config
@@ -1,46 +1,29 @@
-# blootbot configuration file, modify it to your own taste.
-
-# [str] Interface: [IRC/CLI]
-#   IRC		-- Internet Relay Chat
-#   CLI		-- Command Line Interface
-set Interface		IRC
+# blootbot configuration file, modify it to your own taste.  blootbot reads
+# this file from files/blootbot.config so it should be moved there.
 
+#####
 # Basic IRC info
+#####
 set ircNick		blootbot
 set ircUser		blootbot
 set ircName		blootbot experimental bot
 set ircUMode		+iw
 ###set ircHost		vh.virtualhost.org
 
-set owner		xk
+set owner		OWNER
 
 # nickserv/chanserv support.
 ###set nickServ_pass	PASSWORD
 ###set chanServ_ops	#chan1 #chan2
 
-# default quit message
+# default quit message.
 set quitMsg		adios amigos
 
-# temp directory.
+# path to a temporary directory which blootbot can use.
 set tempDir		/home/blootbot/Temp
 
 #####
-# 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
+# Factoid database configuration
 #####
 
 # [str] Ability to remember/tell factoids
@@ -69,7 +52,22 @@ set SQLPass		PASSWORD
 ###set SQLDebug		SQL_debug.log
 
 #####
-# factoid-related configuration
+# Logfile configuration
+#####
+
+# [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-related configuration
 #####
 
 # [bool] Factoid support.
@@ -117,7 +115,7 @@ set allowTelling	1
 #set friendlyBots	url purl script mrapi
 
 #####
-# factoid related and unrelated features, mainly Extras.
+# Factoid related and unrelated features, mainly Extras.
 #####
 
 # [str] addressing is when you name the bot. FIXME
@@ -184,35 +182,7 @@ set forking		1
 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		0
-
-# [0/1] Work In Progress...
-set WIP			0
-
-# 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
+# Extra features
 #####
 
 # [str] anything which requires LWP + http proxy.
@@ -241,8 +211,7 @@ set dict		false
 set freshmeat		false
 # [int] how often to update the freshmeat table, in hours.
 set freshmeatRefreshInterval 24
-# [chans|all] 10items/hour, might be annoying.
-###set freshmeatAnnounce	#debian-bots
+
 # [bool] if factoid does not exist, check freshmeat for it.
 set freshmeatForFactoid		false
 
@@ -254,18 +223,10 @@ set karma		true
 
 # [0/1] Frontend to kernel.org
 set kernel		false
-###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	10
-# [int] Adjust channel limit to 10 above total users in channel.
-set limitcheckPlus	10
-
 # [0/1] nickometer
 set nickometer		true
 
@@ -274,15 +235,13 @@ set quote		false
 
 # [0/1] Display random text in the channel.
 set randomQuote		true
-# [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	true
-# [str] Channels.
-set randomFactoidChannels	#debian-bots
+
 # [int] Interval (or more than), in minutes.
 set randomFactoidInterval	60
 
@@ -312,7 +271,6 @@ set seenStoreAll	1
 
 # [0/1] slashdot headlines.
 set slashdot		false
-###set slashdotAnnounce	#debian-bots
 
 # [0/1] frontend to ispell.
 set spell		false
@@ -333,7 +291,7 @@ set wingateInterval	60
 # [str] Wingate.
 set wingateBan		true
 # [str] Wingate.
-set wingateKick		DIE DIE DIE
+set wingateKick		Please don't use wingate
 
 # [0/1] google search.. simon++. requires libwww-search-perl + 5lines of
 #	modifications.
@@ -342,9 +300,37 @@ set wwwsearch		false
 # [0/1] Unit conversion tool.
 set units		true
 
+#####
+# Miscellaneous configuration options
+#####
+
+# [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		0
+
+# [0/1] Work In Progress...
+set WIP			0
+
+# debugging...
+###set dumpvars		1
+###set dumpvarsAtExit	1
+# log to specific file or global log file.
+###set dumpvarsLogFile	dumpvars.log
+
+# [str] Interface: [IRC/CLI]
+#   IRC		-- Internet Relay Chat
+#   CLI		-- Command Line Interface
+set Interface		IRC
+
 ####
-#### now modify blootbot.chans for per-channel specific configuration
-#### see sample.chans for info.
+# Now modify blootbot.chan for per-channel specific configuration see
+# sample.chans for info.
 ####
-
-set allowConv		1
diff --git a/src/DynaConfig.pl b/src/DynaConfig.pl
index e24b0d4..c7b6f1d 100644
--- a/src/DynaConfig.pl
+++ b/src/DynaConfig.pl
@@ -30,7 +30,7 @@ sub readUserFile {
     }
 
     if (!open IN, $f) {
-	&ERROR("cannot read userfile.");
+	&ERROR("Cannot read userfile ($f): $!");
 	&closeLog();
 	exit 1;
     }
@@ -123,7 +123,7 @@ sub writeUserFile {
     }
 
     if (!open OUT,">$bot_state_dir/blootbot.users") {
-	&ERROR("cannot write to userfile.");
+	&ERROR("Cannot write userfile ($bot_state_dir/blootbot.users): $!");
 	return;
     }
 
@@ -237,7 +237,7 @@ sub readChanFile {
     }
 
     if (!open IN, $f) {
-	&ERROR("cannot erad chanfile.");
+	&ERROR("Cannot read chanfile ($f): $!");
 	return;
     }
 
@@ -298,7 +298,7 @@ sub writeChanFile {
     }
 
     if (!open OUT,">$bot_state_dir/blootbot.chan") {
-	&ERROR("cannot write chanfile.");
+	&ERROR("Cannot write chanfile ($bot_state_dir/blootbot.chan): $!");
 	return;
     }
 
diff --git a/src/Files.pl b/src/Files.pl
index add4a4d..e86d228 100644
--- a/src/Files.pl
+++ b/src/Files.pl
@@ -14,7 +14,7 @@ sub loadLang {
     my $replyName;
 
     if (!open(FILE, $file)) {
-	&ERROR("FAILED loadLang ($file): $!");
+	&ERROR("Failed reading lang file ($file): $!");
 	exit 0;
     }
 
@@ -54,7 +54,7 @@ sub loadIRCServers {
     %ircPort = ();
 
     if (!open(FILE, $file)) {
-	&ERROR("FAILED loadIRCServers ($file): $!");
+	&ERROR("Failed reading server list ($file): $!");
 	exit 0;
     }
 
diff --git a/src/Misc.pl b/src/Misc.pl
index 9379d7b..d621ea6 100644
--- a/src/Misc.pl
+++ b/src/Misc.pl
@@ -16,7 +16,7 @@ sub help {
     $msgType = "private" if ($msgType eq "public");
 
     if (!open(FILE, $file)) {
-	&ERROR("FAILED loadHelp ($file): $!");
+	&ERROR("Failed reading help file ($file): $!");
 	return;
     }
 
@@ -317,7 +317,7 @@ sub getRandomLineFromFile {
 	    return $line;
 	}
     } else {
-	&WARN("gRLfF: could not open file '$file'.");
+	&WARN("gRLfF: Could not open file ($file): $!");
 	return;
     }
 }
@@ -343,7 +343,7 @@ sub getLineFromFile {
 	chop $line;
 	return $line;
     } else {
-	&ERROR("getLineFromFile: could not open file '$file'.");
+	&ERROR("gLFF: Could not open file ($file): $!");
 	return 0;
     }
 }
diff --git a/src/core.pl b/src/core.pl
index e8975c1..a7ba007 100644
--- a/src/core.pl
+++ b/src/core.pl
@@ -510,7 +510,7 @@ sub loadConfig {
     my ($file) = @_;
 
     if (!open(FILE, $file)) {
-	&ERROR("FAILED loadConfig ($file): $!");
+	&ERROR("Failed to read configuration file ($file): $!");
 	&status("Please read the INSTALL file on how to install and setup this file.");
 	exit 0;
     }
diff --git a/src/logger.pl b/src/logger.pl
index 474188c..252f72b 100644
--- a/src/logger.pl
+++ b/src/logger.pl
@@ -102,7 +102,7 @@ sub openLog {
 	&status("Opened logfile $file{log}.");
 	LOG->autoflush(1);
     } else {
-	&status("cannot open logfile $file{log}; not logging.");
+	&status("Cannot open logfile ($file{log}); not logging: $!");
     }
 }
 
@@ -367,7 +367,7 @@ sub status {
 
 sub openSQLDebug {
     if (!open(SQLDEBUG, ">>$param{'SQLDebug'}")) {
-	&ERROR("cannot open $param{'SQLDebug'}...");
+	&ERROR("Cannot open ($param{'SQLDebug'}): $!");
 	delete $param{'SQLDebug'};
 	return 0;
     }
diff --git a/src/modules.pl b/src/modules.pl
index bea0f2e..b5cadd7 100644
--- a/src/modules.pl
+++ b/src/modules.pl
@@ -388,7 +388,7 @@ sub getPerlFiles {
     my($dir) = @_;
 
     if (!opendir(DIR, $dir)) {
-        &ERROR("cannot open source directory $dir: $!");
+        &ERROR("Cannot open source directory ($dir): $!");
         exit 1;
     }
 
-- 
2.39.5