Skip to content

Commit

Permalink
Added a printout to show how many seconds until depleation or filling
Browse files Browse the repository at this point in the history
  • Loading branch information
rater193 committed Apr 18, 2018
1 parent b253c98 commit 9870c9f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions baseglasses/baseglasses.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,13 @@ thread.create(function()

local energyStored = math.floor(v.proxy.getEnergyStored())
local energyMax = math.floor(v.proxy.getMaxEnergyStored())
local difference = v.previouslyCheckedEnergy - energyStored
local generated = v.previouslyCheckedEnergy - energyStored
local remaining = energyMax-energyStored

if(difference>0) then

if(generated==0) then

else
print("Time remaining: " .. tostring(math.abs(math.floor(remaining/generated))) .. " seconds")
end

v.previouslyCheckedEnergy = energyStored
Expand Down Expand Up @@ -160,6 +163,6 @@ thread.create(function()
tps = tostring(tps)
tpsText.setText("tps: " .. tostring(tps))

print("tick took " .. tostring(timeTaken))
--print("tick took " .. tostring(timeTaken))
end
end)

0 comments on commit 9870c9f

Please sign in to comment.