Jump to content
Abdulla060

can't get data from JSON file

Recommended Posts

Abdulla060

Hi all, i need to get data from a json file that was obtained from the api of a video game that i'm playing (the script is used for inventory analysis) however this code example returns an empty response no matter which path i chose 

#include "json.au3"

testfunc()

func testfunc()
    $fileopen = FileOpen(@ScriptDir & "/testdata.json")
    $fileRead = FileRead($fileopen)
    $testvar = Json_Decode($fileRead)
    $sFinaldata = json_get($testvar, 'items[0].verified')
    MsgBox(0,"", $sFinaldata)
EndFunc

i used this exact script on other json file examples and it worked just fine

i tried checking my file suing this site https://jsonlint.com/ and it showed that it is a valid json file :blink: and yet i still cant get my data from it

testdata.json

Share this post


Link to post
Share on other sites
Jos
Posted (edited)
27 minutes ago, Abdulla060 said:

json file that was obtained from the api of a video game that i'm playing

Look at json_dump and while you are looking for stuff, also read our forumrules, particularly the part about game interaction.

Jos 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×