Advertisement
Guest User

startup

a guest
Feb 8th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.39 KB | None | 0 0
  1. monitor = peripheral.wrap("back")
  2. sleep(1)
  3. function write(msg)
  4.  monitor.write(msg)
  5. end
  6.  
  7. function pos(x,y)
  8.  monitor.setCursorPos(x,y)
  9. end
  10.  
  11. function scale(scale)
  12.  monitor.setTextScale(scale)
  13. end
  14.  
  15. function color(bg,tc)
  16.  monitor.setBackgroundColor(bg)
  17.  monitor.setTextColor(tc)
  18. end
  19.  
  20. function padString (sText,iLen)
  21.  local iTextLen = string.len(sText)
  22.  if iTextLen < iLen then
  23.   local iDiff = iLen - iTextLen
  24.   return(sText..string.rep(" ",iDiff))
  25.  end
  26.  if iTextLen > iLen then
  27.   return(string.sub(sText,1,iLen))
  28.  end
  29.  return(sText)
  30. end
  31.  
  32. function wipe()
  33.  monitor.clear()
  34. end
  35.  
  36. function reset()
  37.  pos(1,1)
  38.  color(colors.black,colors.white)
  39.  scale(1)
  40.  wipe()
  41. end
  42.  
  43. function button(x,y)
  44.  pos(x+1,y)
  45.  color(colors.gray,colors.gray)
  46.  write("00000")
  47. end
  48.  
  49. function buttons(x,y)
  50.  pos(x+1,y)
  51.  color(colors.cyan,colors.cyan)
  52.  write("00000")
  53. end
  54.  
  55. function buttonn(x,y,text)
  56.  pos(x,y)
  57.  color(colors.gray,colors.gray)
  58.  write("00000000")
  59.  pos(x+1,y)
  60.  color(colors.gray,colors.cyan)
  61.  write(text)
  62. end
  63.  
  64. function check()
  65.  active = reactor.getActive()
  66.  ctemp = reactor.getCasingTemperature()
  67.  ftemp = reactor.getFuelTemperature()
  68.  fuela = reactor.getFuelAmount()
  69.  stored = reactor.getEnergyStored()
  70.  fuelm = reactor.getFuelAmountMax()
  71.  rft = reactor.getEnergyProducedLastTick()
  72.  acti = reactor.getFuelReactivity()
  73.  cons = reactor.getFuelConsumedLastTick()
  74. end
  75.  
  76. shell.run(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement