Advertisement
babulm

Untitled

Dec 13th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.62 KB | None | 0 0
  1. event , side , x , y = os.pullEvent("mouse_click")
  2.  
  3. if      x >= 35 and x <= 36 and y == 4 then
  4.             table1[seite][1].anzahl = table1[seite][1].anzahl + table1[seite][1].menge
  5. elseif  x >= 44 and x <= 45 and y == 4 then
  6.             if table1[seite][1].anzahl - table1[seite][1].menge < 0 then
  7.                 table1[seite][1].anzahl = 0
  8.             else
  9.                 table1[seite][1].anzahl = table1[seite][1].anzahl - table1[seite][1].menge
  10.             end
  11. elseif  x >= 35 and x <= 36 and y == 6 then
  12.             table1[seite][2].anzahl = table1[seite][2].anzahl + table1[seite][2].menge
  13. elseif  x >= 44 and x <= 45 and y == 6 then
  14.             if table1[seite][2].anzahl - table1[seite][2].menge < 0 then
  15.                 table1[seite][2].anzahl = 0
  16.             else
  17.                 table1[seite][2].anzahl = table1[seite][2].anzahl - table1[seite][2].menge
  18.             end        
  19. elseif  x >= 35 and x <= 36 and y == 8 then
  20.             table1[seite][3].anzahl = table1[seite][3].anzahl + table1[seite][3].menge
  21. elseif  x >= 44 and x <= 45 and y == 8 then
  22.             if table1[seite][3].anzahl - table1[seite][3].menge < 0 then
  23.                 table1[seite][3].anzahl = 0
  24.             else
  25.                 table1[seite][3].anzahl = table1[seite][3].anzahl - table1[seite][3].menge
  26.             end                    
  27. elseif  x >= 35 and x <= 36 and y == 10 then
  28.             table1[seite][4].anzahl = table1[seite][4].anzahl + table1[seite][4].menge
  29. elseif  x >= 44 and x <= 45 and y == 10 then
  30.             if table1[seite][4].anzahl - table1[seite][4].menge < 0 then
  31.                 table1[seite][4].anzahl = 0
  32.             else
  33.                 table1[seite][4].anzahl = table1[seite][4].anzahl - table1[seite][4].menge
  34.             end                    
  35. elseif  x >= 35 and x <= 36 and y == 12 then
  36.             table1[seite][5].anzahl = table1[seite][5].anzahl + table1[seite][5].menge
  37. elseif  x >= 44 and x <= 45 and y == 12 then
  38.             if table1[seite][5].anzahl - table1[seite][5].menge < 0 then
  39.                 table1[seite][5].anzahl = 0
  40.             else
  41.                 table1[seite][5].anzahl = table1[seite][5].anzahl - table1[seite][5].menge
  42.             end                    
  43. elseif  x >= 35 and x <= 36 and y == 14 then
  44.             table1[seite][6].anzahl = table1[seite][6].anzahl + table1[seite][6].menge
  45. elseif  x >= 44 and x <= 45 and y == 14 then
  46.             if table1[seite][6].anzahl - table1[seite][6].menge < 0 then
  47.                 table1[seite][6].anzahl = 0
  48.             else
  49.                 table1[seite][6].anzahl = table1[seite][6].anzahl - table1[seite][6].menge
  50.             end                    
  51. elseif  x >= 35 and x <= 36 and y == 16 then
  52.             table1[seite][7].anzahl = table1[seite][7].anzahl + table1[seite][7].menge
  53. elseif  x >= 44 and x <= 45 and y == 16 then
  54.             if table1[seite][7].anzahl - table1[seite][7].menge < 0 then
  55.                 table1[seite][7].anzahl = 0
  56.             else
  57.                 table1[seite][7].anzahl = table1[seite][7].anzahl - table1[seite][7].menge
  58.             end                    
  59. elseif  x >=44 and x <= 50 and y == 1 then
  60.         os.reboot()
  61.  
  62. ----------------------Seitenblättern--------------------------    
  63. elseif  x >=  41 and x <= 43 and y >= 18 and y <= 19 then      
  64.             if seite == 1 then
  65.                 seite = 2              -----------------Blätterende----------
  66.             else
  67.                 seite = seite - 1
  68.             end
  69. elseif  x >= 47 and x <= 49 and y >= 18 and y <= 19 then
  70.             if seite == 2 then
  71.                 seite = 1              -----------------Blätterende----------
  72.             else
  73.                 seite = seite + 1
  74.             end
  75.            
  76. --------------------------KAUF----------------------------------
  77. elseif  x >= 20 and x <= 34 and y >=18 and y <= 19 then        
  78.             if tonumber(geld) < tonumber(gesamtpreis) then
  79.                     term.clear()
  80.                     print("Dein Geld reicht nicht!")
  81.                     sleep(2)
  82.             else
  83.                 geld = tonumber(geld) - tonumber(gesamtpreis)
  84.                 speichern()
  85.                 backup(user,geld,cpass)
  86.                 kauf()
  87.             end
  88.            
  89.            
  90. ----------------------------------------------------------------           
  91. elseif  x >= 1 and x <= 7 and y == 1 then  
  92.             einlass()
  93. else    
  94.     einkaufen()        
  95.            
  96. end --if end zeile 270--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement