Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- s = sensor.wrap("left")
- details = s.getTargetDetails("-1,1,0")
- i=0
- while i < 100 do
- if details.Heat > 100 then
- redstone.setOutput("top", false)
- else
- redstone.setOutput("top", true)
- end
- local json = "[";
- json = json .. "{\"heat\":" .. details.Heat .. "},"
- json = json .. "{\"energyEmitted\":" .. details.EnergyEmitted .. "},"
- json = json .. "{\"active\":" .. tostring(details.Active) .. "},"
- json = json .. "{\"heatPercentage\":" .. details.HeatPercentage .. "},"
- json = json .. "{\"energySunken\":" .. details.EnergySunken .. "},"
- json = json .. "{\"output\":" .. details.Output .. "},"
- json = json .. "{\"maxHeat\":" .. details.MaxHeat .. "}"
- json = json .. "]";
- http.post("https://fourconnected.homeip.net/cgi-bin/minecraft.cgi?action=post&player=1&item=nuclearreactor", json)
- local time = os.time()
- local formattedTime = textutils.formatTime(time, false)
- print(formattedTime .. " updated: ")
- os.sleep(10)
- end
- os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement