From f3d020c1328d81ac15c3849b46cb31d77425ef4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Fri, 6 Dec 2013 03:10:57 +0100 Subject: [PATCH] non-busy wait in dig program when drop chest is full --- assets/opencomputers/lua/rom/bin/dig.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/assets/opencomputers/lua/rom/bin/dig.lua b/assets/opencomputers/lua/rom/bin/dig.lua index 5d07c18a3..f41f23055 100644 --- a/assets/opencomputers/lua/rom/bin/dig.lua +++ b/assets/opencomputers/lua/rom/bin/dig.lua @@ -133,11 +133,17 @@ function checkedDrop(force) for slot = 1, 16 do if robot.count(slot) > 0 then robot.select(slot) - repeat robot.drop() until robot.count(slot) == 0 + local wait = 1 + repeat + if not robot.drop() then + os.sleep(wait) + wait = math.min(10, wait + 1) + end + until robot.count(slot) == 0 end end robot.select(1) - + dropping = false moveTo(ox, oy, oz, true) turnTowards(of)