diff options
-rw-r--r-- | cactus.lua | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -1,3 +1,17 @@ -local location = vector.new(gps.locate()) -print(location) -print(gps.locate()) +local function ensure_equipped(item) + local cur = peripheral.getType"left" + if cur == item then return true end + for i = 1,16 do + local det = turtle.getItemDetail(i) + if det and det.name == item then + turtle.select(i) + turtle.equipLeft() + return true + end + end + return false, "couldn't find "..item +end + +ensure_equipped "plethora:module_scanner" + + |