def farm_patient_pumpkins():
ws = get_world_size()
ticks = 0
HARVEST_INTERVAL = 100 # Собирать каждые 100 тиков
while True:
ticks += 1
should_harvest = (ticks % HARVEST_INTERVAL == 0)
for _ in range(ws):
while get_pos_y() > 0:
move(South)
for _ in range(ws):
if get_water() < 0.75:
use_item(Items.Water)
till()
entity = get_entity_type()
if entity == Entities.DeadPumpkin:
harvest()
plant(Entities.Pumpkin)
elif entity == None:
plant(Entities.Pumpkin)
elif entity == Entities.Pumpkin:
# Собираем ТОЛЬКО если пришло время
if should_harvest and can_harvest():
harvest()
move(North)
if not move(East):
for _ in range(ws - 1):
move(West)
farm_patient_pumpkins()