diff options
Diffstat (limited to 'cactus.lua')
-rw-r--r-- | cactus.lua | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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) |