Skip to content
brrr edited this page Jul 26, 2014 · 24 revisions

Welcome to the irccasino wiki!

irccasino is a Java package that implements various casino games using the PircBotX library.

An implementation of the project is currently being hosted on Freenode on ##holdem and ##casino. Feel free to check it out!

Requirements

  1. Java 1.7+
  2. PircBotX 1.9
  3. Xerial SQLite JDBC Driver

Adding package to an existing PircBotX bot

Each game within the package is implemented as an extension of ListenerAdapter, which can be added to any ListenerManager. The games require that the PircBotX managing the games implement the GameManager interface. A sample implementation can be found in CasinoBot. Starting up a new game is as simple as creating a new instance and adding it to a ListenerManager. Each game is initialized with a GameManager, commandChar, Channel, and INI file (optional).

For example: myBot.getListenerManager().addListener(new Blackjack(myBot, '.', channel))

Initialization files

Initialization files are automatically generated with default values in the run folder of the bot, if a custom file is not specified and one does not already exist. They are named based on the lowercase form of the class they represent (ie. blackjack.ini). Settings within the initialization files are of the form setting=value. It's recommended that custom initialization files be modified from copies of the auto-generated files.

Library files

Explanations for each game command can be found in the included .help files. The gcommands and ghelp commands rely on these files to function. strlib.txt serves to store output messages for the bot. sqllib.lib stores queries used for database transactions. These files can all be reloaded in any game without having to restart the bot. All library files must be placed in the run directory of the bot.