Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local time_url = "http://www.worldtimeserver.com/current_time_in_US-CA.aspx" --Replace this
- local function getTime()
- local request = http.get(time_url)
- local time_content = request.readAll()
- request.close()
- local search_text = [[<div id="analog%-digital">.-<span class="font7">(.-)</span>]]
- local _,_, global_time = time_content:find(search_text)
- local global_time = global_time:gsub("%s", "")
- print(global_time)
- end
- while true do
- rs.setOutput("back", true)
- os.pullEvent("redstone") --Waits until redstone changes states
- if rs.getInput("bottom") then
- print("Circuit tripped at: "..getTime())
- rs.setOutput("back", false)
- sleep (60)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement