opus/sys/init/4.label.lua

24 lines
474 B
Lua
Raw Permalink Normal View History

2019-07-19 16:06:34 +00:00
local os = _G.os
local peripheral = _G.peripheral
2018-01-20 12:18:13 +00:00
2018-01-14 21:44:43 +00:00
-- Default label
if not os.getComputerLabel() then
2018-01-24 22:39:38 +00:00
local id = os.getComputerID()
2019-07-19 16:06:34 +00:00
2018-01-24 22:39:38 +00:00
if _G.turtle then
os.setComputerLabel('turtle_' .. id)
2019-07-19 16:06:34 +00:00
2018-01-24 22:39:38 +00:00
elseif _G.pocket then
os.setComputerLabel('pocket_' .. id)
2019-07-19 16:06:34 +00:00
2018-01-24 22:39:38 +00:00
elseif _G.commands then
os.setComputerLabel('command_' .. id)
2019-07-19 16:06:34 +00:00
elseif peripheral.find('neuralInterface') then
os.setComputerLabel('neural_' .. id)
2018-01-24 22:39:38 +00:00
else
os.setComputerLabel('computer_' .. id)
end
2018-01-14 21:44:43 +00:00
end