summaryrefslogtreecommitdiff
path: root/cactus.lua
blob: 5d14f4887ae405fd9d0228f4e0a9f64510dcac79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
local function ensure_equipped(item)
	local cur = peripheral.getType"left"
	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)