Advertisement
GladdeSnaak

Untitled

Jan 30th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. mod = peripheral.find("modem")
  2. mon = peripheral.find("monitor")
  3.  
  4. function infoRequest(info)
  5.     modem.transmit(5,5, info)
  6.         event, side, chRec, chSend, recInfo, dist = os.pullEvent("modem_message")
  7.     return recInfo
  8. end
  9.  
  10. function getReactorStats()
  11.     rfTotal = infoRequest("rftotal")
  12.     rfTick = infoRequest("rftick")
  13.     fuelConsumed = infoRequest("consumed")
  14.     rodLevel = = infoRequest("rodlevel")
  15. end
  16.  
  17. function sendReactor(com)
  18.     modem.transmit(5,5, com)
  19. end
  20.  
  21. function createwindows()
  22. rfWin = window.create(mon, 2, 2, 5, 3, true)
  23. rfWin.setBackgroundColor(colors.red)
  24. rfWin.clear()
  25. end
  26.  
  27. function writeRftotal()
  28. createwindows()
  29. rfW, rfH = rfWin.getSize()
  30. info = "Total rf: "..rfTotal
  31. rfWin.setCursorPos(rfW/2 - #info ,rfH/2)
  32. mon.write(info)
  33. end
  34.  
  35. getReactorStats()
  36. writeRftotal()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement