Moblist

Moblist

Postby Akaya » Fri Jul 01, 2016 4:22 am

I noticed there was a JSON file for mobs on the webpage. Though I can't seem to parse it with Mudlet like I can with the eqlist. I recieve a malformed JSON error. I'm familiar with JSON. But not enough so to detect an error it seems. Could anyone lend a hand? Maybe I'm doing something wrong.

The mob JSON file can be found here: http://www.slothmud.org/wp/equipment/eqlist?dl=07&dlk=9cb66283451c196d54bc117e2c1b369c&lua=0&mobs=1

Here's the error I recieve:
Code: Select all
 Lua syntax error:InvalidJSONInput: parse error: trailing garbage
          ":"Weylyn","AREA_VNUM":"76"} {"MOB_VNUM":"130146","MOB_NAME"
                     (right here) ------^
User avatar
Akaya
40 Prime Poster
 
Posts: 78
Joined: Thu Jan 10, 2013 3:10 am
Status: Offline

Re: Moblist

Postby Akaya » Fri Jul 01, 2016 4:33 am

Did a bit of research and it seems that each line is valid JSON, but it needs to be placed into an array. So to turn it into a proper array you'd separate each object with a "," and wrapping that up in an array with "[]"'s ?

Does this sound familiar Breeze? I know you helped me sort out eqlist. Did you have to do this with that one too?

It's 12,000+ lines of code so manually doing this is daunting.
User avatar
Akaya
40 Prime Poster
 
Posts: 78
Joined: Thu Jan 10, 2013 3:10 am
Status: Offline

Re: Moblist

Postby *Breeze* » Sat Jul 02, 2016 6:24 pm

Let me get back to you on that. That file was there for an alt eq list and me meant to be parsed with php. Will add a Lua switch like I did for the eqlist.
User avatar
*Breeze*
Avatar Poster
 
Posts: 520
Joined: Mon Nov 05, 2007 9:24 am
Status: Offline

Re: Moblist

Postby *Breeze* » Sat Jul 09, 2016 7:33 pm

try that... new entry "LUA MOBS" same place as the rest.

i think i got it right.

make sure i didnt break eqlist export in lua too, if you can please.
User avatar
*Breeze*
Avatar Poster
 
Posts: 520
Joined: Mon Nov 05, 2007 9:24 am
Status: Offline

Re: Moblist

Postby Akaya » Wed Jul 13, 2016 11:04 pm

The Lua file for eqlist still works as expected. But the LUA MOBS file is still returning the same error mentioned above.

Here's a snippet of what I use to parse the LUA MOBS file within Mudlet if it helps with debugging...
Code: Select all
function initMoblist()
  dofile(getMudletHomeDir().."/moblist.lua")
  moblist = yajl.to_value(MOBS)
end

initMoblist()


I do the same with eqlist which seems to work fine...
Code: Select all
function initEqlist()
  dofile(getMudletHomeDir().."/eqlist.lua")
  eqlist = yajl.to_value(EQLIST)
end

initEqlist()
User avatar
Akaya
40 Prime Poster
 
Posts: 78
Joined: Thu Jan 10, 2013 3:10 am
Status: Offline

Re: Moblist

Postby *Breeze* » Thu Jul 14, 2016 12:14 am

try again...

made a small change.

http://json.parser.online.fr/ and json decode in php both handle the _huge_ string properly.
User avatar
*Breeze*
Avatar Poster
 
Posts: 520
Joined: Mon Nov 05, 2007 9:24 am
Status: Offline

Re: Moblist

Postby Akaya » Thu Jul 14, 2016 2:04 am

Works! Awesome. Thank you! I can do some cool stuff with this now...
User avatar
Akaya
40 Prime Poster
 
Posts: 78
Joined: Thu Jan 10, 2013 3:10 am
Status: Offline

Re: Moblist

Postby *Breeze* » Thu Jul 14, 2016 2:10 am

viel Spass damit
User avatar
*Breeze*
Avatar Poster
 
Posts: 520
Joined: Mon Nov 05, 2007 9:24 am
Status: Offline

Re: Moblist

Postby Akaya » Thu Jul 14, 2016 2:13 am

Ich werde. Vielen Dank.
User avatar
Akaya
40 Prime Poster
 
Posts: 78
Joined: Thu Jan 10, 2013 3:10 am
Status: Offline

Re: Moblist

Postby Akaya » Thu Jul 14, 2016 2:18 am

Now if we could just get the AREA_VNUM added to the MSDP, I can tie this in with a map :)
User avatar
Akaya
40 Prime Poster
 
Posts: 78
Joined: Thu Jan 10, 2013 3:10 am
Status: Offline

Re: Moblist

Postby *Breeze* » Thu Jul 14, 2016 2:32 am

Email me
User avatar
*Breeze*
Avatar Poster
 
Posts: 520
Joined: Mon Nov 05, 2007 9:24 am
Status: Offline


Return to Mudlet - unlimited possibilities

Who is online

Users browsing this forum: No registered users and 7 guests