blob: ca6ec9659945bd3cbbd46ebebad5c9320ed04acf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
local function ensure_equipped(item)
local cur = peripheral.getType"left"
print(cur)
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)
return turtle.equipLeft()
end
end
return false, "couldn't find "..item
end
assert(ensure_equipped "computercraft:wireless_modem_normal")
local loc = vector.new(gps.locate)
print(loc)
|