GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
IRC::Bot::Hangman(3) User Contributed Perl Documentation IRC::Bot::Hangman(3)

IRC::Bot::Hangman - An IRC hangman

  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";

  <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

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.

The plugins are managed by

  IRC::Bot::Hangman::WordList
  IRC::Bot::Hangman::Command
  IRC::Bot::Hangman::Response

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.

Returns a default english words list from IRC::Bot::Hangman::WordList

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

Get or set the number of games before ending. undef means infinity.

Get or set the hangman game. The default value is a Games::GuessWord instance with word_list() word list.

Reset the game

Reset the game unless it is the last game as counted by games()

Get set "can_talk", used by "tick" to display reminders.

Returns a Games::GuessWord instance

Displays the word to guess

Returns a random time calculated: delay() * (1 + rand(4)) seconds

Get set base delay in seconds. Default is 30s.

Get/set input

Get/set response

Sets the response from a response type

Returns a msg of a given type

Guess a word : success or one chance less

Guess a letter : match or one chance less

Displays an end of game message : sucess or lost

These are the Bot::BasicBot overriden methods

This is the main method, everything said is analysed to provide a reply if appropriate

Displays help when called "hangman help"

Called every now and then to display a reminder if the game is active and "can_talk" is on.

Bot::BasicBot

Pierre Denis <pierre@itrelease.net>

http://www.itrelease.net/

Copyright 2005 IT Release Ltd - All Rights Reserved.

This module is released under the same license as Perl itself.

2022-04-09 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.