diff options
author | ubq323 <ubq323@ubq323.website> | 2024-04-03 23:18:15 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-04-03 23:18:15 +0100 |
commit | e45d5679ff683c0314ee20a96b9885d936fd9ba8 (patch) | |
tree | d5ee3099854f254a1a526849dd07f5d1a7ee5d1e | |
parent | 9866d36a1de6b656ddc86f997334fc9560b7c8e5 (diff) |
launch cactus
-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" + + |