This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Disy's profile picture

Lag Reader

Started by Disy, 18 August 2012 - 06:57 AM
Disy #1
Posted 18 August 2012 - 08:57 AM
So I was working on a tekkit server on my computercraft monitors and though, what if I had a computer that had a minecart go back and forth behind it with detector rails at the closest and far end and the computer would read how long it takes for the minecart to get back to the computer. Depending on how long it takes the computer will then print on the monitor next to it the lag level whether it be: Low, Normal, Moderate, High, etc! Sort of like sonar! I was wondering if someone here could code it for me as I have no idea on how to make the computer think it this way.
Noodle #2
Posted 19 August 2012 - 05:21 AM
Well.. Make a counter?
function clear()
  term.clear()
  term.setCursorPos(1,1)
end
lg = 0
while true do
  if rs.getInput("back") then
    lg = lg + 1
  end
clear()
write(lg)
end