Skip to main content

A Python module and bridge for reflecting KoLmafia's Java environment.

Project description

pymafia

A Python module and bridge for reflecting KoLmafia's Java environment.

Overview

The aim of the pymafia module is to provide an easy-to-use environment for scripting Kingdom of Loathing in Python. It achieves this by reflecting and wrapping the community-developed KoLmafia desktop tool. While other languages for scripting KoL exist, they are arguably less approachable to non-developers than Python (although the efforts of LASS have made this less so).

Installation

pip install pymafia

The pymafia module uses PyJNIus to access Java classes, so make sure a Java Development Kit (JDK) is installed on your operating system. On windows, make sure JAVA_HOME points to your java installation so PyJNIus can locate the jvm.dll file to start java. For more information see https://pyjnius.readthedocs.io/en/stable/installation.html.

Quickstart

>>> from pymafia import *

>>> login("devster6")
>>> ash.my_name()
"devster6"

>>> Effect("Synthesis: Greed").quality
<EffectQuality.GOOD: 0>

>>> ash.display_amount(Item("big rock"))
6540

>>> ash.appearance_rates(Location("Barf Mountain"))
{Monster('none'): 0.0,
 Monster('angry tourist'): 33.333333333333336,
 Monster('horrible tourist family'): 33.333333333333336,
 Monster('garbage tourist'): 33.333333333333336}

>>> get_property("sourceTerminalEducate1")
'digitize.edu'

>>> get_property("_sourceTerminalDigitizeMonster", Monster)
Monster('Knob Goblin Embezzler')

>>> boxing_daycare.have()
True

>>> witchess.fights_left()
5

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

pymafia-0.1.2.tar.gz (21.3 kB view details)

Uploaded Source

Built Distribution

pymafia-0.1.2-py3-none-any.whl (34.9 kB view details)

Uploaded Python 3

File details

Details for the file pymafia-0.1.2.tar.gz.

File metadata

  • Download URL: pymafia-0.1.2.tar.gz
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.6 Linux/5.15.0-1019-azure

File hashes

Hashes for pymafia-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e1a0b31fdd0763bf605f45d38229915c1f8f2a234bc99bc24ecf24ede37a2758
MD5 e8fb5b389a7b6c6810df623fa0a85159
BLAKE2b-256 5a7a35db2aa2d7498cdb981dc21c28bb9771fb179793baae7c54c70ac8ab4a45

See more details on using hashes here.

File details

Details for the file pymafia-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pymafia-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 34.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.6 Linux/5.15.0-1019-azure

File hashes

Hashes for pymafia-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4de02679515df62d79f57c5f35fee9c0cd51dff2fcf8f85dc1460cadc6b2ed6a
MD5 dcd07a0f4f65d9ecf86752db165edc8d
BLAKE2b-256 629e994f38f1ff05918dcb2bfb57083d3774c6af6da82960faa2d2a230ec010d

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