Advertisement
Guest User

Casino

a guest
Feb 23rd, 2020
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.72 KB | None | 0 0
  1. local c = require("component")
  2. money = 0
  3. stavka = 5
  4. w10 ="minecraft:dirt"
  5. w20="minecraft:stone"
  6. w30="minecraft:chest"
  7. jek1="minecraft:diamond"
  8. winj1=3
  9. winj2=4
  10. winj3=5
  11. while true do
  12. os.sleep(0)
  13. stavkaB = c.redstone.getInput(1)
  14. stavkaM = c.redstone.getInput(4)
  15. if stavkaM == 15
  16. then
  17. os.sleep(1)
  18. stavka = stavka - 5
  19. if stavka == 0
  20. then
  21. stavka = 5
  22. end
  23. end
  24. if stavkaB == 15
  25. then
  26. os.sleep(1)
  27. stavka = stavka + 5
  28. if stavka == 25
  29. then
  30. stavka = 20
  31. end
  32. end
  33. vklu = c.redstone.getInput(2)
  34. if vklu == 0
  35. then
  36. else
  37. if vklu == 15
  38. then
  39. money = money - stavka
  40. proc2 = math.random(1,2)
  41. proc3 = math.random(1,3)
  42. cikl = 0
  43. for cik = 0, 10, 1
  44. do
  45. os.sleep(0)
  46. kl = 4
  47. ran = math.random(1,3)
  48. jek = math.random(1,10)
  49. if ran == 1 and kl == 4
  50. then
  51. c.openperipheral_selector.setSlot(4, {['id']=w10})
  52. ran = math.random(1,3)
  53. kl =5
  54. slot1 = 10
  55. end
  56. if ran == 2 and kl == 4 then
  57. c.openperipheral_selector.setSlot(4, {['id']=w20})
  58. ran = math.random(1,3)
  59. kl = 5
  60. slot1 = 20
  61. end
  62. if ran == 3 and kl == 4 then
  63. c.openperipheral_selector.setSlot(4, {['id']=w30})
  64. ran = math.random(1,3)
  65. kl = 5
  66. slot1 = 30
  67. end
  68. if jek == 7 and kl == 4
  69. then
  70. c.openperipheral_selector.setSlot(4, {['id']=jek1})
  71. winj1 = 1
  72. slot1=slot2
  73. jek =math.random(1,10)
  74. end
  75. os.sleep(0)
  76. if ran == 1 and kl == 4
  77. then
  78. c.openperipheral_selector.setSlot(5, {['id']=w10})
  79. ran = math.random(1,3)
  80. kl = 6
  81. slot2 = 10
  82. end
  83. if ran == 2 and kl == 5
  84. then
  85. c.openperipheral_selector.setSlot(5, {['id']=w20})
  86. ran = math.random(1,3)
  87. kl = 6
  88. slot2 = 20
  89. end
  90. if ran == 3 and kl == 5
  91. then
  92. c.openperipheral_selector.setSlot(5, {['id']=w30})
  93. ran = math.random(1,3)
  94. kl = 6
  95. slot2 = 30
  96. end
  97. if jek == 7 and kl == 5
  98. then
  99. c.openperipheral_selector.setSlot(5, {['id']=jek1})
  100. winj2 = 1
  101. jek= math.random(1,10)
  102. slot2=slot3
  103. end
  104. os.sleep(0)
  105. if ran == 1 and kl == 6
  106. then
  107. c.openperipheral_selector.setSlot(6, {['id']=w10})
  108. ran = math.random(1,3)
  109. kl = 4
  110. slot3 =10
  111. end
  112. if ran == 2 and kl == 6
  113. then
  114. c.openperipheral_selector.setSlot(6, {['id']=w20})
  115. ran = math.random(1,3)
  116. kl = 4
  117. slot3 = 20
  118. end
  119. if ran == 3 and kl == 6
  120. then
  121. c.openperipheral_selector.setSlot(6, {['id']=w30})
  122. ran = math.random(1,3)
  123. if jek == 7 and kl == 6
  124. then
  125. c.openperipheral_selector.setSlot(6,{['id']=jek1})
  126. winj3 = 1
  127. slot3=slot2
  128. end
  129. kl = 4
  130. slot3 = 30
  131. end
  132. end
  133. if winj1 == winj2
  134. then
  135. if winj2 == winj3
  136. then
  137. winj1 = 2
  138. winj2 = 3
  139. winj3 = 4
  140. print("x50")
  141. money = money + stavka * 50
  142. end
  143. end
  144. if slot1 == slot2
  145. then
  146. if slot2 == slot3
  147. then
  148. if slot1 == 10
  149. then print("x2")
  150. money = money + stavka * 2
  151. end
  152. if slot1 == 20
  153. then
  154. print("x5")
  155. money = money + stavka * 5
  156. end
  157. if slot1 == 30
  158. then
  159. print("x7")
  160. money = money + stavka * 7
  161. end
  162. end
  163. end
  164. print("Деньги: "..money )
  165. end
  166. end
  167. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement