User:Sneed/Drunkard Script

This bash shell script for Linux plays an audio alert at regular intervals as a reminder to drink more alcohol, making advancement in the Drunkard title track easier. You won't need to watch the minutes tick by in your Hero Panel, and you won't need to have post-processing effects turned on to monitor your current state of drunkenness. It makes maintaining your drunkenness so effortless that, once you've learned to use it, you'll be able to keep your character tanked all the time, even as you're adventuring, running missions, farming or vanquishing. Don't worry though, this isn't a bot or cheat of any kind. ''Note: This is a Linux script and won't, to my knowledge, work on Windows. I'd love to offer a Windows version as well, but I don't know the first thing about Windows scripting. If you have, or are aware of, a Windows script like this one please let me know on the talk page.''

This script is based on a similar script by Neky that I found on a Guild Wars Guru Forum. His script was in turn based on an excellent online timer by Smurf Minions.

The script

 * 1) !/bin/bash

drinklvl1=65		## Delay before first alert - level 1 drink. drinklvl3=185		## Delay before first alert - 3 x level 1 drinks. drinklvl5=185		## Delay between alerts - level 5 drink. alert=/usr/share/sounds/gnome/default/alerts/glass.ogg   	## Alert sound must not exceed 60 seconds in length. player=ogg123		## Command-line media player. Options include aplay, sox, mpg123, ogg123, madplay.

echo "What are you drinking?" echo -e "Level \033[1;31m1\033[0m drinks one at a time? Level 1 drinks \033[1;31m3\033[0m at a time? Level \033[1;31m5\033[0m drinks?" echo "(answer with 1, 3 or 5)"	## Any other answer will result in a sound test. read time

if [ $time = 1 ]; then echo "Use a level 5 drink immediately and a level 1 drink after each alert." echo "You will receive a sound notification after $drinklvl1 seconds, and every 60 seconds thereafter." sleep $drinklvl1 watch -p -n 60 $player $alert elif [ $time = 3 ]; then echo "Use a level 5 drink immediately and 3 level 1 drinks after each alert." echo "You will receive a sound notification after $drinklvl3 seconds, and every 180 seconds thereafter." sleep $drinklvl3 watch -p -n 180 $player $alert elif [ $time = 5 ]; then echo "Use a level 5 drink immediately and after each alert." echo "You will receive a sound notification every $drinklvl5 seconds." sleep $drinklvl5 watch -p -n $drinklvl5 $player $alert else echo "Sound Test" echo "Testing media player ($player) and alert sound ($alert)." echo "$player $alert" $player $alert fi

Installation steps
Create an empty file, make it executable and open it in a text editor.

In Gnome: touch drink_timer && chmod +x drink_timer && gedit drink_timer In KDE: touch drink_timer && chmod +x drink_timer && kate drink_timer Copy the script from the box above and paste it into the text editor. Save the document.

Putting a Launcher in the Gnome Applications menu (optional)
Open the menu editor. alacarte Click on the Games menu, then click the New Item button and a Create Launcher dialog will appear.

Under Type choose Application in Terminal.

For Name put GW Drink Timer (or any name that you'll remember).

For Command:
 * If you've saved the script to your home folder put:

~/drink_timer
 * If you've saved the script to a different folder put:

/bin/bash -c "cd /path/to/folder/ && ./drink_timer"
 * Replace /path/to/folder/ with the actual path to the folder containing the script.

Click OK.

Modes
This script offers 3 distinct modes:
 * Level 1: Plays an alert after 65 seconds and then every 60 seconds thereafter. This mode is best if you'd like to use level 1 alcohol and drink them one-at-a-time. The reason for the initial delay of an extra 5 seconds with this mode is so that you can be sure you won't quaff your drinks too early, which would be wasteful.


 * Level 3: Plays an alert after 185 seconds and then every 180 seconds thereafter. This mode is best if you'd like to use level 1 alcohol and drink them 3-at-a-time. There is an initial delay of an extra 5 seconds with this mode for the same reason as for Level 1 mode, to prevent wasting a drink.


 * Level 5: Plays an alert every 185 seconds. This mode is best if you'd like to use level 5 alcohol. This mode imposes an extra 5 second delay between each drink. Level 5 alcohol always returns you to a state of maximum drunkenness, therefore, without an extra few seconds delay between each drink there is a perennial risk of wasting drinks.

Note: If you are using level 1 alcohol and planning on some drunken adventuring I must recommend using Level 3 mode instead of Level 1 mode. Having to stop and drink every minute can get old quick.

Using the script

 * 1) Chug enough alcohol to reach maximum level 5 drunkenness.
 * 2) Start the script and choose the appropriate mode for your drinking style (1, 3 or 5) and hit enter.
 * 3) Minimize the terminal window and return to Guild Wars.

Note: If you can't hear the alert sound over the game try turning the game down from the options menu, then turn the overall volume on your system up from the control panel.

Extra configuration
I've tried to make this script highly customizable. More on that to come.