Advertisement
Muzze77

Richtungsweiser

Mar 26th, 2017
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.87 KB | None | 0 0
  1. shell.run("clear")
  2.  
  3. mon = peripheral.wrap("back")
  4.  
  5. white = colors.white
  6. blue = colors.blue
  7. sbcol = white
  8. stcol = blue
  9. welcomeText = "INFO 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. mon.clear()
  36. cbut(2,2,"---->")
  37. cbut(2,3,"Infos")
  38.  
  39. cbut(2,4,"<----")
  40. cbut(2,5,"Stadtkarte")
  41. cbut(2,7,"Stadtbesitzer")
  42. cbut(2,8,"Muzze77")
  43. cbut(2,10,"Assistent/en")
  44. cbut(2,11,"Keiner")
  45. evt, key = os.pullEvent("char")
  46. if key == "x" then
  47.     shell.run("edit 1")
  48. else
  49.     shell.run("clear")
  50.     print("Eingabe falsch")
  51. end
  52.  
  53. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement