Advertisement
davidweisgerber

Untitled

Mar 2nd, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. os.loadAPI("ocs/apis/sensor")
  2. s = sensor.wrap("left")
  3.  
  4. details = s.getTargetDetails("-1,1,0")
  5.  
  6. i=0
  7. while i < 100 do
  8. if details.Heat > 100 then
  9. redstone.setOutput("top", false)
  10. else
  11. redstone.setOutput("top", true)
  12. end
  13.  
  14. local json = "[";
  15. json = json .. "{\"heat\":" .. details.Heat .. "},"
  16. json = json .. "{\"energyEmitted\":" .. details.EnergyEmitted .. "},"
  17. json = json .. "{\"active\":" .. tostring(details.Active) .. "},"
  18. json = json .. "{\"heatPercentage\":" .. details.HeatPercentage .. "},"
  19. json = json .. "{\"energySunken\":" .. details.EnergySunken .. "},"
  20. json = json .. "{\"output\":" .. details.Output .. "},"
  21. json = json .. "{\"maxHeat\":" .. details.MaxHeat .. "}"
  22. json = json .. "]";
  23. http.post("https://fourconnected.homeip.net/cgi-bin/minecraft.cgi?action=post&player=1&item=nuclearreactor", json)
  24.  
  25. local time = os.time()
  26. local formattedTime = textutils.formatTime(time, false)
  27.  
  28. print(formattedTime .. " updated: ")
  29.  
  30. os.sleep(10)
  31.  
  32. end
  33.  
  34. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement