ns09005264

endergenic.lua

Oct 27th, 2020 (edited)
603
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local sides = {"front", "right", "back", "left"};
  2. local first = true;
  3. while true do
  4.     local tick = ((os.time() * 1000 + 18000) % 24000) % 12;
  5.     if tick % 3 == 0 then
  6.         local side = sides[tick / 3 + 1];
  7.         print("now tick ", tick, " now side", side);
  8.         redstone.setOutput(side, true);
  9.         os.sleep(0.05);
  10.         redstone.setOutput(side, false);
  11.     end
  12.  
  13.     if tick == 9 and (first or not redstone.getInput("bottom")) then
  14.         redstone.setOutput("top", true);
  15.         redstone.setOutput("front", true);
  16.         os.sleep(0.01);
  17.         redstone.setOutput("top", false);
  18.         redstone.setOutput("front", false);
  19.         first = false;
  20.     end
  21.  
  22.     if redstone.getInput("bottom") then
  23.         os.sleep(5);
  24.     end
  25. end
RAW Paste Data