Index: /trunk/Phergie/phergie.ini
===================================================================
--- /trunk/Phergie/phergie.ini	(revision 99)
+++ /trunk/Phergie/phergie.ini	(revision 102)
@@ -31,6 +31,8 @@
 ; keepalive :
 ;    boolean flag indicating whether or not the bot should reconnect when it
-;    gets disconnected from the server, defaults to false.
+;    gets disconnected from the server, defaults to false if not set, but
+;    setting it to true is recommended.
 ;    if this is set to true, you should set timeout value to 6 or above.
+;    if not, timeout would better be set to zero or a high number such as 15.
 keepalive = true
 
@@ -195,5 +197,5 @@
 
 ;-----------------------------------------------------------------------------
-; Weather 
+; Weather
 ;-----------------------------------------------------------------------------
 
@@ -201,8 +203,8 @@
 ;    Partner ID provided by weather.com
 ;    see http://www.weather.com/services/xmloap.html for more details
-weather.partner_id = 
+weather.partner_id =
 
 ; weather.license_key
 ;    License Key provided by weather.com
 ;    see http://www.weather.com/services/xmloap.html for more details
-weather.license_key = 
+weather.license_key =
Index: /trunk/Phergie/Bot.php
===================================================================
--- /trunk/Phergie/Bot.php	(revision 99)
+++ /trunk/Phergie/Bot.php	(revision 102)
@@ -72,95 +72,101 @@
 
 /**
-* Obtain and validate the contents of the configuration file
-*/
-$required = array('server', 'username', 'nick');
-$config = @parse_ini_file(PHERGIE_DIR . 'Phergie' . DIRECTORY_SEPARATOR . $ini);
+ * Start a runtime loop, if the bot disconnects and reconnects it will reload
+ * all settings from the ini file, allowing you to modify it without really shutting
+ * it down
+ */
+while (true) {
 
-if (count($config) == 0) {
-    echo 'Configuration file inaccessible or empty: ' . $ini . "\n";
-    return;
-}
+	/**
+	* Obtain and validate the contents of the configuration file
+	*/
+	$required = array('server', 'username', 'nick');
+	$config = @parse_ini_file(PHERGIE_DIR . 'Phergie' . DIRECTORY_SEPARATOR . $ini);
 
-foreach ($required as $setting) {
-    if (!isset($config[$setting]) || empty($config[$setting])) {
-        echo 'Required configuration setting missing: ' . $setting . "\n";
-        return;
-    }
-}
+	if (count($config) == 0) {
+	    echo 'Configuration file inaccessible or empty: ' . $ini . "\n";
+	    return;
+	}
 
-unset ($required);
+	foreach ($required as $setting) {
+	    if (!isset($config[$setting]) || empty($config[$setting])) {
+	        echo 'Required configuration setting missing: ' . $setting . "\n";
+	        return;
+	    }
+	}
 
-/**
-* Configure the client
-*/
-if (isset($config['driver'])) {
-    $driver = ucfirst(strtolower($config['driver']));
-} else {
-    $driver = 'Streams';
-}
-require_once 'Phergie/Driver/' . $driver . '.php';
-$class = 'Phergie_Driver_' . $driver;
-$client = new $class();
+	unset ($required);
 
-foreach ($config as $setting => $value) {
-    $client->setIni($setting, $value);
-}
+	/**
+	* Configure the client
+	*/
+	if (isset($config['driver'])) {
+	    $driver = ucfirst(strtolower($config['driver']));
+	} else {
+	    $driver = 'Streams';
+	}
+	require_once 'Phergie/Driver/' . $driver . '.php';
+	$class = 'Phergie_Driver_' . $driver;
+	$client = new $class();
 
-unset ($setting, $value, $driver, $class);
+	foreach ($config as $setting => $value) {
+	    $client->setIni($setting, $value);
+	}
 
-/**
-* Determine which plugins should be loaded
-*/
-$all = true;
-$include = array();
-if (isset($config['plugins'])
-    && preg_match('/(all|none)(?: except (.+))?/ADi', $config['plugins'], $match)) {
-    $all = $match[1] != 'none';
-    if (isset($match[2])) {
-        $include = array_map('strtolower', preg_split('/[, ]+/', $match[2]));
-    }
-}
+	unset ($setting, $value, $driver, $class);
 
-unset ($config);
+	/**
+	* Determine which plugins should be loaded
+	*/
+	$all = true;
+	$include = array();
+	if (isset($config['plugins'])
+	    && preg_match('/(all|none)(?: except (.+))?/ADi', $config['plugins'], $match)) {
+	    $all = $match[1] != 'none';
+	    if (isset($match[2])) {
+	        $include = array_map('strtolower', preg_split('/[, ]+/', $match[2]));
+	    }
+	}
 
-/**
-* Set up plugins
-*/
-$iterator = new DirectoryIterator(PHERGIE_DIR . '/Phergie/Plugin');
-$plugins = array();
-foreach ($iterator as $entry) {
-    if ($iterator->isFile()) {
-        $name = substr($entry, 0, -4);
-        if ($all xor in_array(strtolower($name), $include)) {
-            $plugins[$name] = true;
-        } else {
-        	$plugins[$name] = false;
-        }
-    }
-}
+	unset ($config);
 
-ksort($plugins);
+	/**
+	* Set up plugins
+	*/
+	$iterator = new DirectoryIterator(PHERGIE_DIR . '/Phergie/Plugin');
+	$plugins = array();
+	foreach ($iterator as $entry) {
+	    if ($iterator->isFile()) {
+	        $name = substr($entry, 0, -4);
+	        if ($all xor in_array(strtolower($name), $include)) {
+	            $plugins[$name] = true;
+	        } else {
+	        	$plugins[$name] = false;
+	        }
+	    }
+	}
 
-unset ($iterator, $entry, $name, $all, $include);
+	ksort($plugins);
 
-foreach ($plugins as $plugin=>$enabled) {
-    require_once 'Phergie/Plugin/' . $plugin . '.php';
-    $class = 'Phergie_Plugin_' . $plugin;
-    if (call_user_func(array($class, 'checkDependencies'), $plugins)) {
-        $instance = new $class($client);
-       	$instance->enabled = $enabled;
-        $client->addPlugin($instance);
-        $client->debug('Loaded ' . $plugin . ($enabled ? '':' [Disabled]'));
-    } else {
-        $client->debug('Unable to load ' . $plugin);
-    }
-}
+	unset ($iterator, $entry, $name, $all, $include);
 
-unset ($plugins, $plugin, $class, $instance);
+	foreach ($plugins as $plugin=>$enabled) {
+	    require_once 'Phergie/Plugin/' . $plugin . '.php';
+	    $class = 'Phergie_Plugin_' . $plugin;
+	    if (call_user_func(array($class, 'checkDependencies'), $plugins)) {
+	        $instance = new $class($client);
+	       	$instance->enabled = $enabled;
+	        $client->addPlugin($instance);
+	        $client->debug('Loaded ' . $plugin . ($enabled ? '':' [Disabled]'));
+	    } else {
+	        $client->debug('Unable to load ' . $plugin);
+	    }
+	}
 
-/**
-* Execute the event handling loop for the client
-*/
-while(true) {
+	unset ($plugins, $plugin, $class, $instance);
+
+	/**
+	* Execute the event handling loop for the client
+	*/
 	$state = $client->run();
 
