Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sleep_until(alarm)
- while alarm>computer.uptime() do
- local timeout=alarm-computer.uptime()
- computer.pullSignal(timeout)
- end
- end
- while 1 do
- sleep_until(math.min(next_breed,next_farm))
- if next_breed<next_farm then
- breed()
- next_breed=computer.uptime()+BREED_INTERVAL
- else
- farm()
- next_farm=computer.uptime()+FARM_INTERVAL
- end
- end
Add Comment
Please, Sign In to add comment