function walk_to(x, y)
    local e = free_roam.get_entity()
    e:walk_to(x, y)
    free_roam.wait()
    while e.is_walking do
        free_roam.wait()
    end
    local ex, ey = e:get_position()
    return math.abs(ex - x) < 0.05 and math.abs(ey - y) < 0.05
end

function walk_to_face(x, y, angle)
    local e = free_roam.get_entity()
    e:walk_to_face(x, y, angle)
    free_roam.wait()
    while e.is_walking do
        free_roam.wait()
    end
    local ex, ey = e:get_position()
    return math.abs(ex - x) < 0.05 and math.abs(ey - y) < 0.05
end

function wait_ticks(ticks)
    for i = 0, ticks do
        free_roam.wait()
    end
end