Jump to content

can't get data from JSON file


Recommended Posts

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

Link to comment
Share on other sites

  • Developers
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 etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Jos locked this topic
Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...