Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if not term.isColor() then
- print("Advanced computer required")
- error()
- end
- local sides = peripheral.getNames()
- local mininglasers = {}
- for _, side in pairs(sides) do
- if peripheral.getType(side) == "warpdriveMiningLaser" then
- print("Wrapping " .. side)
- table.insert(mininglasers, peripheral.wrap(side))
- end
- end
- local label = os.getComputerLabel()
- if label then
- else
- label = "" .. os.getComputerID()
- end
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setBackgroundColor(colors.lime)
- term.setCursorPos(1, 1)
- print(label)
- if #mininglasers == 0 then
- term.setBackgroundColor(colors.red)
- term.setTextColor(colors.white)
- print("No mining laser detected")
- else
- for key, mininglaser in pairs(mininglasers) do
- term.setCursorPos(1, 2 + key)
- local isEnabled = mininglaser.enable()
- if not isEnabled then
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.gray)
- term.write("Mining laser " .. key .. " of " .. #mininglasers .. " is already stopped")
- else
- mininglaser.enable(false)
- term.setBackgroundColor(colors.lime)
- term.setTextColor(colors.blue)
- term.write("Mining laser " .. key .. " of " .. #mininglasers .. " has been stopped")
- end
- end
- end
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- print()
Add Comment
Please, Sign In to add comment