summaryrefslogtreecommitdiff
path: root/cactus.lua
diff options
context:
space:
mode:
Diffstat (limited to 'cactus.lua')
-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)