myacro.tcl by rojo (EFnet #wootoff) README Table of contents I. Description II. Installation III. Script Settings ------------------------------------------------------------------------------ I. Description This script is somewhat similar to be-acro.tcl made by Errtu. I used to play be-acro long ago, but was never quite happy with the game play. So here you go. This is an acro game with slightly different game play and scoring. Like be-acro, myacro starts each round by generating a random string of letters. 3 or more players submit phrases they think best fit the random letters. When time is up, the players who submitted acros vote for each other's submissions. The acro with the most votes gets a bunch of points. Fast voting is NOT rewarded in myacro. Take your time and fully appreciate the subtleties and cleverness of your fellow players' acros before voting. On the other hand, fast acro creation is rewarded -- but only if the acro is good enough to earn people's votes. Each vote counts as one point. Even if an acro is not the highest scoring submission, it still earns a point toward the game total for each vote it receives. Bonus points are awarded for the most popular acro, as well as the first acro submitted receiving votes. Points are cancelled for people who do not vote. If the bot detects trash talk, it will issue a challenge. The person talking smack will be forced to put up or shut up. The challenger and the challengee will compete for each other's points. The winner steals 5 points from the loser. If there's a tie, the challenger still loses a point for being a punk. Game play experience shows that people are going to bend the rules from time to time. They'll insert extra words, attaching them to other words with a hyphen or underscore. myacro allows fudging of a word here and there (the tolerance setting is configurable within the tcl), so people can feel more comfortable including an "a, an, the, of, for," etc. regardless of whether the random letters would accomodate it. Ultimately, it's up to the voters to decide whether the cleverness of the acro justifies the rule bending. ------------------------------------------------------------------------------ II. Installation Summary ------- 1. Have a running MySQL server or install the SQLite library + TCL interface 2. If MySQL, download and install either mysqltcl or mysql.so 3. If MySQL, create a database and db user 4. Put myacro.tcl into your eggdrop/scripts/ directory and salt to taste 5. Add "source scripts/myacro.tcl" to your eggdrop.conf file and rehash 6. .chanset #channel +acro 7. !acro Detailed instructions --------------------- 1. You must either have access to a MySQL database, or the SQLite library must be installed. If you're running Linux, SQLite will be the easiest option. For instance, if you are running Debian / Ubuntu, you can get everything you need with one command: sudo apt-get install libsqlite3-tcl That's it. Skip to step 4. :) If you would rather use a MySQL database, you'll probably find it in your distribution's repositories as mysql-server. For further information, or if you run Windows or a different operating system, Google for a MySQL server installation howto. 2. If you want to run this game on a MySQL database, you must also install either the TCL MySQL Interface (mysqltcl) or the MySQL Eggdrop module. a. The TCL MySQL Interface is perhaps the easier option, as it does not require compiling against your Eggdrop source. Chances are that it's already available in your Linux distribution's update repositories. Try "sudo apt-get install mysqltcl" or whatever syntax is appropriate. Binaries (including a Windows binary) are available on the mysqltcl website at http://www.xdobry.de/mysqltcl/ b. If you do not have the ability to install mysqltcl or if your sysadmin won't install it for you, you must build and install the MySQL Eggdrop module. You can download the Eggdrop module source from the following website: https://www.barkerjr.net/irc/eggdrop/modules/ Extract the module into your Eggdrop source into the src/mod directory. For instance, if your Eggdrop source is ~/eggdrop1.8, extract the MySQL module into ~/eggdrop1.8/src/mod/ so that it creates ~/eggdrop1.8/src/mod/mysql.mod/ containing the source files. Then cd back to the base Eggdrop source directory and ./configure && make config && make You can then just grab mysql.so from the src/mod/ directory and copy it into the modules/ directory of your working bot. More complete instructions are probably included with the MySQL mod source. 3. If you are using a MySQL database, you must create a database and a user with permissions to use that database. (SQLite doesn't use a username or password.) To create a MySQL database, enter the following at a shell prompt: mysql -u root -p You'll be prompted for a password. Enter your mysql root user password. This will take you to a mysql prompt. At the prompt, enter the following commands: create database eggdrop grant all on eggdrop.* to 'user1'@'localhost' identified by 'password'; ... where, of course, "user1" and "password" are things you make up. 4. Copy myacro.tcl and modify a few variables in it. If you're using SQLite, just set the value of mysql_db to "sqlite" (and the rest of the mysql_ variables will be ignored). MySQL users will need to change the values for mysql_user and mysql_pass to match what was done in step 3 above. 5. Add "source scripts/myacro.tcl" to your eggdrop.conf file and rehash. You don't need to loadmodule mysql. The script will auto load it if it isn't already loaded. 6. On the partyline of your bot, you need to enter the following command: .chanset #channel +acro ... where "#channel" is the name of the channel in which you want to serve the game, and "acro" is the value of the chanset_flag variable (which is indeed "acro" by default). See III.E. below for more information. You can chanset more than one channel +acro and allow games in multiple channels if you wish. I'm not sure whether multiple simultaneous running games will interfere with each other or not. I tried to compartmentalize games so a running game in #channel1 won't interfere with another running game in #channel2; but this is untested. 7. Find at least two other friends to play with. In the channel, type this trigger: !acro help ... to let your bot tell them how to play. If you don't have two friends, maybe you should ask yourself how socially stunted one must be to go through all this trouble to install this script. This document unfortunately can provide very little assistance with this issue. ------------------------------------------------------------------------------ III. Script Settings Open myacro.tcl in your favorite text editor and change some variables. A. mysql_db -- the name of the MySQL database you created (or "sqlite" if you're using SQLite instead of MySQL) B. mysql_host -- the address of the MySQL server (usually localhost) C. mysql_user -- a MySQL-only user account you created when you created the database D. mysql_pass -- the password for the MySQL-only user account E. chanset_flag -- .chanset #channel +(whatever this setting is) to enable acro for that channel F. winningscore("default") -- unless specified with the game starting trigger (as in "!acro 20"), games by default last to this many points. G. topics -- a space or line break delimited list of topics to suggest during the game. Ultimately, it's up to the voting players how strict they should adhere to these suggestions. They're just for fun. If a topic contains a % sign, the % will be replaced with a random player's nick. H. use_suggested_topics -- 1 to enable; 0 to disable I. triggers("start|stop|hiscores|help|pause|undo") -- the triggers to start / stop / pause / etc. Multiple triggers do the same events because sometimes it's annoying trying to remember whether !start or !acro or !startacro or !go or whatever starts the game. Just make all them sumbitches work, by damn. J. fudge -- This setting allows players to insert an extra word here and there when the generated random letters don't allow it. Say, for example, the bot generates the letters "U S A." A player wants to submit "Ur a Stupid Asshole." That little insignificant article shouldn't make the acro invalid, right? You know if you disable fudging, players are just going to cheat anyway with stuff like "Ur_a Stupid_fucking Asshole." At least this way the rule bending is somewhat controlled. It's really up to the voters whether the violation should cost the contributor. K. challenge("setting") -- let the bot listen for trash talk and make the punk put up or shut up. It's kind of like the screw in "You Don't Know Jack," except that players here might screw each other unintentionally. A player can only screw once per game. 1 to enable; 0 to disable L. letters -- a weighted array of every letter in the alphabet. Does the letter M really piss you off? Set its frequency to 0. ------------------------------------------------------------------------------ last updated 2010.12.23 by rojo