Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- power = peripheral.wrap("left")
- compteur = 12497
- output = power.getOutput() / 1000000
- outputp = output * 1000
- diamc = compteur / 100
- rednet.open("back")
- ipcontrol = 6
- while true do
- red = redstone.getInput("front")
- print(red)
- if red == true
- then compteur = 0
- end
- --anticrash
- test = power.getInput()
- typetest = type(test)
- if typetest == "number"
- then
- output = power.getOutput() / 1000000
- outputp = output * 1000
- diamc = compteur / 250
- diams = math.floor(diamc)
- term.setCursorPos(1,2)
- print("Consomation total")
- term.setCursorPos(2,3)
- compteur = (compteur + output)
- print(compteur.." MJ")
- term.setCursorPos(1,4)
- print("Consomation")
- print(outputp.." kJ/t")
- print("Facture")
- print(diams.." diamond")
- sleep(0.5)
- term.clear()
- if diams >= 50
- then shell.run("redstone set right 3")
- else shell.run("redstone set right 0")
- end
- end -- anticrash
- end --Boucle while
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement