|
NAMEIRC::Bot::Hangman - An IRC hangmanSYNOPSISuse 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 DESCRIPTIONThis 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. PLUGINSThe plugins are managed byIRC::Bot::Hangman::WordList IRC::Bot::Hangman::Command IRC::Bot::Hangman::Response METHODSword_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::WordListword_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::Defaultgames( 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 gamereplay()Reset the game unless it is the last game as counted by games()can_talk()Get set "can_talk", used by "tick" to display reminders.load_game()Returns a Games::GuessWord instancemsg_guess()Displays the word to guessget_delay()Returns a random time calculated: delay() * (1 + rand(4)) secondsdelay()Get set base delay in seconds. Default is 30s.input()Get/set inputresponse()Get/set responseset_response( type )Sets the response from a response typeget_a_msg( type )Returns a msg of a given typeguess_word( word )Guess a word : success or one chance lessguess_letter( letter )Guess a letter : match or one chance lessconclusion()Displays an end of game message : sucess or lostgive_advice( guess )Bot::BasicBot METHODSThese are the Bot::BasicBot overriden methodssaid( $args )This is the main method, everything said is analysed to provide a reply if appropriatehelp()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 ALSOBot::BasicBotAUTHORPierre Denis <pierre@itrelease.net>http://www.itrelease.net/ COPYRIGHTCopyright 2005 IT Release Ltd - All Rights Reserved.This module is released under the same license as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |