Nike622000

test

Apr 16th, 2017
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.75 KB | None | 0 0
  1. local monSide      = "top"
  2. local analyzerSide = "left"
  3.  
  4. --SeedInfo
  5. Stufen = 10
  6. --
  7.  
  8. m = peripheral.wrap(monSide)
  9. g = peripheral.wrap(analyzerSide)
  10.  
  11. m.setBackgroundColor(colors.black)
  12. m.setTextScale(.5)
  13.  
  14. local xMax,yMax = m.getSize()
  15.  
  16. m.clear()
  17. g.analyze()
  18.  
  19. local name = g.getSpecimen()
  20. local growth,gain,strength = g.getSpecimenStats()
  21.  
  22. function Background(x1,y1,x2,y2,col)
  23.   m.setBackgroundColor(col)
  24.   for yP = y1,y2 do
  25.     for xP = x1,x2 do
  26.       m.setCursorPos(xP,yP)
  27.       m.write(" ")
  28.     end
  29.   end
  30. end
  31.  
  32. function overlay(xP,yP,txt)
  33.   m.setCursorPos(xP,yP)
  34.   m.write(txt)
  35. end
  36.  
  37. function JoJa(xP,yP)
  38.   m.setCursorPos(xP,yP)
  39.   m.setBackgroundColor(colors.gray)
  40.   m.setTextColor(colors.cyan)
  41.   m.write("Jo")
  42.   m.setTextColor(colors.orange)
  43.   m.write("Ja ")
  44.   m.setTextColor(colors.lightGray)
  45.   m.write("Productions")
  46. end
  47.  
  48. function graph(x1,y1,x2,y2,value,col1,col2)
  49.   m.setBackgroundColor(col2)
  50.   for yP = y1,y2 do
  51.     for xP = x1,x2 do
  52.       m.setCursorPos(xP,yP)
  53.       m.write(" ")
  54.     end
  55.   end  
  56.   local Width = math.floor((x2-x1)*(value/Stufen))  
  57.   m.setBackgroundColor(col1)
  58.   for yP = y1,y2 do
  59.     for xP = x1,x1+Width do
  60.       m.setCursorPos(xP,yP)
  61.       m.write(" ")
  62.     end
  63.   end
  64. end
  65.  
  66. function graph2(x1,x2,y1,value1,value2,value3,col)
  67.   local cols = {colors.yellow,colors.lime,colors.green,colors.blue,colors.purple}
  68.   local cursor = "->"
  69.   for i = 1,Stufen/2 do
  70.     for x = x1,x2 do
  71.       m.setBackgroundColor(cols[i])
  72.       m.setCursorPos(x,y1-i)
  73.       m.write(" ")
  74.     end
  75.   end
  76.   local v = math.floor((value1+value2+value3)/3)/2
  77.   m.setCursorPos(x1-2,y1-v)
  78.   m.setBackgroundColor(col)
  79.   m.write(cursor)
  80. end
  81.  
  82. graph (3,2,20,3,5,colors.lime,colors.gray)
  83. graph2(3,4,17,3,4,5,colors.black)
Advertisement
Add Comment
Please, Sign In to add comment