Posted 15 July 2015 - 08:17 PM
I've been working on a program for about a week now, it's kind if noobish. It is a program that allows a user to control a wireless mining turtle through a computer, but it has a built in GUI in the terminal. Since the GUI needs to update the players current position, where blocks are placed and which spaces have no blocks/spaces where blocks are available, I decided to use tables. This was because you can add/remove information from the tables.
So I have my tables labeled like this:
Now one of the functions I tried to test which gave me the error of: "Table expected, got string" was this.
So a bit more information, Row is a string I declared earlier because I got an error of the table to edit being nil, so String Row = "Row". String Available = "O"
When I print out Row..TTE I get Row5, which is one of the tables names. I know it is a string, but how can I make this work?
So I have my tables labeled like this:
Row0 = { contents }
Row1 = { contents }
Row2 = { contents }
Row3 = { contents }
...
Row10 = { contents }
Now one of the functions I tried to test which gave me the error of: "Table expected, got string" was this.
function AAvail()
local RTE = CZ - MinZ -- disabled
local TTE = CY - MinY -- Table # to Edit
local CTE = CX - MinX -- Column # To Edit
table.remove(Row..TTE, CTE)
table.insert(Row..TTE, CTE, Available)
end
So a bit more information, Row is a string I declared earlier because I got an error of the table to edit being nil, so String Row = "Row". String Available = "O"
When I print out Row..TTE I get Row5, which is one of the tables names. I know it is a string, but how can I make this work?