Advertisement
stefbrad15

MC Computer Craft app

Mar 15th, 2015
285
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --Computer ID #1
  2.  
  3. isRunning = true
  4.  
  5. monitor = peripheral.wrap("top")
  6. modem = peripheral.wrap("left")
  7. modem.open(237)
  8.  
  9. monitor.setBackgroundColor(colors.lightBlue)
  10. monitor.setTextColor(colors.blue)
  11.  
  12.  
  13. while isRunning do
  14.   local event,modemSide, senderChannel,
  15.     replyChannel, message, senderDistance = os.pullEvent("modem_message") --wait for modem message
  16.  
  17.  monitor.clear()
  18.  monitor.setCursorPos(1,1)
  19.  monitor.write("Stefan's awesome computer")
  20.  
  21.  monitor.setCursorPos(1,2)
  22.  monitor.write("Reactor Info:" )
  23.  
  24.  monitor.setCursorPos(1,3)
  25.  monitor.write("   Energy Stored - " .. message.energy .. " rf")
  26.  
  27.  monitor.setCursorPos(1,4)
  28.  monitor.write("   Energy Use - " .. message.energyUse .. " rf/t")
  29.  
  30.  monitor.setCursorPos(1,5)
  31.  monitor.write("   Production - " .. message.energyProd .. " rf/t")
  32. end
Advertisement
RAW Paste Data Copied
Advertisement