From cad7554b1e466c59cb5b1c90311dd285f9a4aef7 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Wed, 3 Apr 2024 23:31:08 +0100 Subject: launch cactus --- cactus.lua | 9 ++++++--- 1 file 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) -- cgit v1.2.3