Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Games::Bingo::Bot(3)  User Contributed Perl Documentation Games::Bingo::Bot(3)

NAME
       Games::Bingo::Bot - A simple class holding IRC related methods for
       bingo

SYNOPSIS
       use Games::Bingo::Bot;

       use constant ANY	    => 1; use constant PUBLIC  => 2; use constant
       PRIVATE => 3;

       my $gbb = Games::Bingo::Bot->new();

       my $sub = $gbb->{'commands'}->{$msg});

       my ($type, $answer) = &$sub($gbb, $nick);

DESCRIPTION
       This module contains all	the commands supported by the
       Games::Bingo::Bot IRC bot (see the script in the	bin directory).

       The Games::Bingo::Bot class (this) and the script mentioned above is a
       complete	IRC setup for playing Bingo, using the Games::Bingo module.

       These are the bingobot commands:

       o   help	  - this message

       o   play	  - join a game

       o   stats  - get	the current statistics of the running game

       o   pull	  - pull the next number

       o   bingo  - you	indicate to the	bot that you have bingo

       o   pulled - shows you what number have been pulled

       o   show	  - lists the numbers on your plate

       The command are described below in detail (SEE COMMANDS).

       Not implemented yet (SEE	TODO):

       o   auto	  - enables automode (automatic	number pulling)

       o   noauto - disables automode

       All commands can	be sent	into the channel or send as private messages
       to the bot. The bot can repond as both of these ways aswell. The
       reponses	are sent as follows:

       o   help, show and all errors are always	private	messages

       o   pull	and bingo are always public

       o   play, pulled, stats,	auto, noauto depends on	how you	query

       As long as the bot is online a game is running.

   METHODS
       These are the basic methods of the class.

   new
       This is the constructor,	it will	start up a new game.

   get_sub
       This is the only	method apart from the contructor new, which is not a
       implementation of a IRC related command.

       The method returns a CODEREF to the command asked for (SEE COMMANDS).

   COMMANDS
       All these methods are implementations of	commands which are supported
       by the IRC client.

   bingo
       This is the command to be issued	by a user, when	he/she has bingo.

       This starts a check of the issuing players card.

       The method takes	one argument, the nick of the player.

       The methods reponds publicly on success and privately when the player
       did not have a bingo.

   pull
       This command issues the pulling of a new	number.

       The method takes	no arguments. The method responds publicly.

   show
       This command shows the card of the player issuing the command.

       The method takes	one argument, the nick of the player. The method
       reponds privately.

   stats
       This command shows the current stats of the game.

       o   Number of players

       o   Number of numbers pulled

       o   Number of numbers remaining

       The method takes	no arguments. The method responds according to how it
       was called (publicly/privately).

   pulled
       This method shows the numbers which have	been pulled.

       The method takes	no arguments. The method responds according to how it
       was called (publicly/privately).

   play
       This method adds	the issuing player to the current game.

       The method takes	one argument, the nick of the player. The method
       responds	according to how it was	called (publicly/privately).

   part
       This method deletes the issueing	player from the	current	game.

       The method takes	one argument, the nick of the player. The method
       responds	according to how it was	called (publicly/privately).

   auto
       *This is	not yet	implemented, please see	the TODO*

       This is actually	a simple accessor, enabling the	autoflag of the	game,
       meaning numbers are pulled automatically.

       The method takes	no argument. The method	responds according to how it
       was called (publicly/privately).

   noauto
       *This is	not yet	implemented, please see	the TODO*

       This is actually	a simple accessor, disabling the autoflag of the game,
       meaning numbers are no longer pulled automatically.

       The method takes	no argument. The method	responds according to how it
       was called (publicly/privately).

   help
       This is a simple	list of	the commands and a few guidelines, a reference
       manual so to speak.

       The method takes	no argument. The method	responds privately.

SEE ALSO
       o   Games::Bingo

       o   Games::Bingo::Card

       o   POE::Component::IRC

       o   bin/bingobot.pl

TODO
       o   Implement use of App::Config	or a similar module for	easier
	   configuration and use

       o   Implement auto and noauto commands. At this time I am not sure how
	   this	should be done.	Should it be done using	a child	process	to run
	   the game, or	should I just implement	a sort of broadcast
	   functionality?

       o       Child processes:
	       http://poe.perl.org/?POE_Cookbook/Child_Processes

       o       Broadcast:
	       http://poe.perl.org/?POE_Cookbook/Broadcasting_Events

       o       Or should this be done by using IRC as communication media,
	       reacting	on own commands, ugly but simple :)

       o   Implement handling of nick changes so a game	follows	a user

       o   Implement user check	so in case of spontane disconnects followed by
	   connects a user can resume a	game under his new nick

       o   Implement resuming of running game after spontaneous	disconnect of
	   the bot

       o   Write tests of the IRC commands (should these go into a module?)

       o   Write docs

       o   Implement functionality to start a new game automatically when a
	   game	is over. This could be done by pilfering with the constructor

       o   Implement point system (should "bingo" commands issue negative
	   points when the player does not have	bingo?)

       o   Improve the output of the 'pulled' command so it shows a more
	   console like	output (see Games::Bingo, the bingo.pl script)

       o   Improve the output of the 'show' command to show a console like
	   card

       o   Add a 'rules' command

       o   Should all commands be prefix with the name of the bot? now it
	   would trigger on alot of works. So if it is supposed	to run in a
	   public channel it could prove annoying.

AUTHOR
       jonasbn <jonasbn@cpan.org>

COPYRIGHT
       Games::Bingo::Bot and related scripts and modules are free software and
       is released under the Artistic License. See
       <http://www.perl.com/language/misc/Artistic.html> for details.

       Games::Bingo::Bot is (C)	2003 Jonas B. Nielsen (jonasbn)
       <jonasbn@cpan.org>

perl v5.24.1			  2003-06-25		  Games::Bingo::Bot(3)

NAME | SYNOPSIS | DESCRIPTION | SEE ALSO | TODO | AUTHOR | COPYRIGHT

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Games::Bingo::Bot&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help