Muzze77

BankSystemTemplate

Mar 21st, 2014
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.22 KB | None | 0 0
  1. --Teststcript by Muzze77--
  2. shell.run("clear")
  3. eingabe = 0
  4. sit = 0
  5. a = 0
  6. b = 0
  7. c = 0
  8.  
  9. function numpad ()
  10.     shell.run("clear")
  11.     term.setBackgroundColor(colors.blue)
  12.     term.setCursorPos(14, 3)
  13.     print("123")
  14.     term.setCursorPos(14, 4)
  15.     print("456")
  16.     term.setCursorPos(14, 5)
  17.     print("789")
  18.     term.setCursorPos(14, 6)
  19.     print("*0#")
  20. end
  21.  
  22.  
  23. function Eingabe2 ()
  24. event,side,x,y = os.pullEvent()
  25.     if event == "monitor_touch" then       
  26.         if x == 14 and y == 3 then
  27.             sit = sit + 1
  28.             if sit == 1 then
  29.             a = 1
  30.             write("1")
  31.             elseif sit == 2 then
  32.             b = 1
  33.             write("1")
  34.             elseif sit == 3 then
  35.             c = 1
  36.             write("1")
  37.             end
  38.             sit = 0
  39.         elseif x == 15 and y == 3 then 
  40.             sit = sit + 1
  41.             if sit == 1 then
  42.             a = 2
  43.             write("2")
  44.             elseif sit == 2 then
  45.             b = 2
  46.             write("2")
  47.             elseif sit == 3 then
  48.             c = 2
  49.             write("2")
  50.             end
  51.             sit = 0
  52.         end
  53.    
  54.     end
  55.    
  56. end
  57.  
  58. function Eingabe1 ()
  59. event,side,x,y = os.pullEvent()
  60.     if event == "monitor_touch" then
  61.         if x == 14 and y == 3 then
  62.         shell.run("clear")
  63.         print("Wie viel willst du einzahlen?")
  64.         Eingabe2()
  65.         end
  66.     end
  67. end
  68.  
  69. while true do
  70. term.setCursorPos(1, 1)
  71. print("Abheben[1], Einzahlen[2], Kontostand[3]")
  72. Eingabe1()
  73. numpad()
  74.  
  75.  
  76. sleep(0.02)
  77. end
Add Comment
Please, Sign In to add comment