Advertisement
KelvinBouma

Amunet

Feb 18th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. post_link = "http://cc.ordewittetafel.nl/reactor1.php"
  2. get_link = "http://cc.ordewittetafel.nl/switch_reactor1.php"
  3.  
  4. reactor = peripheral.wrap("back")
  5. name = "Amunet"
  6.  
  7. online = 0
  8.  
  9. while true do
  10.     if online < 9 then
  11.         online = online + 1
  12.     else
  13.         online = 0
  14.     end
  15.  
  16.     http.post(post_link, "reactor=" .. name .. "&status=" .. tostring(reactor.isActive()) .. "&temp=" .. reactor.getHeat() .. "&online=" .. online .. "&output=" .. reactor.getEUOutput())
  17.  
  18.     output = http.get(get_link)
  19.  
  20.     doOutput = output.readAll()
  21.  
  22.     if doOutput == "true" then
  23.         redstone.setOutput("back", true)
  24.     else
  25.         redstone.setOutput("back", false)
  26.     end
  27.  
  28.     output.close()
  29.  
  30.     os.sleep(1)
  31.     os.queueEvent("ok")
  32.     os.pullEvent("ok")
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement