Skip to main content

Create bots to play the card game Figgie at https://figgie.com/

Project description

figgiebot

Create bots to play the card game Figgie at https://figgie.com/

Installation

Simply run pip install figgiebot. The PyPI package is at https://pypi.org/project/figgiebot/

You will need to install Chromedriver

Dependencies

Usage

For an example algorithm look at example.py

from figgiebot import Bot

bot = Bot()

# <Bot Code>

bot.run(opponent_count=4)

The bot automatically starts new rounds.

Events

There are 6 event decorators. These are called as events happen in the Figgie game. The tick event is called every client tick (by default this is every 10ms + time to execute orders). Suits for figgiebot are "s", "c", "d", "h".

@bot.on_bid()
def on_bid(player, value, suit):
    # <write code here>


@bot.on_offer()
def on_offer(player, value, suit):
    # <write code here>


@bot.on_sold()
def on_sold(seller, buyer, value, suit):
    # <write code here>


@bot.on_bought()
def on_bought(buyer, seller, value, suit):
    # <write code here>


@bot.on_tick()
def on_tick():
    # <write code here>


@bot.on_round_start()
def on_round_start():
    # <write code here>

Game Commands

There are 6 game commands. These use selenium action chains to execute so will slow the client tps.

bot.bid(value, suit)

bot.offer(value, suit)

bot.buy(suit)

bot.sell(suit)

bot.cancel_suit_bids_and_offers(suit)

bot.cancel_all_bids_and_offers()

Game Date

The bot maintains the following up-to-date data of the state of the game.

bot.markets  # Dictionary with {"sell_value": 0, "buy_value": 0} for each suit

bot.hand  # e.g. {"s": 0, "c": 0, "d": 0, "h": 0}

bot.time_remaining  # The time remaining in seconds for the game round

bot.name  # The name of the bot in game

bot.opponents  # A list of names of opponents in the game

bot.opponent_chips  # A dictionary of the number of chips each opponent currently has

bot.chips  # The number of chips the bot currently has

Decks

You can also import from figgiebot figgie_decks which will be useful for your trading algorithm.

figgie_decks = [
    {"s": 12, "c": 8, "d": 10, "h": 10, "majority": 5, "payoff": 120, "goal": "c"},
    {"s": 12, "c": 10, "d": 10, "h": 8, "majority": 6, "payoff": 100, "goal": "c"},
    {"s": 12, "c": 10, "d": 8, "h": 10, "majority": 6, "payoff": 100, "goal": "c"},
    {"s": 8, "c": 12, "d": 10, "h": 10, "majority": 5, "payoff": 120, "goal": "s"},
    {"s": 10, "c": 12, "d": 10, "h": 8, "majority": 6, "payoff": 100, "goal": "s"},
    {"s": 10, "c": 12, "d": 8, "h": 10, "majority": 6, "payoff": 100, "goal": "s"},
    {"s": 8, "c": 10, "d": 10, "h": 12, "majority": 6, "payoff": 100, "goal": "d"},
    {"s": 10, "c": 8, "d": 10, "h": 12, "majority": 6, "payoff": 100, "goal": "d"},
    {"s": 10, "c": 10, "d": 8, "h": 12, "majority": 5, "payoff": 120, "goal": "d"},
    {"s": 8, "c": 10, "d": 12, "h": 10, "majority": 6, "payoff": 100, "goal": "h"},
    {"s": 10, "c": 8, "d": 12, "h": 10, "majority": 6, "payoff": 100, "goal": "h"},
    {"s": 10, "c": 10, "d": 12, "h": 8, "majority": 5, "payoff": 120, "goal": "h"}
]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

figgiebot-1.0.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

figgiebot-1.0.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file figgiebot-1.0.1.tar.gz.

File metadata

  • Download URL: figgiebot-1.0.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.0

File hashes

Hashes for figgiebot-1.0.1.tar.gz
Algorithm Hash digest
SHA256 4f32b633a640b9970cfe963bc89ac8bcfbcd5790f3410660696fd6a9f96baff0
MD5 78fd017a7a96a1584bf1955971ca42b3
BLAKE2b-256 cbc8e296ba8e3c5a399142d8ad7703dbf49c1a566c1b8ca3532940f33e9819e9

See more details on using hashes here.

File details

Details for the file figgiebot-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: figgiebot-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.0

File hashes

Hashes for figgiebot-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 349728917629660c941b923cd1dc6373511f9304943511357602690e8232164d
MD5 d26492f2464650978ad9e7ba99e4ef0a
BLAKE2b-256 6905856df8ee0a7dc62d0f86c7abdc396eace58822e114e931cb18f3007f037f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page