Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- post_link = "http://cc.ordewittetafel.nl/reactor1.php"
- get_link = "http://cc.ordewittetafel.nl/switch_reactor1.php"
- reactor = {
- name = "Amunet",
- temperature = "unknown"
- }
- online = 0
- while true do
- reactor.status = tostring(redstone.getInput("back"))
- if online < 9 then
- online = online + 1
- else
- online = 0
- end
- http.post(post_link, "reactor=" .. reactor.name .. "&status=" .. reactor.status .. "&temp=" .. reactor.temperature .. "&online=" .. online)
- output = http.get(get_link)
- doOutput = output.readAll()
- if doOutput == "true" then
- redstone.setOutput("back", true)
- else
- redstone.setOutput("back", false)
- end
- output.close()
- os.sleep(1)
- os.queueEvent("ok")
- os.pullEvent("ok")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement