Advertisement
Guest User

startup

a guest
Sep 26th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.22 KB | None | 0 0
  1. --os.pullEvent = os.pullEventRaw
  2. --[[
  3.  
  4. Minigame Mobspawner
  5.  
  6. Version 1.0
  7.  
  8. made by minemuffin & _Tim1998_  
  9.  
  10. ]]
  11.  
  12.  
  13.  
  14. nir = peripheral.wrap("top")
  15. --m = peripheral.wrap("front")
  16. chat = peripheral.wrap("left")
  17. cabel = "bottom"
  18. rednet.open("back")
  19.  
  20. --Variable
  21. cb1 = colors.orange   -- In Arena teleportieren
  22. cb2 = colors.magenta  -- Aus Arena teleportieren
  23. cb3 = colors.green    -- In verlierer Raum teleportieren
  24. cb4 = colors.blue     -- In Gewinner Raum teleportieren
  25. boden = colors.white  -- Boden åB6ffnen
  26. tank = colors.black   -- Tank entleeren
  27.  
  28.  
  29. spawnmob1 = colors.lightGray
  30. spawnmob2 = colors.cyan
  31. spawnmob3 = colors.purple
  32. spawnmob4 = colors.brown
  33.  
  34. playerdetector = colors.red
  35.  
  36.  
  37. --[[
  38. wall_1 = colors.blue
  39. wall_2 = colors.yellow
  40. wall_3 = colors.lime
  41. wall_4 = colors.pink
  42. wall_5 = colors.gray
  43. ]]
  44.  
  45.  
  46.  
  47. welle = 1
  48. lv1 = 10
  49. lv2 = 20
  50. lv3 = 30
  51. lv4 = 40
  52. lv5 = 45
  53.  
  54. --[[function mob1()
  55. rs.setBundledOutput (cabel, spawnmob1)
  56. sleep(10)
  57. rs.setBundledOutput(cabel,colors.subtract(rs.getBundledOutput(cabel), spawnmob1) )
  58. end
  59. function mob2()
  60. rs.setBundledOutput (cabel,colors.combine(spawnmob1,spawnmob2))
  61. sleep(10)
  62. rs.setBundledOutput(cabel,colors.subtract(rs.getBundledOutput(cabel), colors.combine(spawnmob1,spawnmob2)) )
  63. end
  64. function mob3()
  65. rs.setBundledOutput (cabel,colors.combine(spawnmob1,spawnmob2,spawnmob3))
  66. sleep(10)
  67. rs.setBundledOutput(cabel,colors.subtract(rs.getBundledOutput(cabel), colors.combine(spawnmob1,spawnmob2,spawnmob3)) )
  68. end
  69. function mob4()
  70. rs.setBundledOutput (cabel,colors.combine(spawnmob1,spawnmob2,spawnmob3,spawnmob4))
  71. sleep(10)
  72. rs.setBundledOutput(cabel,colors.subtract(rs.getBundledOutput(cabel), colors.combine(spawnmob1,spawnmob2,spawnmob3,spawnmob4)) )
  73. end
  74.  ]]
  75. function Port1()  --In Arena teleportieren
  76. rs.setBundledOutput (cabel, cb1)
  77. sleep(1)
  78.    rs.setBundledOutput(cabel,colors.subtract(rs.getBundledOutput(cabel), cb1) )
  79. sleep(0,8)
  80. end
  81. function Port2()
  82. rs.setBundledOutput (cabel, cb2) --Aus Arena teleportieren
  83. sleep(1)
  84.    rs.setBundledOutput(cabel,colors.subtract(rs.getBundledOutput(cabel), cb2) )
  85. sleep(0,8)
  86. end
  87. function PortV()
  88. rs.setBundledOutput (cabel, cb3) -- In verlierer Raum teleportieren
  89. sleep(1)
  90.    rs.setBundledOutput(cabel,colors.subtract(rs.getBundledOutput(cabel), cb3) )
  91. sleep(0,8)
  92. end
  93. function PortG()
  94. rs.setBundledOutput (cabel, cb4) -- In Gewinner Raum teleportieren
  95. sleep(1)
  96.    rs.setBundledOutput(cabel,colors.subtract(rs.getBundledOutput(cabel), cb4) )
  97. sleep(0,8)
  98. end
  99.  
  100. function mobs()
  101. if welle == 1 then
  102.    rs.setBundledOutput (cabel, spawnmob1)
  103.    sleep(10)
  104.    rs.setBundledOutput(cabel,colors.subtract(rs.getBundledOutput(cabel), spawnmob1) )
  105. end
  106.  if welle == 2 then
  107.     rs.setBundledOutput (cabel,colors.combine(spawnmob1,spawnmob2))
  108.     sleep(10)
  109.     rs.setBundledOutput(cabel,colors.subtract(rs.getBundledOutput(cabel), colors.combine(spawnmob1,spawnmob2)) )
  110. end
  111.  if welle == 3 then
  112.     rs.setBundledOutput (cabel,colors.combine(spawnmob1,spawnmob2,spawnmob3))
  113.     sleep(10)
  114.     rs.setBundledOutput(cabel,colors.subtract(rs.getBundledOutput(cabel), colors.combine(spawnmob1,spawnmob2,spawnmob3)) )
  115. end
  116.  if welle == 4 then
  117.     rs.setBundledOutput (cabel,colors.combine(spawnmob1,spawnmob2,spawnmob3,spawnmob4))
  118.     sleep(10)
  119.     rs.setBundledOutput(cabel,colors.subtract(rs.getBundledOutput(cabel),colors.combine(spawnmob1,spawnmob2,spawnmob3,spawnmob4)) )
  120. end
  121. end
  122.  
  123. function start()
  124.  
  125. if rs.testBundledInput (cabel, playerdetector) == true then
  126.     rednet.send(681, "STOP")
  127. rs.setBundledOutput(cabel, 0)
  128. sleep(2)
  129. Port1()
  130. chat.say("Elliminiere alle Mobs in "..lv1.." Sekunden")
  131. mobs()
  132. sleep(lv1)
  133. Port2()
  134. sleep(0,5)
  135. chat.say("Auswertung...")
  136. rednet.send(681, "STOP")
  137. rs.setBundledOutput (cabel, boden)
  138. sleep(25)
  139. a1,b1,c1,d1 = nir.get(1)
  140. fuel1 = d1["amount"]
  141.     if fuel1 == 0 then
  142.     welle = welle + 1
  143.     print(fuel1)
  144.     chat.say("Geschafft")
  145.     sleep(2)
  146.     chat.say("Bereit fåBCr Welle 2 ?? :D")
  147.     sleep(2)
  148.     Welle2()
  149.     else
  150.     print(fuel1)
  151.     chat.say("Leider hast du es nicht geschafft alle Mobs in "..lv1.." zu tåB6ten")
  152.     chat.say("Versuche es erneut")
  153.     PortV()
  154.     rednet.send(681, "STOP")
  155.     rednet.send(681, "Auf")
  156.     end
  157. rs.setBundledOutput(cabel, tank)
  158. else  
  159. chat.say("Kein Spieler in Reichweite gefunden, breche das Minispiel jetzt ab")
  160. sleep(1)
  161.     rednet.send(681, "Auf")
  162. end
  163. end
  164.  
  165. function Welle2()
  166. if rs.testBundledInput (cabel, playerdetector) == true then
  167. rednet.send(681, "1")
  168. rs.setBundledOutput(cabel, 0)
  169. sleep(2)
  170. Port1()
  171. chat.say("Elliminiere alle Mobs in "..lv2.." Sekunden")
  172. mobs()
  173. sleep(lv2)
  174. Port2()
  175. sleep(0,5)
  176. chat.say("Auswertung...")
  177. rednet.send(681, "STOP")
  178. rs.setBundledOutput (cabel, boden)
  179. sleep(25)
  180. a1,b1,c1,d1 = nir.get(1)
  181. fuel1 = d1["amount"]
  182.     if fuel1 == 0 then
  183.     welle = welle + 1
  184.     print(fuel1)
  185.     chat.say("Geschafft")
  186.     chat.say("Bereit fåBCr Welle 3 ?? :D")
  187.     sleep(2)
  188.     Welle3()
  189.     else
  190.     print(fuel1)
  191.     chat.say("Leider hast du es nicht geschafft alle Mobs in "..lv2.." zu tåB6ten")
  192.     chat.say("Versuche es erneut")
  193.     PortV()
  194.     rednet.send(681, "STOP")
  195.     rednet.send(681, "Auf")
  196.     end
  197. rs.setBundledOutput(cabel, tank)
  198. else  
  199. chat.say("Kein Spieler in Reichweite gefunden, breche das Minispiel jetzt ab")
  200. sleep(1)
  201.     rednet.send(681, "Auf")
  202. end
  203. end
  204.  
  205. function Welle3()
  206. if rs.testBundledInput (cabel, playerdetector) == true then
  207. rednet.send(681, "2")
  208. rs.setBundledOutput(cabel, 0)
  209. sleep(2)
  210. Port1()
  211. chat.say("Elliminiere alle Mobs in "..lv3.." Sekunden")
  212. mobs()
  213. sleep(lv3)
  214. Port2()
  215. sleep(0,5)
  216. chat.say("Auswertung...")
  217. rednet.send(681, "STOP")
  218. rs.setBundledOutput (cabel, boden)
  219. sleep(25)
  220. a1,b1,c1,d1 = nir.get(1)
  221. fuel1 = d1["amount"]
  222.     if fuel1 == 0 then
  223.     welle = welle + 1
  224.     print(fuel1)
  225.     chat.say("Geschafft")
  226.     chat.say("Bereit fåBCr Welle 4 ?? :D")
  227.     sleep(2)
  228.     Welle4()
  229.     else
  230.     print(fuel1)
  231.     chat.say("Leider hast du es nicht geschafft alle Mobs in " ..lv3.." zu tåB6ten")
  232.     chat.say("Versuche es erneut")
  233.     PortV()
  234.     rednet.send(681, "STOP")
  235.     rednet.send(681, "Auf")
  236.     end
  237. rs.setBundledOutput(cabel, tank)
  238. else  
  239. chat.say("Kein Spieler in Reichweite gefunden, breche das Minispiel jetzt ab")
  240. sleep(1)
  241.     rednet.send(681, "Auf")
  242. end
  243. end
  244.  
  245. function Welle4()
  246. if rs.testBundledInput (cabel, playerdetector) == true then
  247. rednet.send(681, "3")
  248. rs.setBundledOutput(cabel, 0)
  249. sleep(2)
  250. Port1()
  251. chat.say("Elliminiere alle Mobs in "..lv4.." Sekunden")
  252. mobs()
  253. sleep(lv4)
  254. Port2()
  255. sleep(0,5)
  256. chat.say("Auswertung...")
  257. rednet.send(681, "STOP")
  258. rs.setBundledOutput (cabel, boden)
  259. sleep(25)
  260. a1,b1,c1,d1 = nir.get(1)
  261. fuel1 = d1["amount"]
  262.     if fuel1 == 0 then
  263.     welle = welle + 1
  264.     print(fuel1)
  265.     chat.say("Herzlichen GlåBCckwunsch")
  266.     PortG()
  267.     rednet.send(681, "STOP")
  268.     rednet.send(681, "Auf")
  269.     else
  270.     print(fuel1)
  271.     chat.say("Leider hast du es nicht geschafft alle Mobs in "..lv4.." zu tåB6ten")
  272.     chat.say("Versuche es erneut")
  273.     PortV()
  274.     rednet.send(681, "STOP")
  275.     rednet.send(681, "Auf")
  276.     end
  277. rs.setBundledOutput(cabel, tank)   
  278. else  
  279. chat.say("Kein Spieler in Reichweite gefunden, breche das Minispiel jetzt ab")
  280. sleep(1)
  281.     rednet.send(681, "Auf")
  282. end
  283. end
  284.  
  285. while true do
  286. if rs.getInput("right") == true then
  287. welle = 1
  288. rs.setBundledOutput(cabel, tank)
  289.   rednet.send(681, "Zu")
  290. sleep(1,5)
  291. start()
  292. end
  293. sleep(0,5)
  294. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement