Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("front")
- targetid = 3 -- You still gotta set this if you move.
- local lastTime = os.epoch('utc')
- local lastClock = os.clock()
- while true do
- os.sleep(0.5)
- local time = os.epoch('utc') - lastTime -- real world milliseconds
- local clock = os.clock() - lastClock -- ticks * 0.05
- lastTime = time
- lastClock = clock
- local tps = (clock * 20) / (time / 1000)
- print(tps)
- local ratio = tps/20
- print(ratio)
- rednet.send(targetid,"speed "..ratio)
- end
Advertisement
Add Comment
Please, Sign In to add comment