Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --BatterieGestion
- --By DJGauth
- --Placez le computer sous la cell
- --Cell Mekanism
- --Veuillez donner ID du computer
- IDC = 1
- c = peripheral.wrap("top")
- --Variable
- energyStored = 0
- h = 2
- d = os.day()
- tn = os.time()
- activ = false
- force = false
- fonction time()
- t = textutils.formatTime(t,false)
- end
- function text()
- term.clear()
- term.setTextColor(colors.yellow)
- term.setCursorPos(1,16)
- term.write("Cell CONTROLLER")
- term.setTextColor(colors.white)
- end
- function ligne()
- term.setCursorPos(1,h)
- term.write("Energy stored: "..energyStored)
- h=h+1
- end
- function affTime()
- term.setCursorPos(1,h)
- term.write("Dernière actualisation le: "..d.." a: "..t)
- h = h + 1
- end
- --Prog
- text()
- while true do
- energyStored = c.getStored()
- ligne()
- time()
- affTime()
- if energyStored < 100000 or force == true then
- redstone.setOutput("top", false)
- activ = false
- else
- activ = true
- redstone.setOutput("top", true)
- end
- sleep(10)
- force = redstone.getInput("right")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement