ID: README Sat Feb 22 16:29:52 EST 2014 ground/X Some people have some strange ideas about what causes hangovers. There is one thing that causes hangovers and that is alcohol. This program tries to keep track of what is important, the raw amount of alcohol you are consuming and how fast you are drinking. Hopefully this little project will help you avoid hangovers. Brief usage instructions: By default the drink program will need to find the drink.bc file included with this package in the current search path. You can also edit the top of the main drink script to point to an exact location of the drink.bc file. The drink.bc file contains the list of drink names and the formulas for calculating how much 100% alcohol is in each. The program considers 1 OZ of 100% alcohol a "unit". You will need to have GNU bc installed to use this program. The drink.bc file expects to find GNU bc in /usr/bin so you will need to edit the top of drink.bc if your copy of GNU bc is in another location. You will need to look at the drink.bc in your editor of choice so you can get an idea of the current drink names and so that you can add your own favorites. Note that drink names must start with a letter. Any formula that will work in GNU bc you can use in the drink.bc file. In order to add a drink to the drink.bc file you will need to know two things. The percentage of alcohol contained in the drink in question and the total amount in fluid ounces or liters you are consuming per drink. As an example we'll consider the entry from a 12 ounce Budweiser. bud12=12*0.05 By using this formula we determine that 12 ounces of 5% alcohol by volume is .6 ounces of 100% alcohol. If your drinks are measured in liters the drink.bc file contains the conversion formulas that will allow a conversion to fluid ounces. With the examples listed you should be able to add just about any drink. Just remember that 5% alcohol by volume will be represented by multiplication by 0.05. Command line usage instructions: drink with no arguments prints all the stats of your current drinking session including number of total units consumed, number of drinks, and your average drinking speed in units per hour. drink Add a drink to the totals. Better do this when you crack one or you might forget. drink -r or drink --reset Start a new drinking session all totals are reset. The log is kept across sessions. drink -t or drink --test Test mode that tells you how many units a given drink will add to your total. So do I really want to have that next drink? The information is displayed but the drink is not added to the current totals or the log file. drink --revert By default the script will keep two copies of the database so that the last change can be reverted. This option may only be used once until another change to the data is made. drink --addtime This option is used to add a user specified number of minutes to the total drinking session time. It is useful if you do not start a log at the same time you start drinking. drink -l or drink --last Displays the totals for the last drinking session at the time the reset command was used. drink --month Prints your drinking totals for the month as recorded in the log file. drink --year Prints a list of totals for every month in the current year. drink --lifetime Prints a total of all drinks recorded in the log. drink --list List the names of all current drinks in the drink.bc file. Some of these will be measurements E.G. pint and are not to be used directly but are used as variables in other calculations. drink -u or drink --user Used for multi user support. Specifies the username that the current command should operate on. Primarily used by the ircII interface script. If this option is omitted the default username is 'default'. drink --irc Used by the ircII interface to make the displays more IRC friendly. drink --help Display brief usage information. drink --version Display the version number and release date. As mentioned above this archive also includes an IRC interface should you want to make a public bot on an IRC channel to track drinking sessions. It requires the ircII irc client to function. If you use this script you do so at your own risk. I have tried to make sure all shell characters will not be passed to a shell but there may still be problems. The * character is also allowed so that users may do multiplication. This project is released into the public domain by it's author. Hey it's free as in freedom and free as in beer! If you have comments you may contact me via email grnd@users.sourceforge.net or on twitter @ground024. Happy drinking, cheers!