Advertisement
Muzze77

InfoTafel 1.0

Oct 27th, 2014
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.58 KB | None | 0 0
  1. term.redirect(peripheral.wrap("top"))  
  2. names = {
  3. [1] = "Muzze77 - Stadtowner",
  4. [2] = "Pyrotecbln - Stadtadmin",
  5. [3] = "Wuschi2000",
  6. [4] = "xxEnderDjxx",
  7. [5] = "Capture_HD",
  8. [6] = "Mikey4D",
  9. [7] = "PkOwnit",
  10. [8] = "DarkRome",
  11. [9] = "CreatorCece",
  12. [10] = "TheMarvin01",
  13. [11] = "BatiCrafter",
  14. [12] = "_CFLEP_",
  15. [13] = "darksider56473",
  16. [14] = "Hans153",
  17. }
  18. b = table.maxn(names)
  19. b = b + 1
  20. mon = peripheral.wrap("top")
  21. orange = colors.orange
  22. black = colors.black
  23. white = colors.white
  24. green = colors.green
  25. blue = colors.blue
  26. brown = colors.brown
  27. red = colors.red
  28. yellow = colors.yellow
  29. bnorm = black
  30. tnorm = green
  31. s = 1
  32. term.setBackgroundColor(bnorm)
  33. shell.run("clear")
  34. function rec()
  35.     term.restore()
  36.     term.setCursorPos(16, 16)
  37.     term.setBackgroundColor(brown)
  38.     nName = read()
  39.     table.insert(names, nName)
  40.     term.setBackgroundColor(bnorm)
  41.     shell.run("clear")
  42.     term.redirect(peripheral.wrap("top"))  
  43.     term.setBackgroundColor(bnorm)
  44.     b = b + 1
  45. end
  46. function del()
  47.  
  48.     term.restore()
  49.     term.setCursorPos(16, 16)
  50.     term.setBackgroundColor(brown)
  51.    
  52.     nName = read()
  53.     for num, rName in pairs(names) do
  54.  
  55.     pos = num
  56.     end
  57.         table.remove(names, pos)
  58.         term.setBackgroundColor(bnorm)
  59.     shell.run("clear")
  60.     term.redirect(peripheral.wrap("top"))  
  61.     term.setBackgroundColor(bnorm)
  62.     b = b - 1
  63. end
  64.  
  65.  
  66. function cbut(cx, cy, text, bcol, tcol)
  67. term.setCursorPos(cx, cy)
  68. term.setBackgroundColor(bcol)
  69. term.setTextColor(tcol)
  70. print(text)
  71. term.setBackgroundColor(bnorm)
  72. term.setTextColor(tnorm)
  73.  
  74. end
  75.  
  76. function stan()
  77. cbut(4,5, "                                   ", yellow, black)
  78. cbut(4,6, "  Willkommen in BURNING KEYS CITY  ", yellow, black)
  79. cbut(4,7, "                                   ", yellow, black)
  80.  
  81. cbut(4,10, "                ", red, black)
  82. cbut(4,11, "  Neueste User  ", red, black)
  83. cbut(4,12, "                ", red, black)
  84.  
  85. cbut(38,2, "        ", green, black)
  86. cbut(38,3, " RULES: ", green, black)
  87. cbut(38,4, "        ", green, black)
  88.  
  89. cbut(48,2, "                     ", blue, black)
  90. cbut(48,3, " Kein Flaming        ", blue, black)
  91. cbut(48,4, "                     ", blue, black)
  92.                              
  93. cbut(48,6, "                     ", blue, black)
  94. cbut(48,7, " Kein Griefing       ", blue, black)
  95. cbut(48,8, "                     ", blue, black)
  96.                              
  97. cbut(48,10,"                     ", blue, black)
  98. cbut(48,11," Keine 1x1 Tuerme    ", blue, black)
  99. cbut(48,12,"                     ", blue, black)
  100.    
  101. cbut(48,14,"                     ", blue, black)
  102. cbut(48,15," Max 2 GS Pro User   ", blue, black)
  103. cbut(48,16,"                     ", blue, black)
  104.  
  105. cbut(4,16,"          ", orange, black)
  106. cbut(4,17," Add User ", orange, black)
  107. cbut(4,18,"          ", orange, black)
  108.  
  109. cbut(18,16,"          ", orange, black)
  110. cbut(18,17," Del User ", orange, black)
  111. cbut(18,18,"          ", orange, black)
  112. end
  113.  
  114.  
  115. while true do
  116. term.setBackgroundColor(bnorm)
  117. shell.run("clear")
  118. stan()
  119.  
  120.  
  121. while s ~= b do
  122. evt, side, x, y = os.pullEvent("monitor_touch")
  123. if evt == "monitor_touch" then
  124. if x == 39 and y == 3 then
  125.     evt, side, x, y = os.pullEvent("monitor_touch")
  126. for mx = 4, 14, 1 do
  127. for my = 16, 18, 1 do
  128.     if x == mx then
  129.     if y == my then
  130.      cbut(16, 18," Namen Eingeben am PC ", brown, black)
  131.      rec()
  132.     end
  133.     end
  134.     end
  135.     end
  136. for mx = 18, 28, 1 do
  137. for my = 16, 18, 1 do
  138.     if x == mx then
  139.     if y == my then
  140.      cbut(16, 18," Namen Eingeben am PC ", brown, black)
  141.      del()
  142.     end
  143.     end
  144.     end
  145.     end
  146. end
  147. shell.run("clear")
  148.  
  149. stan()
  150.  
  151. cbut(4, 14, " " .. names[s] .. " ", blue, black)
  152. stan()
  153. s = s + 1
  154. if s == b then
  155. s = 1
  156. end
  157. end
  158. end
  159.  
  160. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement