Posted 29 December 2013 - 09:30 PM
That would be nice if the suck function returned how many items it picked up. I read the "read first" post, and know this could be made by hand fairly easily (which in fact I'm using now:) However, I think that this would be a nice addition, as (I would think) it would be simple to code in. (I'm new to modding, but couldn't you just give lua the value of ItemStack.stackSize returned by the ItemStack added to the inventory?)
Spoiler
local function getInvTable()
local toRet = {}
for i=1, 16 do
toRet[i] = turtle.getItemCount(i)
end
return toRet
end
local function compareChangedSlots(input1, input2)
for i=1,16 do
if input1[i] ~= input2[i] then
return math.abs(input1[i]-input2[i])
end
end
return 0
end
local snapshot = getInvTable()
turtle.suck()
print(compareChangedSlots(snapshot, getInvTable))