Advertisement
Muzze77

MapMANR

Mar 25th, 2017
614
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.14 KB | None | 0 0
  1. shell.run("clear")
  2.  
  3. mon = peripheral.wrap("back")
  4. mon.setTextScale(0.5)
  5. white = colors.white
  6. blue = colors.blue
  7. sbcol = white
  8. stcol = blue
  9. welcomeText = "Stadtkarte BLUECITY"
  10. gx, gy = mon.getSize()
  11.  
  12. function cbut(cx,cy,text,bcol,tcol)
  13. if bcol == nil then
  14. bcol = sbcol
  15. end
  16. if tcol == nil then
  17. tcol = stcol
  18. end
  19.  
  20. mon.setCursorPos(cx,cy)
  21. mon.setBackgroundColor(bcol)
  22. mon.setTextColor(tcol)
  23. mon.write(text)
  24. mon.setBackgroundColor(sbcol)
  25. mon.setTextColor(stcol)
  26.  
  27. end
  28.  
  29.  
  30. mon.setBackgroundColor(white)
  31. mon.setTextColor(blue)
  32.  
  33. while true do
  34. shell.run("clear")
  35. print("X zum Ändern")
  36. mon.clear()
  37. num  = string.len(welcomeText) / 2
  38. cbut((gx/2) - num ,1,welcomeText)
  39. cbut(gx/2,gy/2,"S",colors.red,colors.black)
  40. cbut(gx/2,gy/2 + 1,"S",colors.red,colors.black)
  41. cbut(gx/2,gy/2 + 2,"S",colors.red,colors.black)
  42. cbut(gx/2,gy/2 - 1,"S",colors.red,colors.black)
  43.  
  44. cbut(gx/2-1,gy/2,"S",colors.red,colors.black)
  45. cbut(gx/2-1,gy/2 + 1,"S",colors.red,colors.black)
  46. cbut(gx/2-1,gy/2 + 2,"S",colors.red,colors.black)
  47. cbut(gx/2-1,gy/2 - 1,"S",colors.red,colors.black)
  48.  
  49. cbut(gx/2,gy/2 +3,"3",colors.orange,colors.black)
  50. cbut(gx/2,gy/2 +4,"3",colors.orange,colors.black)
  51. cbut(gx/2,gy/2 +5,"3",colors.orange,colors.black)
  52.  
  53.  
  54. cbut(gx/2+1,gy/2,"+",colors.lightGray,colors.black)
  55. cbut(gx/2+1,gy/2+1,"+",colors.lightGray,colors.black)
  56. cbut(gx/2+1,gy/2+2,"+",colors.lightGray,colors.black)
  57. cbut(gx/2+1,gy/2-1,"+",colors.lightGray,colors.black)
  58.  
  59. cbut(gx/2+4,gy/2,"+",colors.lightGray,colors.black)
  60. cbut(gx/2+4,gy/2+1,"+",colors.lightGray,colors.black)
  61. cbut(gx/2+4,gy/2+2,"+",colors.lightGray,colors.black)
  62. cbut(gx/2+4,gy/2-1,"+",colors.lightGray,colors.black)
  63.  
  64. cbut(gx/2+2,gy/2-1,"+",colors.lightGray,colors.black)
  65. cbut(gx/2+3,gy/2-1,"+",colors.lightGray,colors.black)
  66. cbut(gx/2+3,gy/2+2,"+",colors.lightGray,colors.black)
  67. cbut(gx/2+2,gy/2+2,"+",colors.lightGray,colors.black)
  68.  
  69. cbut(gx/2+2,gy/2,"M",   colors.blue,colors.black)
  70. cbut(gx/2+3,gy/2,"M",   colors.blue,colors.black)
  71. cbut(gx/2+3,gy/2+1,"M",colors.blue,colors.black)
  72. cbut(gx/2+2,gy/2+1,"M",colors.blue,colors.black)
  73.  
  74. cbut(gx/2+5,gy/2,"5",colors.orange,colors.black)
  75. cbut(gx/2+5,gy/2+1,"5",colors.orange,colors.black)
  76. cbut(gx/2+6,gy/2,"5",colors.orange,colors.black)
  77. cbut(gx/2+6,gy/2+1,"5",colors.orange,colors.black)
  78.  
  79.  
  80. cbut(gx/2+2,gy/2+3,"B",colors.green,colors.black)
  81. cbut(gx/2+3,gy/2+3,"A",colors.green,colors.black)
  82.  
  83. cbut(gx/2+4,gy/2+3,"B",colors.cyan,colors.black)
  84. cbut(gx/2+6,gy/2+3,"7",colors.orange,colors.black)
  85.  
  86. cbut(gx/2+2,gy/2+4,"+",colors.lightGray,colors.black)
  87. cbut(gx/2+5,gy/2+3,"+",colors.lightGray,colors.black)
  88. cbut(gx/2+5,gy/2+2,"+",colors.lightGray,colors.black)
  89. cbut(gx/2+5,gy/2+4,"+",colors.lightGray,colors.black)
  90. cbut(gx/2+5,gy/2+5,"+",colors.lightGray,colors.black)
  91.  
  92.  
  93. cbut(gx/2+3,gy/2+4,"+",colors.lightGray,colors.black)
  94. cbut(gx/2+3,gy/2+4,"+",colors.lightGray,colors.black)
  95.  
  96. cbut(gx/2+1,gy/2+3,"+",colors.lightGray,colors.black)
  97. cbut(gx/2+1,gy/2+4,"+",colors.lightGray,colors.black)
  98. cbut(gx/2+4,gy/2+4,"+",colors.lightGray,colors.black)
  99.  
  100.  
  101.  
  102. cbut(gx/2+1,gy/2+5,"+",colors.lightGray,colors.black)
  103. cbut(gx/2+2,gy/2+5,"2",colors.orange,colors.black)
  104. cbut(gx/2+3,gy/2+5,"2",colors.orange,colors.black)
  105. cbut(gx/2+4,gy/2+5,"+",colors.lightGray,colors.black)
  106. cbut(gx/2+5,gy/2+5," ",colors.blue,colors.black)
  107.  
  108.  
  109. cbut(gx/2+3,gy/2-2,"1",colors.orange,colors.black)
  110. cbut(gx/2+2,gy/2-2,"1",colors.orange,colors.black)
  111. cbut(gx/2+3,gy/2-3,"1",colors.orange,colors.black)
  112. cbut(gx/2+2,gy/2-3,"1",colors.orange,colors.black)
  113.  
  114. cbut(gx/2+5,gy/2-2,"4",colors.orange,colors.black)
  115. cbut(gx/2+5,gy/2-3,"4",colors.orange,colors.black)
  116. cbut(gx/2+6,gy/2-2,"4",colors.orange,colors.black)
  117. cbut(gx/2+6,gy/2-3,"4",colors.orange,colors.black)
  118.  
  119. cbut(gx/2+5,gy/2-1,"+",colors.lightGray,colors.black)
  120. cbut(gx/2+6,gy/2-1,"+",colors.lightGray,colors.black)
  121. cbut(gx/2+5,gy/2-4,"+",colors.lightGray,colors.black)
  122. cbut(gx/2+6,gy/2-4,"+",colors.lightGray,colors.black)
  123.  
  124. cbut(gx/2+7,gy/2-1,"+",colors.lightGray,colors.black)
  125. cbut(gx/2+7,gy/2-2,"+",colors.lightGray,colors.black)
  126. cbut(gx/2+7,gy/2-3,"+",colors.lightGray,colors.black)
  127. cbut(gx/2+7,gy/2-4,"+",colors.lightGray,colors.black)
  128.  
  129. cbut(gx/2-1,gy/2-2,"6",colors.orange,colors.black)
  130. cbut(gx/2,gy/2-2,"6",colors.orange,colors.black)
  131. cbut(gx/2-1,gy/2-3,"6",colors.orange,colors.black)
  132. cbut(gx/2,gy/2-3,"6",colors.orange,colors.black)
  133.  
  134. cbut(gx/2-1,gy/2-4,"+",colors.lightGray,colors.black)
  135. cbut(gx/2,gy/2-4,"+",colors.lightGray,colors.black)
  136.  
  137. cbut(gx/2+1,gy/2-2,"+",colors.lightGray,colors.black)
  138. cbut(gx/2+1,gy/2-3,"+",colors.lightGray,colors.black)
  139. cbut(gx/2+1,gy/2-4,"+",colors.lightGray,colors.black)
  140.  
  141.  
  142. cbut(gx/2+4,gy/2-2,"+",colors.lightGray,colors.black)
  143. cbut(gx/2+4,gy/2-3,"+",colors.lightGray,colors.black)
  144. cbut(gx/2+4,gy/2-4,"+",colors.lightGray,colors.black)
  145.  
  146.  
  147. cbut(gx/2+2,gy/2-4,"+",colors.lightGray,colors.black)
  148. cbut(gx/2+3,gy/2-4,"+",colors.lightGray,colors.black)
  149.  
  150. cbut(2,2," ",colors.red,colors.black)
  151. cbut(4,2,"Spawn",colors.white,colors.blue)
  152.  
  153. cbut(2,3,"+",colors.lightGray,colors.black)
  154. cbut(4,3,"Wege",colors.white,colors.blue)
  155.  
  156. cbut(2,5,"1",colors.orange,colors.black)
  157. cbut(2,6,"2",colors.orange,colors.black)
  158. cbut(2,7,"3",colors.orange,colors.black)
  159. cbut(2,8,"4",colors.orange,colors.black)
  160. cbut(2,9,"5",colors.orange,colors.black)
  161. cbut(2,10,"6",colors.orange,colors.black)
  162. cbut(2,11,"6",colors.orange,colors.black)
  163.  
  164. cbut(4,4,"Grundstücke",colors.white,colors.blue)
  165. cbut(4,5,"1: Axeeaa (2x2)",colors.white,colors.blue)
  166. cbut(4,6,"2: Frei (2x1)",colors.white,colors.blue)
  167. cbut(4,7,"3: Frei (4x1)",colors.white,colors.blue)
  168. cbut(4,8,"4: Rohholz (2x2)",colors.white,colors.blue)
  169. cbut(4,9,"5: NightBlue2g (2x2)",colors.white,colors.blue)
  170. cbut(4,10,"6: Frei (2x2)",colors.white,colors.blue)
  171. cbut(4,11,"7: MG_Noah (1x1)",colors.white,colors.blue)
  172.  
  173. cbut(2,15," ",colors.green,colors.black)
  174. cbut(4,15,"Eiserne Bank",colors.white,colors.blue)
  175. cbut(2,16,"M",colors.blue,colors.black)
  176. cbut(4,16,"Muzze77 Fabrik",colors.white,colors.blue)
  177. cbut(2,17,"B",colors.cyan,colors.black)
  178. cbut(4,17,"Baumfarm",colors.white,colors.blue)
  179.  
  180.  
  181. evt, key = os.pullEvent("char")
  182. if key == "x" then
  183.     shell.run("edit 1")
  184. else
  185.     print("Nicht Korrekt")
  186. end
  187.  
  188. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement