Advertisement
Muzze77

[A105] STADTINFO-HUNDSCRIPPL

Apr 21st, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.27 KB | None | 0 0
  1. shell.run("clear")
  2. sides = {"back","top","bottom","front","left","right"}
  3. CEO = {"Hundskrippl"} -- Mayor
  4. CO = {"RaiiNzzzYT","Nicht_Merken"} -- Co-Mayor
  5. AS = {"Thamix"} -- Assistent
  6. mon.setTextScale(2) -- Größe der Anzeige (0.5 - 5 in 0.5er Schritten (Normal = 1))
  7. for i = 1, #sides,1 do
  8.     if peripheral.getType(sides[i]) == "monitor" then
  9.     mon = peripheral.wrap(sides[i])
  10.     end
  11. end
  12.  
  13.  
  14. function cbut(cx,cy,text,bcol,tcol)
  15. if bcol == nil then
  16. bcol = colors.black
  17. end
  18. if tcol == nil then
  19. tcol = colors.white
  20. end
  21.  
  22. mon.setCursorPos(cx,cy)
  23. mon.setBackgroundColor(bcol)
  24. mon.setTextColor(tcol)
  25. mon.write(text)
  26. mon.setBackgroundColor(colors.black)
  27. mon.setTextColor(colors.white)
  28.  
  29. end
  30.  
  31.  
  32. gx, gy = mon.getSize()
  33.  
  34.  
  35. while true do
  36. mon.setBackgroundColor(colors.black)
  37. mon.clear()
  38. y = 2
  39.  
  40. for i = 1, gx,1 do
  41. cbut(i,1,"+")
  42. end
  43.  
  44. for i = 1, gy ,1 do
  45. cbut(1,i,"+")
  46. cbut(gx,i,"+")
  47. end
  48.  
  49.  
  50. for n = 1, #CEO, 1 do
  51.  
  52.  
  53. cbut(3,n+y,"Mayor:" .. CEO[n],colors.black,colors.red)
  54.  
  55. end
  56.  
  57. y = y + #CEO + 1
  58. for n = 1, #CO, 1 do
  59.  
  60.  
  61. cbut(3,n+y,"Co-Mayor:" .. CO[n],colors.black,colors.blue)
  62.  
  63. end
  64. y = y + #CO + 1
  65. for n = 1, #AS, 1 do
  66.  
  67.  
  68. cbut(3,n+y,"Assistant:" .. AS[n],colors.black,colors.green)
  69.  
  70. y = y + 1
  71. end
  72.  
  73. for i = 1, gx,1 do
  74. cbut(i,gy,"+")
  75. end
  76. sleep(10)
  77. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement