-
-
29 May 2005 02:58:26 UTC
- Distribution: IRC-Bot-Hangman
- Module version: 0.1
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (374 / 1 / 3)
- Kwalitee
Bus factor: 0- 100.00% Coverage
- License: perl_5
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (18.1KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- NAME
- SYNOPSIS
- COMMANDS
- DESCRIPTION
- PLUGINS
- METHODS
- word_list( $list )
- load_word_list( name )
- word_list_name( $name )
- games( integer )
- game( $game )
- new_game()
- replay()
- can_talk()
- load_game()
- msg_guess()
- get_delay()
- delay()
- input()
- response()
- set_response( type )
- get_a_msg( type )
- guess_word( word )
- guess_letter( letter )
- conclusion()
- give_advice( guess )
- Bot::BasicBot METHODS
- SEE ALSO
- AUTHOR
- COPYRIGHT
NAME
IRC::Bot::Hangman - An IRC hangman
SYNOPSIS
use IRC::Bot::Hangman; IRC::Bot::Hangman->new( channels => [ '#hangman' ], nick => 'hangman', server => 'irc.blablablablah.bla', word_list_name => 'too_easy', games => 3, )->run; print "Finished\n";
COMMANDS
<letter>? : guess a letter guess <letter> : guess a letter guess <word> : guess an entire word <hangman> help - help instructions <hangman> play : Start a new game or display current game <hangman> quiet : keep quiet between guesses <hangman> talk : Talk between guesses
DESCRIPTION
This module provides a useless IRC bot which enables you to play hangman, the classic word game. It comes shipped with a list of ~2000 english words by default. The architecture is plugin based, words, commands and responses can be extended at will by adding new modules.
The main motivation was to provide a multi-player text based game for children to help them practising writing.
PLUGINS
The plugins are managed by
IRC::Bot::Hangman::WordList IRC::Bot::Hangman::Command IRC::Bot::Hangman::Response
METHODS
word_list( $list )
Get or set the word list as an array ref. A default word list of ~2000 english words is provided if no list is set.
load_word_list( name )
Returns a default english words list from IRC::Bot::Hangman::WordList
word_list_name( $name )
Get or set the word list name. It must be an installed module in IRC::Bot::Hangman::WordList::xxx The default provided is 'default' = IRC::Bot::Hangman::WordList::Default
games( integer )
Get or set the number of games before ending. undef means infinity.
game( $game )
Get or set the hangman game. The default value is a Games::GuessWord instance with word_list() word list.
new_game()
Reset the game
replay()
Reset the game unless it is the last game as counted by games()
can_talk()
Get set
can_talk
, used bytick
to display reminders.load_game()
Returns a Games::GuessWord instance
msg_guess()
Displays the word to guess
get_delay()
Returns a random time calculated: delay() * (1 + rand(4)) seconds
delay()
Get set base delay in seconds. Default is 30s.
input()
Get/set input
response()
Get/set response
set_response( type )
Sets the response from a response type
get_a_msg( type )
Returns a msg of a given type
guess_word( word )
Guess a word : success or one chance less
guess_letter( letter )
Guess a letter : match or one chance less
conclusion()
Displays an end of game message : sucess or lost
give_advice( guess )
Bot::BasicBot METHODS
These are the Bot::BasicBot overriden methods
said( $args )
This is the main method, everything said is analysed to provide a reply if appropriate
help()
Displays help when called
hangman help
tick()
Called every now and then to display a reminder if the game is active and
can_talk
is on.SEE ALSO
AUTHOR
Pierre Denis <pierre@itrelease.net>
http://www.itrelease.net/
COPYRIGHT
Copyright 2005 IT Release Ltd - All Rights Reserved.
This module is released under the same license as Perl itself.
Module Install Instructions
To install IRC::Bot::Hangman, copy and paste the appropriate command in to your terminal.
cpanm IRC::Bot::Hangman
perl -MCPAN -e shell install IRC::Bot::Hangman
For more information on module installation, please visit the detailed CPAN module installation guide.