Advertisement
ns09005264

endergenic.lua

Oct 24th, 2020 (edited)
645
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.16 KB | None | 0 0
  1. local sides = {"front", "right", "back", "left"};
  2. local first = true;
  3. while true do
  4.     local startTick = (os.time() * 1000 + 18000) % 24000;
  5.     for i = 1, 4 do
  6.         redstone.setOutput(sides[i], true);
  7.         local nowTick = (os.time() * 1000 + 18000) % 24000;
  8.         local consume = nowTick - startTick;
  9.         local timeSupply = 0;
  10.         local firePearl = false;
  11.         print("want fire pearl now tick at", consume);
  12.         if consume == 8 then
  13.             print("fire pearl now tick at", consume);
  14.             os.sleep(0.05);
  15.             redstone.setOutput("top", true);
  16.             os.sleep(0.05);
  17.             timeSupply = -0.1;
  18.             redstone.setOutput("top", false);
  19.             redstone.setOutput(sides[1], true);
  20.             firePearl = true;
  21.         end
  22.         os.sleep(0.05);
  23.         redstone.setOutput(sides[i], false);
  24.         os.sleep(0.17 + timeSupply);    
  25.         if firePearl then
  26.             redstone.setOutput("top", false);
  27.             first = false;
  28.             timeSupply = 0;
  29.         end
  30.     end
  31.  
  32.     if not first or not redstone.getInput("bottom") then
  33.         os.sleep(5);
  34.         first = true;
  35.     end
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement