File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33-- It can be run using a standard lua interpreter, although LuaJIT is preferable
44
55
6+
67-- Callbacks
78local callbackTable = { }
89local mainObject
@@ -209,11 +210,15 @@ function loadBuildFromXML(xmlText, name)
209210 mainObject .main :SetMode (" BUILD" , false , name or " " , xmlText )
210211 runCallback (" OnFrame" )
211212end
212- function loadBuildFromJSON (getItemsJSON , getPassiveSkillsJSON )
213+ function loadBuildFromJSON (characterJSON )
213214 mainObject .main :SetMode (" BUILD" , false , " " )
214215 runCallback (" OnFrame" )
215- local charData = build .importTab :ImportItemsAndSkills (getItemsJSON )
216- build .importTab :ImportPassiveTreeAndJewels (getPassiveSkillsJSON , charData )
216+ -- characterJSON could, for example, be the response from the PoE API:
217+ -- https://www.pathofexile.com/developer/docs/reference#characters-get
218+ local dkjson = require " dkjson"
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