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.
0
How to return a table in your own Peripheral?
Started by Keridos, Feb 09 2016 12:39 PM
api peripheral help
4 replies to this topic
#1
Posted 09 February 2016 - 12:39 PM
#2
Posted 09 February 2016 - 02:12 PM
Can you post your code? Returning a map should work correctly.
#3
Posted 09 February 2016 - 04:25 PM
https://gist.github....-java-L942-L950
That gives something like
That gives something like
{ Keridos = 7 }instead of a table
Edited by Keridos, 09 February 2016 - 04:26 PM.
#4
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:
You should still be able to use it as a table.
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.
#5
Posted 09 February 2016 - 05:37 PM
ah thats new then. thanks.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users