Git Product home page Git Product logo

pob_wrapper's Introduction

Path of Building Wrapper

Allows use of an existing Path of Building installation from a Python application. If you don't know Path of Building is then you don't play Path of Exile and can safely ignore this.

This is simple initial implementation with limited functionality, but provides a base to build on.

Features

  • Launch PoB in headless mode as a controllable sub-processes
  • Load builds
  • Read basic build information
  • Updates builds (from pathofexile.com) and attempts to maintain chosen skill
  • Test the effect of items (output as HTML)
  • Test the effect of individual mod lines (output as diffs to all output stats)

Example

(taken from example.py)

Fire up Path of Building as a headless sub-process:

pob_install = r'D:\Programs\PathOfBuilding'
pob_path = r'D:\Programs\PathOfBuilding' # or `%ProgramData%\Path of Building` for installed version
pob = PathOfBuilding(pob_path, pob_install)

Ask where the builds are stored:

builds_path = pob.get_builds_dir()

...returns C:\Users\<username>\Documents\My Games\Path of Exile\Builds/

Load a build and get its basic info:

pob.load_build(rf'{builds_path}\Experiment\ZioniclesExperiment.xml')
build_info = pob.get_build_info()

Returns:

{'buildName': 'ZioniclesExperiment',
 'char': {'ascendClassName': 'Ascendant', 'className': 'Scion', 'level': 89},
 'file': {'path': 'C:\\Users\\<username>\\Documents\\My Games\\Path of '
                  'Exile\\Builds/\\Experiment\\ZioniclesExperiment.xml',
          'subpath': '\\Experiment\\'}}

Test the effect of a single mod line:

mod = "10% increased Intelligence"
effects = pob.test_mod_effect(mod)

Returns:

{'AverageDamage': 4114.275,
 'AverageHit': 4114.275,
 'Duration': 0.2175,
 'EnergyShield': 311.0,
...

Test the effects of a new item, outputting as HTML:

item = '''
Rarity: Rare
Hypnotic Circle
Opal Ring
--------
24% increased Elemental Damage (implicit)
--------
+48 to Intelligence
--------
Note: ~price 40 exa
'''
Path('test-item1.html').write_text(pob.test_item_as_html(item))

...produces something like the page below, although any item copied from a trade website will be handled.

Item test output

Things to improve

  • Detect where PoB was installed and/or where its data is (ProgramData).
  • Provide access to more build & skill data

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.