Posted 16 April 2017 - 02:36 PM
I'm trying to make a cobblestone generator for my turtle (it's advanced if that matters) and write the total items in its inventory to a monitor below quickly. I set the monitor to the variable "m" using peripheral.wrap(). Do I have to do
local a = turtle.getItemCount(1)
local b = turtle.getItemCount(2)
-- and so on and so forth
and then do
local total = a + b + c + d -- and so on
m.write(total .. "items are in the turtle.")
or can I put it in a table, or maybe use:
turtle.getItemCount(0)
I really don't know how I can do this. So can you help me?