From e45d5679ff683c0314ee20a96b9885d936fd9ba8 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Wed, 3 Apr 2024 23:18:15 +0100 Subject: launch cactus --- cactus.lua | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/cactus.lua b/cactus.lua index 4a31446..6da8880 100644 --- a/cactus.lua +++ b/cactus.lua @@ -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" + + -- cgit v1.2.3