2021-01-09 03:55:07 +01:00

16 lines
370 B
Plaintext

--lua module "utils" for random utilities
if utils then return end --avoid loading twice
utils = {}
function utils.getSideOf(name) --get which side, if any, a peripheral p is connected to
local sides = peripheral.getNames()
for i = 1, #sides do
if peripheral.getType(sides[i]) == name then
--found it!
return sides[i]
end
end
end
return utils