Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local broadcasttime = 0
- local counttime = 0
- local function createtime()
- term.clear()
- term.setCursorPos( 1,1 )
- print( "Set the settings.")
- write("How often should trees harvest?")
- broadcasttime = tonumber(read())
- counttime = broadcasttime
- file = io.open("timesettings.txt" , "w")
- if file == nil then
- return
- end
- file:write( broadcasttime )
- file:write( "\n" )
- file:close()
- term.clear()
- term.setCursorPos( 1,1 )
- print( "Working" )
- end
- local function loadtime()
- file = io.open( "timesettings.txt" , "r")
- while true do
- line = file:read()
- if line == nil then break end
- broadcasttime = tonumber(line)
- file:close()
- return true
- end
- file:close()
- return false
- end
- term.clear()
- term.setCursorPos ( 1,1 )
- print( "Starting Logger Broadcast...")
- if fs.exists( "timesettings.txt") then
- if not loadtime() then
- createtime()
- end
- term.clear()
- term.setCursorPos( 1,1 )
- print( "Cycling")
- else
- createtime()
- end
- rednet.open("right")
Advertisement
Add Comment
Please, Sign In to add comment