Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sides = {"front", "right", "back", "left"};
- local first = true;
- while true do
- local startTick = (os.time() * 1000 + 18000) % 24000;
- for i = 1, 4 do
- redstone.setOutput(sides[i], true);
- local nowTick = (os.time() * 1000 + 18000) % 24000;
- local consume = nowTick - startTick;
- local timeSupply = 0;
- local firePearl = false;
- print("want fire pearl now tick at", consume);
- if consume == 8 then
- print("fire pearl now tick at", consume);
- os.sleep(0.05);
- redstone.setOutput("top", true);
- os.sleep(0.05);
- timeSupply = -0.1;
- redstone.setOutput("top", false);
- redstone.setOutput(sides[1], true);
- firePearl = true;
- end
- os.sleep(0.05);
- redstone.setOutput(sides[i], false);
- os.sleep(0.17 + timeSupply);
- if firePearl then
- redstone.setOutput("top", false);
- first = false;
- timeSupply = 0;
- end
- end
- if not first or not redstone.getInput("bottom") then
- os.sleep(5);
- first = true;
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement