|
| 13 Jan 2017 03:52 PM |
| So I tried making a script that gives me a JSON List of the Catalog: hs = game:GetService("HttpService") myTableJSON = ############################################################################################### true) myTable = hs:JSONDecode(myTableJSON) print(myTableJSON) But in my output I get this: "23C25B28" But if I don't Decode it I get a whole JSON List But My script doesn't recognize it as a Table. How can I convert the JSON list into a Table? |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2017 03:56 PM |
For the TableJSON Part its: myTableJSON = hs:GetAsync("WebsiteNameHere", true)
(Sorry it got Hashtagged) |
|
|
| Report Abuse |
|
|
TaaRt
|
  |
| Joined: 26 Apr 2009 |
| Total Posts: 5039 |
|
|
| 13 Jan 2017 03:59 PM |
| Uhh, you're printing the table, which returns a hexadecimal memory adress to where the table is located. |
|
|
| Report Abuse |
|
|
pketny
|
  |
| Joined: 27 Dec 2010 |
| Total Posts: 1162 |
|
|
| 13 Jan 2017 03:59 PM |
You can't print a table's content by using print(table), that will give you the memory address it's stored on.
try this:
for i,v in pairs (table) do print(i,v) end
I suggest you read these articles:
http://wiki.roblox.com/index.php?title=Table
http://wiki.roblox.com/index.php?title=Loops#For
http://wiki.roblox.com/index.php?title=Global_namespace/Basic_functions#pairs |
|
|
| Report Abuse |
|
|
SteadyOn
|
  |
| Joined: 20 Mar 2011 |
| Total Posts: 600 |
|
|
| 13 Jan 2017 04:00 PM |
| ######################################################################################################## |
|
|
| Report Abuse |
|
|
SteadyOn
|
  |
| Joined: 20 Mar 2011 |
| Total Posts: 600 |
|
|
| 13 Jan 2017 04:01 PM |
| ############################################################################################################################## |
|
|
| Report Abuse |
|
|
SteadyOn
|
  |
| Joined: 20 Mar 2011 |
| Total Posts: 600 |
|
|
| 13 Jan 2017 04:01 PM |
om why is this happening
- R$111 Visit my website for scripting tutorials! https://twitter.com/2Steady4U/status/820027971826253824 |
|
|
| Report Abuse |
|
|
SteadyOn
|
  |
| Joined: 20 Mar 2011 |
| Total Posts: 600 |
|
|
| 13 Jan 2017 04:02 PM |
THERE
OK TO PRINT PART OF A TABLE, PUT THIS
{table}[value in table]
for example
cars[5]
- R$111 Visit my website for scripting tutorials! https://twitter.com/2Steady4U/status/820027971826253824 |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2017 04:02 PM |
| So how can I convert the JSON List into a Table? |
|
|
| Report Abuse |
|
|
SteadyOn
|
  |
| Joined: 20 Mar 2011 |
| Total Posts: 600 |
|
|
| 13 Jan 2017 04:03 PM |
it is already a table
- R$111 Visit my website for scripting tutorials! https://twitter.com/2Steady4U/status/820027971826253824 |
|
|
| Report Abuse |
|
|
pketny
|
  |
| Joined: 27 Dec 2010 |
| Total Posts: 1162 |
|
|
| 13 Jan 2017 04:04 PM |
You already did here:
hs:JSONDecode(myTableJSON)
I suggest just following this tutorial before doing something with the HttpService
http://wiki.roblox.com/index.php?title=Sending_HTTP_requests
http://wiki.roblox.com/index.php?title=API:Class/HttpService |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2017 04:05 PM |
I tried doing this:
print(MyTableJSON[1]) but that didn't work... |
|
|
| Report Abuse |
|
|
SteadyOn
|
  |
| Joined: 20 Mar 2011 |
| Total Posts: 600 |
|
|
| 13 Jan 2017 04:06 PM |
Dude you can't just say "it didnt work"
elaborate
- R$111 Visit my website for scripting tutorials! https://twitter.com/2Steady4U/status/820027971826253824 |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2017 04:09 PM |
I get this in my OutPut: "nil" |
|
|
| Report Abuse |
|
|
pketny
|
  |
| Joined: 27 Dec 2010 |
| Total Posts: 1162 |
|
| |
|
SteadyOn
|
  |
| Joined: 20 Mar 2011 |
| Total Posts: 600 |
|
|
| 13 Jan 2017 04:10 PM |
pls dont put a capital on put thats not how scripting works output isnt a variable name
- R$111 Visit my website for scripting tutorials! https://twitter.com/2Steady4U/status/820027971826253824 |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2017 04:11 PM |
I get this in my output: table: 1F299100 |
|
|
| Report Abuse |
|
|
SteadyOn
|
  |
| Joined: 20 Mar 2011 |
| Total Posts: 600 |
|
|
| 13 Jan 2017 04:13 PM |
wait what is there a table with in a table or something
- R$111 Visit my website for scripting tutorials! https://twitter.com/2Steady4U/status/820027971826253824 |
|
|
| Report Abuse |
|
|
pketny
|
  |
| Joined: 27 Dec 2010 |
| Total Posts: 1162 |
|
|
| 13 Jan 2017 04:15 PM |
Yes, there is a table in a table,
try print(myTable[1][1])
(maybe you could have thought of that yourself) |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2017 04:15 PM |
Why when I print out Items of my Table it gives me a code? Like this: 1F299100 |
|
|
| Report Abuse |
|
|
pketny
|
  |
| Joined: 27 Dec 2010 |
| Total Posts: 1162 |
|
|
| 13 Jan 2017 04:15 PM |
I suggest reading this article before continuing:
http://wiki.roblox.com/index.php?title=Table |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2017 04:19 PM |
I tried this: print(myTable[1][1])
I get "nil" |
|
|
| Report Abuse |
|
|
pketny
|
  |
| Joined: 27 Dec 2010 |
| Total Posts: 1162 |
|
|
| 13 Jan 2017 04:20 PM |
Ok for this time try to think yourself.
What does that mean you think?
Use all the info u got |
|
|
| Report Abuse |
|
|
JoshRBX
|
  |
| Joined: 19 May 2012 |
| Total Posts: 8778 |
|
|
| 13 Jan 2017 04:21 PM |
| PM me the link to this website and I'll help you. |
|
|
| Report Abuse |
|
|
Kutoru
|
  |
| Joined: 22 May 2016 |
| Total Posts: 288 |
|
|
| 13 Jan 2017 04:25 PM |
{ "glossary": { "title": "example glossary" } }
tab.glossary.title tab["glossary"]["title"]
|
|
|
| Report Abuse |
|
|