Advertisement
Muzze77

Stadtplan BKC

Oct 30th, 2014
1,507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.27 KB | None | 0 0
  1. shell.run("clear")
  2.  
  3. mon = peripheral.wrap("back")
  4. mon.setBackgroundColor(colors.white)
  5. mon.setTextColor(colors.blue)
  6. mon.setTextScale(1)
  7. mon.clear()
  8. gx,gy = mon.getSize()
  9. -- switches --
  10. t = {}
  11. t[1] = "GS zum Verkauf von 400$"
  12. t[2] = "Spawn"
  13. t[3] = "TekkitLiteShowcenter"
  14. t[4] = "ComputercraftShowcenter"
  15. t[5] = "Manarola Owner: Muzze77"
  16. t[6] = "GS von CyberD1"
  17. t[7] = "Bauteam bitte Plannieren"
  18. t[8] = "GS von Tobycraft2HD"
  19. t[9] = "GS von _HDCrafter_"
  20. t[10] = "GS von minecraftinf"
  21. -- /switches --
  22.  
  23.  
  24. black = colors.black
  25. red = colors.red
  26. green = colors.green
  27. white = colors.white
  28. blue = colors.blue
  29. bnorm = colors.white
  30. tnorm = colors.blue
  31. brown = colors.brown
  32. cyan = colors.cyan
  33. orange = colors.orange
  34. yellow = colors.yellow
  35. pink = colors.pink
  36. purple = colors.purple
  37.  
  38. function cbut(cx, cy, text, bcol, tcol)
  39. mon.setCursorPos(cx, cy)
  40. if bcol == nil then
  41. bcol = bnorm
  42. end
  43. if tcol == nil then
  44. tcol = tnorm
  45. end
  46.  
  47. mon.setBackgroundColor(bcol)
  48. mon.setTextColor(tcol)
  49. mon.write(text)
  50. mon.setBackgroundColor(bnorm)
  51. mon.setTextColor(tnorm)
  52. end
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59. function rune()
  60.  
  61. --spawnbereich--
  62. cbut(gx/2-6,1," STADTPLAN MANAROLA ",colors.white,colors.blue)
  63. cbut(8,gy,"graue Pixel sind Strassen, angaben in Chunks!")
  64. cbut(gx-2,1,"[R]",colors.white,colors.green)
  65. cbut(2,3," ",colors.blue,colors.blue)
  66. cbut(3,3," ", colors.gray, colors.white)
  67. cbut(2,4," ",colors.blue,colors.blue)
  68. cbut(3,4," ", colors.gray, colors.white)
  69. cbut(2,5,"O",colors.green,colors.black)
  70. cbut(3,5," ", colors.gray, colors.white)
  71. cbut(2,6," ", colors.orange,colors.blue)
  72. cbut(3,6," ", colors.gray, colors.white)
  73. cbut(2,7," ", colors.orange,colors.blue)
  74. cbut(3,7," ", colors.gray, colors.white)
  75. cbut(3,8," ", colors.gray, colors.white)
  76. cbut(2,8," ", colors.gray, colors.white)
  77. cbut(4,6," ", colors.red,colors.white)
  78. cbut(4,7," ", colors.red,colors.white)
  79. cbut(5,6," ", colors.red,colors.white)
  80. cbut(5,7," ", colors.red,colors.white)
  81. cbut(1,8," ",colors.gray,colors.white)
  82. cbut(2,9," ",colors.blue)
  83. cbut(1,9," ",colors.blue)
  84. cbut(4,9," ",colors.blue)
  85. cbut(5,9," ",colors.blue)
  86.  
  87. cbut(4,5," ",colors.cyan)
  88. cbut(4,4," ",colors.cyan)
  89. cbut(5,5," ",colors.cyan)
  90. cbut(5,4," ",colors.cyan)
  91.  
  92. cbut(3,3," ",colors.cyan)
  93. cbut(4,3," ",colors.cyan)
  94. cbut(5,3," ",colors.cyan)
  95.  
  96. cbut(3,9," ",colors.gray)
  97. cbut(4,8," ",colors.gray)
  98. cbut(5,8," ",colors.gray)
  99. --/spawnbereich--
  100.  
  101.  
  102. cbut(gx/2-6,gy-1," Ort anklicken für INFO", colors.white,colors.blue)
  103. sleep(0.15)
  104. end
  105.  
  106. function showCount(id)
  107. cbut(gx/2-6,gy-3, "                                                                           ",colors.white,colors.blue)
  108. sleep(0.01)
  109. cbut(gx/2-6,gy-3,t[id],colors.white,colors.black)
  110. end
  111.  
  112. rune()
  113.  
  114. pos = {}
  115. pos["X"] = 1
  116. pos["Y"] = 1
  117.  
  118. function update()
  119. rune()
  120. evt,side,dx,dy = os.pullEvent("monitor_touch")
  121. if dx == gx-1 and dy == 1 then
  122.     shell.run("reboot")
  123. end
  124.  
  125. if dy > 1 and dy ~= gy-1 and dy ~= gy-3 then
  126. rune()
  127. cbut(1,gy-3,"                                                                           ",colors.white,colors.blue)
  128. print(dx,dy)
  129. mon.setCursorPos(dx,dy)
  130. mon.setBackgroundColor(colors.white)
  131. mon.setTextColor(colors.black)
  132. mon.write("X")
  133. mon.setCursorPos(pos["X"],pos["Y"])
  134.  
  135. mon.write(" ")
  136.  
  137. pos["X"] = dx
  138. pos["Y"] = dy
  139.  
  140. if dx == 5 and dy == 6 then
  141.     showCount(5)
  142. elseif dx == 4 and dy == 6 then
  143.     showCount(5)
  144. elseif dx == 5 and dy == 7 then
  145.     showCount(5)
  146. elseif dx == 4 and dy == 7 then
  147.     showCount(5)
  148. elseif dx == 2 and dy == 3 then
  149.     showCount(6)
  150. elseif dx == 2 and dy == 4 then
  151.     showCount(6)
  152. elseif dx == 2 and dy == 5 then
  153.     showCount(2)
  154. elseif dx == 2 and dy == 6 then
  155.     showCount(3)
  156. elseif dx == 2 and dy == 7 then
  157.     showCount(4)
  158. elseif dx == 1 and dy == 9 then
  159.     showCount(10)
  160. elseif dx == 2 and dy == 9 then
  161.     showCount(9)
  162. elseif dx == 4 and dy == 9 then
  163.     showCount(8)
  164. elseif dx == 5 and dy == 9 then
  165.     showCount(8)
  166.  
  167. elseif dx == 4 and dy == 4 then
  168.     showCount(7)
  169. elseif dx == 4 and dy == 5 then
  170.     showCount(7)
  171. elseif dx == 5 and dy == 5 then
  172.     showCount(7)
  173. elseif dx == 5 and dy == 4 then
  174.     showCount(7)
  175. elseif dx == 4 and dy == 3 then
  176.     showCount(7)
  177. elseif dx == 3 and dy == 3 then
  178.     showCount(7)
  179. elseif dx == 5 and dy == 3 then
  180.     showCount(7)
  181.  
  182. end
  183.  
  184. end
  185. end
  186.  
  187.  
  188. while true do
  189. update()
  190.    
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197. end
  198.  
  199.  
  200.  
  201.  
  202. --------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement