Advertisement
Guest User

startup

a guest
Aug 3rd, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.38 KB | None | 0 0
  1. local p = peripheral.wrap("bottom")
  2. local mon = peripheral.wrap("monitor_1")
  3. --local pow = peripheral.wrap("tile_blockcapacitorbank_name_1")
  4. --local stored = peripheral.wrap
  5. local color = mon.setTextColor
  6. function red()
  7.  color(colors.red)
  8.  end
  9. function blue()
  10.  color(colors.blue)
  11.  end
  12. function newLineL()
  13.     local cX,cY = mon.getCursorPos()
  14.       mon.setCursorPos(1,cY+1)
  15. end
  16. function newLineR()
  17.     local xX,yY = mon.getCursorPos()
  18.       mon.setCursorPos(xX,yY+1)
  19. end
  20. --for i = 1, 10000, 2 do
  21. --mon.setBackgroundColor(i)
  22. --end
  23. while true do
  24. --mon.setBackgroundColor( math.random(5, 2050, 50))
  25. mon.setBackgroundColor( colors.black )
  26.   mon.clear()
  27.  for k,v in pairs(p.listAll()) do
  28.    name = v[1]
  29.    amount = v[3]
  30.    gname = v[4]
  31.   if v[3] == nil then
  32.   mon.getCursorPos(cX,cY)
  33.   mon.setCursorPos(cX,cY-1)
  34.   elseif amount <= 9 then
  35.   amount = (v[3].."   ")
  36.   elseif amount <= 99 then
  37.   amount = (v[3].."  ")
  38.   elseif amount <=999 then
  39.   amount = (v[3].." ")
  40.   end
  41. local tcolor = mon.setTextColor
  42.  
  43.  
  44. --mon.getCursorPos()
  45. --mon.setCursorPos(1,1)
  46. --mon.setTextColor( colors.red )
  47. --print("[")
  48. --mon.setCursorPos(2,1)
  49. --mon.setTextColor( colors.blue )
  50. --mon.setCursorPos(4,1)
  51. --mon.write(amount)
  52. --mon.setCursorPos(5,1)
  53. --mon.write("] ")
  54. --
  55.  
  56.  
  57.  
  58.  
  59.  
  60. mon.setTextScale(.8)
  61. mon.setCursorPos(1,1)
  62.               -- LEFT SIDE WOOT WOOT
  63.         if name == "minecraft:iron_ingot" then
  64.         red()
  65.          mon.write(amount.." ")
  66.         blue()
  67.         mon.write(gname)
  68.         end
  69. newLineL()
  70.        if name == "minecraft:diamond" then
  71.          red()
  72.          mon.write(amount.." ")
  73.          blue()
  74.          mon.write(gname)
  75.        end
  76. newLineL()
  77.        if name == "minecraft:diamond_block" then
  78.         red()
  79.          mon.write(amount.." ")
  80.          blue()
  81.          mon.write(gname)
  82.        end
  83. newLineL()
  84.        if name == "minecraft:ender_pearl" then
  85.         red()
  86.          mon.write(amount.." ")
  87.         blue()
  88.          mon.write(gname)
  89.        end
  90. newLineL()
  91.        if name == "minecraft:coal" then
  92.        red()
  93.          mon.write(amount.." ")
  94.        blue()
  95.          mon.write(gname)
  96.        end      
  97.      
  98.      --RIGHT SIDE WOO WOO
  99. mon.setCursorPos(20,1)
  100.        if name == "minecraft:emerald" then
  101.        red()
  102.          mon.write(amount.." ")
  103.        blue()
  104.          mon.write(gname)
  105.        end
  106. newLineR()      
  107.  
  108.  
  109.  
  110.  end
  111. sleep(1)
  112.  
  113. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement