Fussel01

bahnhof

Mar 14th, 2013
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.96 KB | None | 0 0
  1. mon = peripheral.wrap ("top")
  2.  
  3. function Screen()
  4. mon.clear()
  5. mon.setBackgroundColor(colors.red)
  6. mon.setCursorPos(8,1)
  7. mon.write("Fusselcraft Bahnhof Ziel - Auswahl")
  8. mon.setBackgroundColor(colors.black)
  9. mon.setCursorPos(14,3)
  10. mon.write("  ===>   Dörfli")
  11. mon.setCursorPos(13,3)
  12. mon.setTextColor(colors.lightBlue)
  13. mon.write("1")
  14. mon.setTextColor(colors.white)
  15. mon.setCursorPos(14,5)
  16. mon.write("  ===>   Pilzingen")
  17. mon.setCursorPos(13,5)
  18. mon.setTextColor(colors.lightBlue)
  19. mon.write("2")
  20. mon.setTextColor(colors.white)
  21. mon.setCursorPos(14,7)
  22. mon.write("  ===>   XP Maschine")
  23. mon.setCursorPos(13,7)
  24. mon.setTextColor(colors.lightBlue)
  25. mon.write("3")
  26. mon.setTextColor(colors.white)
  27. mon.setCursorPos(14,9)
  28. mon.write("  ===>   Versuchsgelände")
  29. mon.setCursorPos(13,9)
  30. mon.setTextColor(colors.lightBlue)
  31. mon.write("4")
  32. mon.setTextColor(colors.white)
  33. mon.setCursorPos(14,11)
  34. mon.write("  ===>   Linie 4")
  35. mon.setCursorPos(13,11)
  36. mon.setTextColor(colors.lightBlue)
  37. mon.write("5")
  38. mon.setTextColor(colors.white)
  39. mon.setCursorPos(14,13)
  40. mon.write("  ===>   Red Mountains")
  41. mon.setCursorPos(13,13)
  42. mon.setTextColor(colors.lightBlue)
  43. mon.write("6")
  44. mon.setTextColor(colors.white)
  45. mon.setCursorPos(14,15)
  46. mon.write("  ===>   Viehzucht")
  47. mon.setCursorPos(13,15)
  48. mon.setTextColor(colors.lightBlue)
  49. mon.write("7")
  50. mon.setTextColor(colors.white)
  51. mon.setCursorPos(14,17)
  52. mon.write("  ===>   Rundfahrt Erntemaschine")
  53. mon.setCursorPos(13,17)
  54. mon.setTextColor(colors.lightBlue)
  55. mon.write("8")
  56. mon.setTextColor(colors.white)
  57. mon.setCursorPos(1,19)
  58. mon.setBackgroundColor(colors.red)
  59. mon.write("Bitte die Nummer des gewünschten Ziels anklicken !")
  60. mon.setBackgroundColor(colors.black)
  61. end
  62.  
  63.  
  64. function Auslesen()
  65.  
  66. event,side,x,y = os.pullEvent()
  67.   if event == "monitor_touch" then
  68.  
  69.       if x == 13 and y == 3 then
  70.        Screen()
  71.        mon.setBackgroundColor(colors.lime)
  72.        mon.setCursorPos(13,3)
  73.        mon.write("1  ===>   Dörfli")
  74.        mon.setBackgroundColor(colors.black)
  75.        rs.setBundledOutput("back", colors.white)
  76.       end
  77.      
  78.       if x == 13 and y == 5 then
  79.        Screen()
  80.        mon.setBackgroundColor(colors.lime)
  81.        mon.setCursorPos(13,5)
  82.        mon.write("2  ===>   Pilzingen")
  83.        mon.setBackgroundColor(colors.black)
  84.        rs.setBundledOutput("back", colors.orange)
  85.       end
  86.      
  87.       if x == 13 and y == 7 then
  88.        Screen()
  89.        mon.setBackgroundColor(colors.lime)
  90.        mon.setCursorPos(13,7)
  91.        mon.write("3  ===>   XP Maschine")
  92.        mon.setBackgroundColor(colors.black)
  93.        rs.setBundledOutput("back", colors.magenta)
  94.       end
  95.      
  96.       if x == 13 and y == 9 then
  97.        Screen()
  98.        mon.setBackgroundColor(colors.lime)
  99.        mon.setCursorPos(13,9)
  100.        mon.write("4  ===>   Versuchsgelände")
  101.        mon.setBackgroundColor(colors.black)
  102.        rs.setBundledOutput("back", colors.lightBlue)
  103.       end
  104.      
  105.       if x == 13 and y == 11 then
  106.        Screen()
  107.        mon.setBackgroundColor(colors.lime)
  108.        mon.setCursorPos(13,11)
  109.        mon.write("5  ===>   Linie 4")
  110.        mon.setBackgroundColor(colors.black)
  111.        rs.setBundledOutput("back", colors.yellow)
  112.       end
  113.      
  114.       if x == 13 and y == 13 then
  115.        Screen()
  116.        mon.setBackgroundColor(colors.lime)
  117.        mon.setCursorPos(13,13)
  118.        mon.write("6  ===>   Red Mountains")
  119.        mon.setBackgroundColor(colors.black)
  120.        rs.setBundledOutput("back", colors.lime)
  121.       end
  122.      
  123.       if x == 13 and y == 15 then
  124.        Screen()
  125.        mon.setBackgroundColor(colors.lime)
  126.        mon.setCursorPos(13,15)
  127.        mon.write("7  ===>   Viehzucht")
  128.        mon.setBackgroundColor(colors.black)
  129.        rs.setBundledOutput("back", colors.pink)
  130.       end
  131.      
  132.       if x == 13 and y == 17 then
  133.        Screen()
  134.        mon.setBackgroundColor(colors.lime)
  135.        mon.setCursorPos(13,17)
  136.        mon.write("8  ===>   Rundfahrt Erntemaschine")
  137.        mon.setBackgroundColor(colors.black)
  138.        rs.setBundledOutput("back", colors.gray)
  139.       end
  140.     end
  141. end
  142.  
  143. Screen()      
  144.  
  145. while true do
  146. Auslesen()
  147. end
Advertisement
Add Comment
Please, Sign In to add comment