fix(turtle-utils): getItemName and compactInventory
This commit is contained in:
parent
f76877b0ab
commit
70854f7a75
@ -14,7 +14,7 @@ turtleUtils.getInventory = function(side)
|
||||
end
|
||||
|
||||
turtleUtils.getItemName = function(slotIndex)
|
||||
local item = turtle.getItemDetail(i)
|
||||
local item = turtle.getItemDetail(slotIndex)
|
||||
return item and item.name
|
||||
end
|
||||
|
||||
@ -254,7 +254,7 @@ end
|
||||
|
||||
-- Compact the internal turtle inventory (return the number of freed slots)
|
||||
turtleUtils.compactInventory = function()
|
||||
local initialNbFreeSlots = turtle.countFreeSlots()
|
||||
local initialNbFreeSlots = turtleUtils.countFreeSlots()
|
||||
local initialSelectedSlot = turtle.getSelectedSlot()
|
||||
local itemsMap = getItemsMap()
|
||||
|
||||
@ -268,7 +268,7 @@ turtleUtils.compactInventory = function()
|
||||
turtle.select(initialSelectedSlot)
|
||||
end
|
||||
|
||||
return turtle.countFreeSlots() - initialNbFreeSlots
|
||||
return turtleUtils.countFreeSlots() - initialNbFreeSlots
|
||||
end
|
||||
|
||||
return turtleUtils
|
||||
Loading…
Reference in New Issue
Block a user