- wait until fully connected (irc.welcome) before sending PING
- do not send another PING until PONG is received
These changes prevent the bot from sending multiple PINGs when the
ircd is heavily lagging. The multiple PINGs would queue up and then
get sent all at once when the ircd unlagged, potentially causing an
excess-flood disconnection.
- host/lib/SplitLine: preserve \t tabs
- host/lib/InteractiveEdit: encode history as JSON to preserve newlines
- host/lib/Languages/_default: strip joined space following newlines
Uses POSIX shell parameter expansion syntax.
<pragma-> !factadd cookie /me gives a cookie to ${args:-nobody. What a shame}!
<PBot> cookie added to the global channel.
<pragma-> !cookie Bob
* PBot gives a cookie to Bob!
<pragma-> !cookie
* PBot gives a cookie to nobody. What a shame!
<pragma-> !factadd sum /call calc $arg[0]:-1 + $arg[1]:-2
<PBot> sum added to the global channel.
<pragma-> !sum
<PBot> 1 + 2 = 3
<pragma-> !sum 3
<PBot> 3 + 2 = 5
<pragma-> !sum 4 6
<PBot> 4 + 6 = 10
This fixes e.g.:
<pragma-> ,{echo foo ;;; echo bar} ,{echo baz}
<PBot> foo bar
<PBot> foo baz
To instead produce the expected:
<PBot> foo bar
<PBot> baz
The number of rounds, questions and bonus rounds are now all configurable via
`spinach set settings`.
Refactored states to not transition of a false value is returned, to eliminate
all explicit "wait" states.
Refactored ridiculous large per-round/per-question state transitions and
subroutines into a much more manageable and simpler state machine.
Now can easily and trivially adjust maximum rounds and maximum questions
by editing $self->{game} hashtable entries. TODO: make this configurable
via `spinach set`.
Replaced "/msg me" with "/msg $botnick" throughout.
Adjusted lie validation:
* If all words of lie are found within solution and word-count of lie is
less than word-count of solution, then game will say "So-and-so has found
part of the truth!"
* If lie is 20%-or-less different to the solution, then game will say
"So-and-so has misspelled the truth!"
This allows us to set `locked` to a value greater than `1` to lock a factoid WITHOUT
allowing invocation of `required_caps` commands. This lets us safely lock a factoid
that has unrestrained `$args` or variables.