Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function writeToFile(fileName, data)
- local f = fs.open(fileName, "w")
- f.write(data)
- f.close()
- end
- local state=false
- local txt=""
- while true do
- local s=redstone.getInput("back")
- if s~=state then
- state=s
- local t
- if s then
- t="on:"..os.clock()
- else
- t="off:"..os.clock()
- end
- print(t)
- txt=txt..t.."\n"
- writeToFile("measuringResult",txt)
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement