Skip to main content

A Python Library for Illuvium Zero Land Management

Project description

Pyilz - An Illuvium Zero Python library

build-status-image pypi-version coverage-status-image

Overview

This package hopes to make automation and management of Illuvium Zero Land a little easier by allowing you to interact with the gamestate APIs.

As the current Alpha version has no server-side authority the methods implemented only perform reads as to not break your gamestate.

This library CAN be used while you have the game running as it uses your local machines device_id, without this your game client would log-out due to different devices running the same plot.

Currently only supports Windows as replicating the get_device_id implementation from the Unity game engine requires WMI.

Installation

Install using pip...

pip install pyilz

Requirements

  • Python 3.7+
  • Your Cognito access_token or refresh_token See below

Tokens can either be passed into the get_game_state function or pulled from the environment variables if available.

Environment Variables

REFRESH_TOKEN=...
ACCESS_TOKEN=...

Acquiring your Cognito tokens


At the time of writing this there is no way of generating application scoped access tokens so the only way to authenticate against the gamestate APIs is by logging into https://play.illuvium.io/ and retrieving the tokens from local storage.

DO NOT share your refresh_token or access_token, the refresh_token can generate new access_tokens for up to 30 days.

Example of tokens in Chromium Local Storage

access_tokens.png

Example

from pyilz.get_token import get_token
from pyilz.get_game_state import get_game_state
from pyilz.parse_land import parse_land, get_buildings_and_activities
from pyilz.get_timers import get_timers
from pyilz.get_buildings import get_building_storage, get_active_output, get_passive_output
from pyilz.get_plots import get_plot_metadata

# Load ACCESS_TOKEN and REFRESH_TOKEN env vars
import dotenv
dotenv.load_dotenv()

# Get access token
token = get_token()

# Get list of plots
plots = get_game_state(token)['data']

# Get the second plot in game state
plot = plots[2]['data']
landId = plots[2]['landId']

# Look up metadata to get region and tier
metadata = get_plot_metadata(landId)
tier = metadata['tier']
region = metadata['region']

# Get Paths, Buildings, Current, Automatic and Completed Actions
building_data = parse_land(plot)
paths, buildings, ca, aa, completed = get_buildings_and_activities(building_data)

# Get timers from actions
timers = get_timers(ca, aa, completed)

# Get total storage
storage = get_storage(building_data, tier)

# Get the output from active and passive actions
hydrogen_pump_5_active = get_active_output("Hydrogen Pump", level=5, tier=tier, efficiency=150)
sequestrian_plant_5_passive = get_passive_output("Sequestrian Plant", level=5, tier=tier, efficiency=150)

Package management

Build

py -m pip install --upgrade build
py -m build

Release

py -m pip install --upgrade twine
py -m twine upload --repository pypi dist/*

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

pyilz-0.0.23.tar.gz (72.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyilz-0.0.23-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

File details

Details for the file pyilz-0.0.23.tar.gz.

File metadata

  • Download URL: pyilz-0.0.23.tar.gz
  • Upload date:
  • Size: 72.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for pyilz-0.0.23.tar.gz
Algorithm Hash digest
SHA256 0b16e93fe428a1fb9ebf6e4642c35a8fd1545b952bcdb478f7577c6194b01a02
MD5 804b6789d688ed5d1ed335e9bbdebc28
BLAKE2b-256 e87f93a961cb2f52afaa4220ba13675208b9565f86734493844a45ef0432014a

See more details on using hashes here.

File details

Details for the file pyilz-0.0.23-py3-none-any.whl.

File metadata

  • Download URL: pyilz-0.0.23-py3-none-any.whl
  • Upload date:
  • Size: 26.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for pyilz-0.0.23-py3-none-any.whl
Algorithm Hash digest
SHA256 78f037dc2569669d2a5cceea6b7ae103a4b90d0b67fec9cdfbabf0cce180432e
MD5 c78e721931d60b6c9a031922de2f680e
BLAKE2b-256 4cda8170bab24eff770606438cb62a815b5284d10c9591f0f9aa81ad2d368663

See more details on using hashes here.

Supported by

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