75 posts
Posted 09 February 2016 - 12:39 PM
Since the answers present here in the forum seem to be outdated/diffuse and the official Wiki seems to have 0 information on that and the API does not mention it as well (at least I could not find it): How can I return a table in the callMethod(…) function for a custom Peripheral? I tried using a Hashmap but it does not give back a table, it gives more like a String with several lines.
1426 posts
Location
Does anyone put something serious here?
Posted 09 February 2016 - 02:12 PM
Can you post your code? Returning a map should work correctly.
75 posts
Posted 09 February 2016 - 04:25 PM
https://gist.github....-java-L942-L950That gives something like
{
Keridos = 7
}
instead of a table
Edited on 09 February 2016 - 03:26 PM
1426 posts
Location
Does anyone put something serious here?
Posted 09 February 2016 - 04:58 PM
Your code is correct.
If you are running this in the "lua" program, then if will format all tables like that to allow easier debugging. eg:
> a = { hello = "foo", world = "bar" }
> a
{
hello = "foo",
world = "bar"
}
You should still be able to use it as a table.
75 posts
Posted 09 February 2016 - 05:37 PM
ah thats new then. thanks.