1README file for Games::Bingo::Bot (generated from Games::Bingo::Bot POD) 2 3$Id: README,v 1.1 2003/06/25 21:12:16 jonasbn Exp $ 4 5NAME 6 Games::Bingo::Bot 7 8SYNOPSIS 9 use Games::Bingo::Bot; 10 11 use constant ANY => 1; 12 use constant PUBLIC => 2; 13 use constant PRIVATE => 3; 14 15 my $gbb = Games::Bingo::Bot->new(); 16 17 my $sub = $gbb->{'commands'}->{$msg}); 18 19 my ($type, $answer) = &$sub($gbb, $nick); 20 21DESCRIPTION 22 This module contains all the commands supported by the Games::Bingo::Bot 23 IRC bot (see the script in the bin directory). 24 25 The Games::Bingo::Bot class (this) and the script mentioned above is a 26 complete IRC setup for playing Bingo, using the Games::Bingo module. 27 28 These are the bingobot commands: 29 30 * help - this message 31 32 * play - join a game 33 34 * stats - get the current statistics of the running game 35 36 * pull - pull the next number 37 38 * bingo - you indicate to the bot that you have bingo 39 40 * pulled - shows you what number have been pulled 41 42 * show - lists the numbers on your plate 43 44 The command are described below in detail (SEE COMMANDS). 45 46 Not implemented yet (SEE TODO): 47 48 * auto - enables automode (automatic number pulling) 49 50 * noauto - disables automode 51 52 All commands can be sent into the channel or send as private messages to 53 the bot. The bot can repond as both of these ways aswell. The reponses 54 are sent as follows: 55 56 * help, show and all errors are always private messages 57 58 * pull and bingo are always public 59 60 * play, pulled, stats, auto, noauto depends on how you query 61 62 As long as the bot is online a game is running. 63 64 METHODS 65 66 These are the basic methods of the class. 67 68 new 69 70 This is the constructor, it will start up a new game. 71 72 get_sub 73 74 This is the only method apart from the contructor new, which is not a 75 implementation of a IRC related command. 76 77 The method returns a CODEREF to the command asked for (SEE COMMANDS). 78 79 COMMANDS 80 81 All these methods are implementations of commands which are supported by 82 the IRC client. 83 84 bingo 85 86 This is the command to be issued by a user, when he/she has bingo. 87 88 This starts a check of the issuing players card. 89 90 The method takes one argument, the nick of the player. 91 92 The methods reponds publicly on success and privately when the player 93 did not have a bingo. 94 95 pull 96 97 This command issues the pulling of a new number. 98 99 The method takes no arguments. The method responds publicly. 100 101 show 102 103 This command shows the card of the player issuing the command. 104 105 The method takes one argument, the nick of the player. The method 106 reponds privately. 107 108 stats 109 110 This command shows the current stats of the game. 111 112 * Number of players 113 114 * Number of numbers pulled 115 116 * Number of numbers remaining 117 118 The method takes no arguments. The method responds according to how it 119 was called (publicly/privately). 120 121 pulled 122 123 This method shows the numbers which have been pulled. 124 125 The method takes no arguments. The method responds according to how it 126 was called (publicly/privately). 127 128 play 129 130 This method adds the issuing player to the current game. 131 132 The method takes one argument, the nick of the player. The method 133 responds according to how it was called (publicly/privately). 134 135 part 136 137 This method deletes the issueing player from the current game. 138 139 The method takes one argument, the nick of the player. The method 140 responds according to how it was called (publicly/privately). 141 142 auto 143 144 *This is not yet implemented, please see the TODO* 145 146 This is actually a simple accessor, enabling the autoflag of the game, 147 meaning numbers are pulled automatically. 148 149 The method takes no argument. The method responds according to how it 150 was called (publicly/privately). 151 152 noauto 153 154 *This is not yet implemented, please see the TODO* 155 156 This is actually a simple accessor, disabling the autoflag of the game, 157 meaning numbers are no longer pulled automatically. 158 159 The method takes no argument. The method responds according to how it 160 was called (publicly/privately). 161 162 help 163 164 This is a simple list of the commands and a few guidelines, a reference 165 manual so to speak. 166 167 The method takes no argument. The method responds privately. 168 169SEE ALSO 170 * Games::Bingo 171 172 * Games::Bingo::Card 173 174 * POE::Component::IRC 175 176 * bin/bingobot.pl 177 178TODO 179 * Implement use of App::Config or a similar module for easier 180 configuration and use 181 182 * Implement auto and noauto commands. At this time I am not sure how 183 this should be done. Should it be done using a child process to run 184 the game, or should I just implement a sort of broadcast 185 functionality? 186 187 * Child processes: 188 http://poe.perl.org/?POE_Cookbook/Child_Processes 189 190 * Broadcast: http://poe.perl.org/?POE_Cookbook/Broadcasting_Events 191 192 * Or should this be done by using IRC as communication media, 193 reacting on own commands, ugly but simple :) 194 195 * Implement handling of nick changes so a game follows a user 196 197 * Implement user check so in case of spontane disconnects followed by 198 connects a user can resume a game under his new nick 199 200 * Implement resuming of running game after spontaneous disconnect of 201 the bot 202 203 * Write tests of the IRC commands (should these go into a module?) 204 205 * Write docs 206 207 * Implement functionality to start a new game automatically when a 208 game is over. This could be done by pilfering with the constructor 209 210 * Implement point system (should "bingo" commands issue negative 211 points when the player does not have bingo?) 212 213 * Improve the output of the 'pulled' command so it shows a more 214 console like output (see Games::Bingo, the bingo.pl script) 215 216 * Improve the output of the 'show' command to show a console like card 217 218 * Add a 'rules' command 219 220 * Should all commands be prefix with the name of the bot? now it would 221 trigger on alot of works. So if it is supposed to run in a public 222 channel it could prove annoying. 223 224AUTHOR 225 jonasbn <jonasbn@cpan.org> 226 227COPYRIGHT 228 Games::Bingo::Bot and related scripts and modules are free software and 229 is released under the Artistic License. See 230 <http://www.perl.com/language/misc/Artistic.html> for details. 231 232 Games::Bingo::Bot is (C) 2003 Jonas B. Nielsen (jonasbn) 233 <jonasbn@cpan.org> 234 235