This commit is contained in:
kepler155c@gmail.com
2017-09-21 01:44:33 -04:00
parent 00fe2c9989
commit bf3875adcb
2 changed files with 18 additions and 13 deletions

View File

@@ -116,18 +116,23 @@ end)
local info = {
id = os.getComputerID()
}
local infoTimer = os.clock()
local function sendInfo()
info.label = os.getComputerLabel()
info.uptime = math.floor(os.clock())
if turtle then
info.fuel = turtle.getFuelLevel()
info.status = turtle.status
info.point = turtle.point
info.inventory = turtle.getInventory()
info.slotIndex = turtle.getSelectedSlot()
if os.clock() - infoTimer >= 1 then -- don't flood
infoTimer = os.clock()
info.label = os.getComputerLabel()
info.uptime = math.floor(os.clock())
if turtle then
info.fuel = turtle.getFuelLevel()
info.status = turtle.status
info.point = turtle.point
info.inventory = turtle.getInventory()
info.slotIndex = turtle.getSelectedSlot()
end
device.wireless_modem.transmit(999, os.getComputerID(), info)
end
device.wireless_modem.transmit(999, os.getComputerID(), info)
end
-- every 10 seconds, send out this computer's info