Mercurial > irccd
comparison plugins/hangman/hangman.md @ 0:1158cffe5a5e
Initial import
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 08 Feb 2016 16:43:14 +0100 |
parents | |
children | 8384df86e195 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1158cffe5a5e |
---|---|
1 --- | |
2 title: "Hangman plugin" | |
3 header: "Hangman plugin" | |
4 --- | |
5 | |
6 Hangman is a plugin to play the hangman game. | |
7 | |
8 ## Installation | |
9 | |
10 The plugin **hangman** is distributed with irccd. To enable it add the following to your `plugins` section: | |
11 | |
12 ````ini | |
13 [plugins] | |
14 hangman = "" | |
15 ```` | |
16 | |
17 ## Usage | |
18 | |
19 The **hangman** plugin starts when a user execute its special command with no arguments. | |
20 | |
21 ```` | |
22 markand: !hangman | |
23 irccd: markand, the game is started, the word to find is: _ _ _ _ _ _ _ _ _ _ _ | |
24 ```` | |
25 | |
26 ### Proposal | |
27 | |
28 There are two ways for proposing a response to the game. You can either just ask for a letter or for a whole word. | |
29 | |
30 #### By letter | |
31 | |
32 When asking a letter, the message must just be one letter. | |
33 | |
34 ```` | |
35 markand: c | |
36 irccd: markand, nice! the word is now c _ _ _ _ | |
37 jean: k | |
38 irccd: markand, there is no 'k'. | |
39 ```` | |
40 | |
41 #### By full word | |
42 | |
43 When asking by a word, just put one word as command. | |
44 | |
45 ```` | |
46 markand: !hangman couch | |
47 irccd: markand, this is not the word. | |
48 jean: !hangman candy | |
49 irccd: markand, congratulations, the word is candy. | |
50 ```` | |
51 | |
52 ## Configuration | |
53 | |
54 The **hangman** plugin can be configured to show different message and to specify a different database file. The default | |
55 database file is **CONFDIR/plugin/hangman/words.conf**. | |
56 | |
57 The following options are available under the `[plugin.hangman]` section: | |
58 | |
59 - **collaborative**: (bool) set to true to enable collaborative mode, a player can't propose two consecutives proposals (Optional, default: true), | |
60 - **file**: (string) the path to the database file, | |
61 - **format-asked**: (string) when a letter has been already asked but present in the word, | |
62 - **format-dead**: (string) when the man was hung, | |
63 - **format-found**: (string) when a correct letter has been placed, | |
64 - **format-running**: (string) when a game is requested but it's already running, | |
65 - **format-start**: (string) when the game starts, | |
66 - **format-win**: (string) when the game succeeded, | |
67 - **format-wrong-word**: (string) when a word proposal is wrong, | |
68 - **format-wrong-letter**: (string) when a letter proposal is wrong. | |
69 | |
70 ### Keywords supported | |
71 | |
72 The following keywords are supported: | |
73 | |
74 | Format | Keywords | Notes | | |
75 |-------------------------|-----------------------------------|---------------------------------| | |
76 | (any) | server, channel, nickname, origin | all formats | | |
77 | **format-asked** | letter | the letter proposal | | |
78 | **format-dead** | word | the word to find | | |
79 | **format-found** | word | the hidden word | | |
80 | **format-start** | word | the hidden word | | |
81 | **format-win** | word | the word to find | | |
82 | **format-wrong-word** | word | the invalid word proposal | | |
83 | **format-wrong-letter** | letter | the letter proposal | | |
84 | |
85 Example: | |
86 | |
87 ````ini | |
88 [plugin.hangman] | |
89 format-win = "nice job, the word was #{word}!" | |
90 format-wrong-letter = "please try again, there is no #{letter}" | |
91 ```` | |
92 | |
93 ## Database file | |
94 | |
95 The database file must contains one word per line. | |
96 | |
97 Example: | |
98 | |
99 ```` | |
100 $ cat ~/.config/irccd/plugin/hangman/words.conf | |
101 sky | |
102 irccd | |
103 FreeBSD | |
104 door | |
105 cat | |
106 ```` |