summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-04-03 23:18:15 +0100
committerubq323 <ubq323@ubq323.website>2024-04-03 23:18:15 +0100
commite45d5679ff683c0314ee20a96b9885d936fd9ba8 (patch)
treed5ee3099854f254a1a526849dd07f5d1a7ee5d1e
parent9866d36a1de6b656ddc86f997334fc9560b7c8e5 (diff)
launch cactus
-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"
+
+