KelvinBouma

quarry

Apr 6th, 2020
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. post_link = "http://cc.ordewittetafel.nl/reactor2.php"
  2. get_link = "http://cc.ordewittetafel.nl/switch_reactor2.php"
  3.  
  4. reactor = {
  5.     name = "Quarry",
  6.     temperature = "not applicable"
  7. }
  8.  
  9. online = 0
  10.  
  11. while true do
  12.     reactor.status = tostring(redstone.getInput("bottom"))
  13.  
  14.     if online < 9 then
  15.         online = online + 1
  16.     else
  17.         online = 0
  18.     end
  19.  
  20.     http.post(post_link, "reactor=" .. reactor.name .. "&status=" .. reactor.status .. "&temp=" .. reactor.temperature .. "&online=" .. online)
  21.  
  22.     output = http.get(get_link)
  23.  
  24.     doOutput = output.readAll()
  25.  
  26.     if doOutput == "true" then
  27.         redstone.setOutput("bottom", true)
  28.     else
  29.         redstone.setOutput("bottom", false)
  30.     end
  31.  
  32.     output.close()
  33.  
  34.     os.sleep(1)
  35.     os.queueEvent("ok")
  36.     os.pullEvent("ok")
  37. end
Add Comment
Please, Sign In to add comment