Advertisement
CdoubleOK

Ref Mon wall

Apr 30th, 2023 (edited)
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.73 KB | None | 0 0
  1. local monitor = peripheral.find("monitor")
  2. local modem = peripheral.find("modem")
  3.  
  4. term.clear()
  5. monitor.clear()
  6. monitor.setCursorPos(2,1)
  7. print("Monitor Running...")
  8.  
  9. local function printStatus(title, channel, line)
  10.     monitor.setCursorPos(2,line)
  11.     monitor.write(title)
  12.     monitor.setCursorPos(2,line + 1)
  13.     monitor.write("Status:")
  14.     modem.open(channel)
  15.     local event, modemSide, senderChannel, replyChannel, message, senderDistance = os.pullEvent("modem_message")
  16.     monitor.clearLine()
  17.     monitor.setCursorPos(2,line + 1)
  18.     monitor.write("Status: "..message)
  19.     modem.close(channel)
  20. end
  21.  
  22. while not rs.getInput("back") do
  23.     printStatus("-Oil Rig-", 23, 1)
  24.     printStatus("-Crude Input-", 22,4)
  25. end
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement