Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pw=0
- local pc=0
- local sleepTime=1
- if not os.getComputerLabel() then
- for i=1,60 do
- local s=http.get("http://timeapi.netii.net/index.php")
- pw=s.readLine()
- measure=1000/((pw-pc)/20)
- if measure<19 then
- sleepTime=sleepTime-0.01
- end
- pc=pw
- print(sleepTime)
- sleep(sleepTime)
- end
- os.setComputerLabel(tostring(sleepTime))
- else
- sleepTime=tonumber(os.getComputerLabel())
- end
- while 1 do
- local s=http.get("http://timeapi.netii.net/index.php")
- pw=s.readLine()
- ticks3=1000/((pw-pc)/20)
- shell.run("clear")
- print("Current tps:"..tostring(ticks3))
- pc=pw
- sleep(sleepTime)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement