Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. local s1 = -1;
  2. local s2 = -1;
  3. local done1 = false;
  4. local done2 = false;
  5. local w1,w2,w3,w4,w5,w1b,w2b,w3b,w4b,w5b
  6.  
  7. while true do
  8.  
  9. os.startTimer(3)
  10. os.pullEvent("timer")
  11.  
  12. w1 = commands.testforblock("715 71 632 wool 14")
  13. w2 = commands.testforblock("723 71 649 wool 14")
  14. w3 = commands.testforblock("715 71 681 wool 14")
  15. w4 = commands.testforblock("719 71 692 wool 14")
  16. w5 = commands.testforblock("723 71 662 wool 14")
  17.  
  18. if w1~=w1b or w2~=w2b or w3~=w3b or w4~=w4b or w5~=w5b then
  19. if w1==false and w2==false and s1~=2 and done1==false then
  20. commands.clone("1067 68 639 1066 72 639 714 79 624") --grün-gelb
  21. s1 = 2
  22. done1 = true
  23. elseif w1==true and w3==false and s1~=0 and done1==false then
  24. commands.clone("1073 75 648 1072 72 648 714 79 624") --rot
  25. s1 = 0
  26. done1 = true
  27. elseif w1==false and w2==true and s1~=0 and done1==false then
  28. commands.clone("1073 75 648 1072 72 648 714 79 624") --rot
  29. s1 = 0
  30. done1 = true
  31. elseif w1==true and w3==true and w4==true and s1~=1 and done1==false then
  32. commands.clone("1073 68 639 1072 72 639 714 79 624") --grün
  33. s1 = 1
  34. done1 = true
  35. elseif w1==true and w3==true and w4==false and s1~=2 and done1==false then
  36. commands.clone("1067 68 639 1066 72 639 714 79 624") --grün-gelb
  37. s1 = 2
  38. done1 = true
  39. end
  40.  
  41. if w2==true and w5==true and s2~=1 and done2==false then
  42. commands.clone("1073 68 639 1072 72 639 718 79 626") --grün
  43. s2 = 1
  44. done2 = true
  45. elseif w2==false and s2~=0 and done2==false then
  46. commands.clone("1073 75 648 1072 72 648 718 79 626") --rot
  47. s2 = 0
  48. done2 = true
  49. elseif w2==true and w5==false and w3==false and w4==true and s2~=2 and done2==false then
  50. commands.clone("1067 68 639 1066 72 639 718 79 626") --grün-gelb
  51. s2 = 2
  52. done2 = true
  53. elseif w2==true and w5==false and w3==false and w4==false and s2~=2 and done2==false then
  54. commands.clone("1067 68 639 1066 72 639 718 79 626") --grün-gelb
  55. s2 = 2
  56. done2 = true
  57. elseif w2==true and w5==false and w3==true and s2~=2 and done2==false then
  58. commands.clone("1073 75 648 1072 72 648 718 79 626") --rot
  59. s2 = 2
  60. done2 = true
  61. end
  62. done1 = false
  63. done2 = false
  64. w1b = w1
  65. w2b = w2
  66. w3b = w3
  67. w4b = w4
  68. w5b = w5
  69. end
  70. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement