Advertisement
Guest User

startup

a guest
Jan 17th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.90 KB | None | 0 0
  1. power = peripheral.wrap("left")
  2. compteur = 12497
  3. output = power.getOutput() / 1000000
  4. outputp = output * 1000
  5. diamc = compteur / 100
  6. rednet.open("back")  
  7. ipcontrol = 6
  8.  
  9. while true do
  10. red = redstone.getInput("front")
  11. print(red)
  12.  
  13. if red == true
  14. then compteur = 0
  15. end
  16.  
  17.  
  18.  
  19.  
  20.  
  21. --anticrash
  22. test = power.getInput()
  23. typetest = type(test)
  24. if typetest == "number"
  25. then
  26.  
  27. output = power.getOutput() / 1000000
  28. outputp = output * 1000
  29. diamc = compteur / 250
  30. diams = math.floor(diamc)
  31. term.setCursorPos(1,2)
  32. print("Consomation total")
  33. term.setCursorPos(2,3)
  34. compteur = (compteur + output)
  35. print(compteur.." MJ")
  36. term.setCursorPos(1,4)
  37. print("Consomation")
  38. print(outputp.." kJ/t")
  39. print("Facture")
  40. print(diams.." diamond")
  41. sleep(0.5)
  42. term.clear()
  43.  
  44. if diams >= 50
  45. then shell.run("redstone set right 3")
  46. else shell.run("redstone set right 0")
  47. end
  48.  
  49.  
  50. end -- anticrash
  51.  
  52. end --Boucle while
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement