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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pymafia-0.0.2.tar.gz
.
File metadata
- Download URL: pymafia-0.0.2.tar.gz
- Upload date:
- Size: 21.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51afbadca7b2cbd704fa6ff9ca6c2a84c8f6a1a10d5a306677fb87bd16de943c |
|
MD5 | 4806b07b54b800dfa203aa99074fc849 |
|
BLAKE2b-256 | 4995ecb669da3de7a63cabcc8dda08d7ed65a80d47f14277f95aa11a52a0b3ba |
File details
Details for the file pymafia-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: pymafia-0.0.2-py3-none-any.whl
- Upload date:
- Size: 34.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 695cf6d6aeb555d1bd14d9b72df6a68110df687039297ab1beae7030543f6a77 |
|
MD5 | a523d8595cfece3a92eea6d118aa34e3 |
|
BLAKE2b-256 | 2cc523693f4fde24e2c1417a88992def429dd0c1a5866d622877386330c6a301 |