Commit Graph

46 Commits

Author SHA1 Message Date
5ce4d4bfe4
Lower nickname in Jeopardy cashout
Align with GetTarget() which is used in games to have consistent
handling of nicknames regardless of their casing.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2024-10-09 23:36:45 +02:00
c4ff70da70 Merge pull request 'Improve Jeopardy cashout message' (#24) from jeopardymsg into master
Reviewed-on: #24
2024-10-03 19:55:50 +02:00
7ec49a9769
Improve Jeopardy cashout message
Print only a single message instead of one per winner to reduce chat
clutter.
Skip cashout to users who won less than the possible cashout value as
limited by the division value to avoid congratulating someone who only
gets 0.
Abort should a regression cause the logic to process an empty set of
finishers to prevent unexpected behavior.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2024-10-03 19:43:39 +02:00
b6187e0077 Merge pull request 'Change host lookup to be optional' (#23) from dbhost into master
Reviewed-on: #23
2024-10-03 18:00:59 +02:00
accf16c92a
Change host lookup to be optional
Some parts of the logic do not make use of the host column in the
players table, allow the field to be empty and do not query for an empty
value (which might return bogus entries) if no value is passed to the
lookup function.
This additionally avoids the need for the hardcoded initial host when
configuring the bot player.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2024-10-02 22:30:06 +02:00
394d6ca2fa Merge pull request 'Strip formatting codes' (#19) from format into master
Reviewed-on: #19
2024-10-02 21:44:49 +02:00
d99a0d84bf
Strip formatting codes
To allow for correct parsing of messages containing formatting codes and
to avoid exploitation of unparseable messages, strip all formatting
codes from a message when entering the parsing chain.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2024-10-02 21:40:30 +02:00
a5cc5e0317 Merge pull request 'Implement Jeopardy cashout' (#18) from jeopardy into master
Reviewed-on: #18
2024-10-02 20:07:10 +02:00
89ed59a9c7
Explain Jeopardy finishers parsing
Elaborate as the convoluted logic can be difficult to understand.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2024-10-02 20:03:56 +02:00
d06e724f06
Refactor integrations
Move to a separate file for better code structure and to avoid huge
branching inside Msg().

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2024-10-02 20:03:56 +02:00
97e9d7d0c2
Implement Jeopardy cashout
This adds integration between Watbot and the Limnoria Jeopardy plugin.
If a game of Jeopardy ends, Watbot will parse the finishers message and
pay a small share of the Jeopardy price money in the form of Watcoins.
To avoid abuse, only Jeopardy finishing messages from authorized bots
are considered. An IRC user is considered an authorized bot if the
hostmask matches one of the configured bot hostmasks, and if the
nickname is configured for "jeopardy" in the newly introduced bot games
configuration.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>

Add sample message to Jeopardy logic

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2024-09-29 14:36:23 +02:00
a475bc2f42 Merge pull request 'Implement configuration file + automatic channel joining' (#14) from config into master
Reviewed-on: #14
2024-09-28 19:43:10 +02:00
0a90b6e483
Implement automatic channel joining
Avoid the need for an administrator to join the bot to channels by
implementing a configuration option allowing the passing of channels
the bot should always join to by itself upon startup.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2024-09-28 19:33:18 +02:00
cc322e87e6
Replace redundant logic in Admin()
The Allowed() function already implements this loop, use it to reduce
redundant code.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2024-09-28 19:33:18 +02:00
bde9a8defb
Implement configuration file
Abstract settings which commonly differ between instances to a YAML
based configuration file to allow for easy administration without the
need for modifying the source code.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2024-09-28 19:33:17 +02:00
f4a9607770 Merge pull request 'Remove count script' (#16) from count into master
Reviewed-on: #16
2024-09-24 23:12:50 +02:00
dbaf6f046a
Remove count script
Unable to find a purpose.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2024-09-24 21:59:25 +02:00
331d38694e Merge pull request 'Remove and ignore binary' (#15) from gitignore into master
Reviewed-on: #15
2024-09-24 21:13:01 +02:00
bd7d3abf24
Remove and ignore binary
Build artifacts shouldn't be tracked in version control.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2024-09-21 16:22:04 +02:00
be1b15b6f9 Merge pull request 'Add myself as admin' (#12) from admin into master
Reviewed-on: #12
2024-09-21 07:23:34 +02:00
84696672cd
Add myself as admin
For some administrative operations, such as joining channels, it would
be useful if I could "imp"ersonate the bot.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2024-09-21 01:09:28 +02:00
28efaf9eec Merge pull request 'Basic systemd service' (#4) from systemd into master
Reviewed-on: #4
2022-03-01 12:24:28 +01:00
032475c1c8
Init systemd service
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2022-02-02 16:36:36 +01:00
mogad0n
379891b2d0
initial commit 2021-03-10 19:33:48 +05:30
alex
85ff6578e8 fixes #8 2019-09-22 10:56:10 +01:00
alex
03d9024509 fixes #9 2019-09-22 10:48:24 +01:00
alex
304fcff75c fixes #5 2019-07-10 16:29:44 +01:00
alex
e1eddb1b11 fixes #6 2019-06-28 18:55:46 +01:00
alex
62144ce8a1 fixes #7 2019-06-28 18:54:32 +01:00
alex
3b9233307a moved config around somewhat 2019-01-04 09:55:40 +00:00
alex
d4c4e38ba8 Added time limited bankrupcy, steroids for benching (don't persist across restarts), removed aliases from command list, ping, strongest, don't allow vlk to roll. 2019-01-04 09:20:39 +00:00
alex
ca91956e27 int64 -> uint64 for coins, disable noisy logging, turned off wattery (it was quickly abused), made anarchy less likely to win and time limited 2018-12-03 23:21:11 +00:00
alex
88d612e041 CanAct func, used in Riot and Lift 2018-11-16 01:01:29 +00:00
alex
7f72f6e3ec added actions table, makes it easier to add time based commands
reactivated bench with a 2400 limit
help command just outputs command structs because that's easier
lower all commands to account for caps mistakes
some hardcoded nick bits :\
removed disused db structs
2018-11-15 02:11:45 +00:00
alex
5c24c985d3 changed coins to uint64 and started using uints all over the place
added toplost
removed an ignore
2018-11-14 22:38:32 +00:00
alex
237d91de16 formatting changes from goimport
added a link to source, healing
parse ints through one function and return helpful errors that can be used as return values
added more error checking
improved some output
made some more joke methods
lazily added more if conditions for people i'm sick of
2018-11-08 10:40:08 +00:00
alex
ecb988a3d9 nm 2018-10-27 14:05:12 +01:00
alex
db4c1257b9 fixed rand to use crypto rand
fixed imp with imps but should go back to privmsg detection
give the bot money when people lose lel
2018-10-26 12:40:27 +01:00
alex
2b1c9889e5 misc improvements
added self reference, allowing the bot to accrue currency
messed about with some messages (removed swears, changed 'schlorped', etc)
improved send output
regular wattery to make 'wat' interesting
2018-10-25 01:04:35 +01:00
alex
30d5e6f076 added resting, messed about with stuff 2018-10-23 02:36:02 +01:00
alex
9120ee3691 fixed some bugs, fixed some debug behaviour, changed over to a command -> method map to avoid sending spurious messages 2018-10-23 00:15:28 +01:00
alex
19716c3afb added admin command for impersonating any irc command
remove db
2018-10-21 13:14:08 +01:00
alex
61b84d9fd9 Reimplemented python bot in golang, skipped a few features 2018-10-21 13:04:35 +01:00
alex
55bc749f89 Added flag lib for parsing env + flag + file 2018-10-20 00:59:07 +01:00
alex
289684b0f1 sorry for rehosting ur stuff (。◕ ‿ ◕。)
Added original source
Fixed readme typo (I fat fingered your username again whoops)
Fiddling with golang config
2018-10-20 00:45:25 +01:00
self
64cbb5254a Initial commit 2018-10-19 23:30:20 +00:00