This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Is2005's profile picture

I play with FTB Direwolf20 for 1.7.10 can I move items between inventories or tanks?

Started by Is2005, 21 June 2017 - 07:40 PM
Is2005 #1
Posted 21 June 2017 - 09:40 PM
I want to write a program that counts ores in a chest then it sends to a SAG mill if there is more than 8 blocks of that ore

can I do that?

I know I can get the chest like this


local ps = periferal.getNames()
local count = 1
local chests = { }
while count <= #ps do
if periferals.getType(ps[count]) == "chest" then
  table.add(chests, periferal.wrap(ps[count]))
end
count = count + 1
end

but how can I see which items are in the chest and them move them to the SAG mill if there are 8 or more of the same type?
I think I need a computer in the SAG mill too?

This is my first time with this mod.
Bomb Bloke #2
Posted 22 June 2017 - 12:03 AM
It'd be far easier to get your chests via:

local chests = {peripheral.find("chest")}

… though you need OpenPeripheral installed to wrap them at all, as vanilla ComputerCraft doesn't recognise them as peripherals.

opdoc can walk you through the commands needed to make wrapped chests actually do things.
KingofGamesYami #3
Posted 22 June 2017 - 12:15 AM
http://www.computercraft.info/forums2/index.php?/topic/26698-using-peripherals-from-other-mods/page__pid__251777#entry251777

…have to mention this, 'cause I wrote it. ;)/>
Is2005 #4
Posted 22 June 2017 - 04:24 AM
I do this simple thing: I have one chest to the left one chest to the top of the computer then this is my programme


local chest = peripherals.wrap("left")
local invsz = chest.getInventorySize()

local idx = 1

while idx <= invsz do
   local stk = chest.getStackInSlot(idx)
   if stk then
      local r = chest.pushItem("UP", idx)--error here Other inventory not found
   end
   idx = idx + 1
end


why Other inventory not found? when I run another programme to list methods of the top chest it finds it
Bomb Bloke #5
Posted 23 June 2017 - 12:09 PM
When you call chest.pushItem, you're instructing the wrapped chest to push an item upwards. It can't push an item into a chest which is instead above the computer.