Advertisement
Ubidibity

withertest.lua

Jun 27th, 2025 (edited)
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | Gaming | 0 0
  1. amieven=true
  2. -- note for the bottom turtle (since it's place is take by a fan) change place to placeUp
  3. -- wither-a through -c can be false, 1-4 can be true
  4.  
  5. function isEvenSecond()
  6.     local seconds = math.floor(os.time()) -- Get current in-game time in seconds
  7.     return seconds % 2 == 0 -- Returns true if seconds is even, false if odd
  8. end
  9.  
  10. while true do
  11.     if isEvenSecond() and amieven then
  12.         -- Group 1 turtles do their task
  13.         print("Group 1: Active (Even second)")
  14.         while not turtle.place() do
  15.           turtle.dig()
  16.         end
  17.     else
  18.         -- Group 2 turtles do their task but don't stack skulls...
  19.         print("Group 2: Active (Odd second)")
  20.         local has_block, data = turtle.inspect()
  21.         if has_block then
  22.           if data.name == "Minecraft:wither_skeleton_skull" then
  23.             -- nobody do nothin'
  24.           else
  25.             print("Target=",data.name)
  26. --            turtle.place()
  27.           end
  28.         else
  29.           turtle.place()
  30.         end
  31.     end
  32.     os.sleep(1) -- Wait briefly to avoid spamming, adjust as needed
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement