summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cactus.lua20
1 files 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"
+
+