File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22-- This wrapper allows the program to run headless on any OS (in theory)
33-- It can be run using a standard lua interpreter, although LuaJIT is preferable
44
5+ local dkjson = require (" runtime.lua.dkjson" )
6+
57
68-- Callbacks
79local callbackTable = { }
@@ -209,11 +211,14 @@ function loadBuildFromXML(xmlText, name)
209211 mainObject .main :SetMode (" BUILD" , false , name or " " , xmlText )
210212 runCallback (" OnFrame" )
211213end
212- function loadBuildFromJSON (getItemsJSON , getPassiveSkillsJSON )
214+ function loadBuildFromJSON (characterJSON )
213215 mainObject .main :SetMode (" BUILD" , false , " " )
214216 runCallback (" OnFrame" )
215- local charData = build .importTab :ImportItemsAndSkills (getItemsJSON )
216- build .importTab :ImportPassiveTreeAndJewels (getPassiveSkillsJSON , charData )
217+ -- characterJSON could, for example, be the response from the PoE API:
218+ -- https://www.pathofexile.com/developer/docs/reference#characters-get
219+ local input = dkjson .decode (characterJSON )
220+ local charData = build .importTab :ImportItemsAndSkills (input )
221+ build .importTab :ImportPassiveTreeAndJewels (input )
217222 -- You now have a build without a correct main skill selected, or any configuration options set
218223 -- Good luck!
219224end
You can’t perform that action at this time.
0 commit comments