Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- amieven=true
- -- note for the bottom turtle (since it's place is take by a fan) change place to placeUp
- -- wither-a through -c can be false, 1-4 can be true
- function isEvenSecond()
- local seconds = math.floor(os.time()) -- Get current in-game time in seconds
- return seconds % 2 == 0 -- Returns true if seconds is even, false if odd
- end
- while true do
- if isEvenSecond() and amieven then
- -- Group 1 turtles do their task
- print("Group 1: Active (Even second)")
- while not turtle.place() do
- turtle.dig()
- end
- else
- -- Group 2 turtles do their task but don't stack skulls...
- print("Group 2: Active (Odd second)")
- local has_block, data = turtle.inspect()
- if has_block then
- if data.name == "Minecraft:wither_skeleton_skull" then
- -- nobody do nothin'
- else
- print("Target=",data.name)
- -- turtle.place()
- end
- else
- turtle.place()
- end
- end
- os.sleep(1) -- Wait briefly to avoid spamming, adjust as needed
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement