*****************
*** IQ README ***
*****************

See http://f0rked.com/IQ for more information about this bot and what it does.
Basically, IQ is a modular IRC bot. The following information will assist you
in installing and running IQ.

REQUIREMENTS

	To run IQ, you'll need a *NIX based operating system, with at least PHP 4.3, with a compiled CGI or CLI binary. Run 'php -v' to see what you have. IQ is developed under the CLI binary, and is therefore more supported. The CGI binary has been less tested, and may still have issues. If you believe you've discovered a CGI-vs-CLI problem, read below how to submit a bug report.
	
	If you compile PHP yourself, run "make install-cli" after "make install" to install the CLI. Keep in mind this is unnecessary if you configured	PHP with --disable-cgi or --with-apxs. 

	IQ supports process signaling, and will perform certain actions when it receives certain signals. If you would like to have the ability to control the core with signals, you will need PHP compiled with --enable-pcntl, which is not compiled in by default.
	
	Windows support is possible, however unstable at this time. Future support is planned, but is not a priority.

INSTALLATION

	Once you have confirmed that you meet the requirements of IQ, carefully follow these instructions to install:
	
	1) tar -zxvf IQ-0.9.1.tar.gz

	Extract the tarball. This will create a directory called "IQ-0.9.1". Note that if this is not the name of the file you downloaded, obviously it would be a good idea to use that name instead.
	
	2) cd IQ-0.9.1
	
	Change to the directory containing IQ's files
	
	3) cp config.php-dist config.php
	
	Copy the distribution config file to a usable "config.php".
	
	4) vim config.php
	
	Edit the config.php file. You may use any editor you use. Common editors include vim, vi, pico, and nano. Pay close attention to the comments, they are there for a reason. The config file is well documented in itself, so setting up your bot should not be extremely difficult. Edit the file completely or your bot will not start.
	
	5) ./IQ
	
	Start the bot. You must IQ from it's directory (eg. don't cd to / and run /home/user/IQ-ver/IQ). If you try to do otherwise, it will exit out with an error. Your bot should immediately begin outputting text to the console, the first line of which should be ">>> IQ <ver> :: started: <date>".
	
TIPS & CUSTOMIZATION

	>> How to run IQ in the background
	Start your bot with: ./IQ > /dev/null &
	
	>> Send signals to control your bot
	IQ will start two processes, one is a wrapper script that will start the core, and the other is the core itself. You can tell the difference in that "core.php" is in the output of `ps -u | grep php`. IQ will rehash upon receiving a SIGHUP signal and terminate upon a SIGTERM signal. Find the pid (process ID) of the core by looking through the output of 
	`ps -u | grep php`, and then typing "kill -HUP <pid>" or "kill -TERM <pid>", where <pid> is the process ID of the core.
	
	>> Create your own themes
	See the top of include/themes.php for more information on this.
	
TROUBLESHOOTING
	
	>> "Bad interpreter" error
	The default location that IQ uses for PHP is /usr/bin/php. If you receive the 'bad interpreter' error, your shell can't find PHP to start IQ. Either your PHP location is /usr/local/bin/php (or something else), or you don't have PHP installed. If the former is true, you'll need to modify the first lines of both the 'IQ' and 'include/core.php' files to say "#!/usr/local/bin/php". If you have root access to the machine, it is recommended that you create a more permenant fix by running:
	ln -s /usr/local/bin/php /usr/bin/php
	to create a symbolic link from /usr/local/bin/php to /usr/bin/php. This will prevent you from having to modify the files of future releases of IQ.
	
SUBMITTING A BUG REPORT

	If you feel you have discovered a problem with IQ, and would like to let the author know about it, please know that you are welcome to do so. However, before submitting any reports, carefully read through any documentation available (IQ website + FAQ/README) to see if the problem you are having is already known. If it is not, send an email to (root) (at) (f0rked.com) (dot) (com) describing the problem in extreme detail. If possible, enable debug mode (in the config.php file) and copy/paste the lines leading up to and following the issue in question.
	
CONTRIBUTING MODULES

	IQ modules are relatively simple to write. If you have a simple grasp on PHP, you can probably follow the existing modules that I have included to hack out your own. If you have a useful module, I will include it in a directory called "contrib" in future IQ releases. Before you submit your modules, please make sure they meet the following guidelines:
		* Module code must be clean. Spend some time on making the code efficient and aesthetically pleasing.
		* Code must be well-commented. Be generous in your comments; describe what the module does, explain its triggers and limitations, etc.
		* Module must follow IQ standards. For the sake of the bot functioning smoothly and cleanly, store information in appropriate places, such as in local vars, or designated global vars, such as $bot->info. Avoid creating unnecessary variables in any global scope.
	If your module passes, submit it to the email address given in the "Submitting a Bug Report" section above.

	
You may reach me via AIM (f0rked2000), or IRC (irc.nullirc.net, #null, f0rked) if you have questions and/or comments. I am interested in hearing of ways my IRC bot is being used, drop me a line if you use your bot in a unique way. 

I solely develop this software on my own time, and release it publicly for anyone to use freely under the GPL. If you'd like to express your appreciation for my many many hours spent on this project in the form of a monetary donation, I will gladly accept it via PayPal to the address stated in the bug report section.
	

