local function ensure_equipped(ptype, item) local cur = peripheral.getType"left" print(cur) if cur == ptype 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 local function ensure_modem() ensure_equipped("modem","computercraft:wireless_modem_normal") end local function ensure_scanner() error("aaa") end local x,d = ensure_modem() print(x,d) local loc = vector.new(gps.locate) print(loc)