summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-04-03 23:31:08 +0100
committerubq323 <ubq323@ubq323.website>2024-04-03 23:31:08 +0100
commitcad7554b1e466c59cb5b1c90311dd285f9a4aef7 (patch)
treee792d4014a4a93cc315626b16d23829be1e79036
parent71421a2f3ee77dfee38f2f9cf79da75b644dbd40 (diff)
launch cactus
-rw-r--r--cactus.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/cactus.lua b/cactus.lua
index ca6ec96..77fa6ef 100644
--- a/cactus.lua
+++ b/cactus.lua
@@ -1,7 +1,7 @@
-local function ensure_equipped(item)
+local function ensure_equipped(ptype, item)
local cur = peripheral.getType"left"
print(cur)
- if cur == item then return true end
+ if cur == ptype then return true end
for i = 1,16 do
local det = turtle.getItemDetail(i)
if det and det.name == item then
@@ -12,7 +12,10 @@ local function ensure_equipped(item)
return false, "couldn't find "..item
end
-assert(ensure_equipped "computercraft:wireless_modem_normal")
+local function ensure_modem() ensure_equipped("modem","computercraft:wireless_modem_normal") end
+local function ensure_scanner() error("aaa") end
+
+assert(ensure_modem())
local loc = vector.new(gps.locate)
print(loc)