From 7438252fb4024de780f10fb59ab691eae9f2c1af Mon Sep 17 00:00:00 2001 From: "kepler155c@gmail.com" Date: Tue, 16 May 2017 15:58:32 -0400 Subject: [PATCH] builder tweaks --- apps/builder.lua | 1 + sys/apis/util.lua | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/builder.lua b/apps/builder.lua index 1d16c19..bc7d14a 100644 --- a/apps/builder.lua +++ b/apps/builder.lua @@ -1703,6 +1703,7 @@ function supplyPage:setSupplies(supplies) else entry.need = entry.need + s.need end + entry.need = entry.need - turtle.getItemCount(s.index) end self.grid:setValues(t) diff --git a/sys/apis/util.lua b/sys/apis/util.lua index 951701c..6dd4a85 100644 --- a/sys/apis/util.lua +++ b/sys/apis/util.lua @@ -22,10 +22,10 @@ function Util.tryTimes(attempts, f, ...) end function Util.throttle(fn) - local ts = os.time() + local ts = os.clock() local timeout = .095 return function(...) - local nts = os.time() + local nts = os.clock() if nts > ts + timeout then ts = nts os.sleep(0)