Posted 12 November 2014 - 10:18 AM
Hi guys,
i've only been playing minecraft for a month and have decided to try my first coding XD, along with someone who been playing awhile. you prob will find loads of mistake with it :P/>, but here goes. This program should read the energy inside the resonant energy cell to the left. If the cell has more then 2,000,000 energy inside it, then it will output redstone the the right. if less then nothing should happen. so far the program will turn the redstone on when the energy is greater, however when the energy is less then 2,000,000 the redstone signal doesn't turn off. We are unsure if it becuase the program isn't repeating, which we tried to stick a repeat in however it just errored.
Thanks in advance.
i've only been playing minecraft for a month and have decided to try my first coding XD, along with someone who been playing awhile. you prob will find loads of mistake with it :P/>, but here goes. This program should read the energy inside the resonant energy cell to the left. If the cell has more then 2,000,000 energy inside it, then it will output redstone the the right. if less then nothing should happen. so far the program will turn the redstone on when the energy is greater, however when the energy is less then 2,000,000 the redstone signal doesn't turn off. We are unsure if it becuase the program isn't repeating, which we tried to stick a repeat in however it just errored.
cell = peripheral.wrap("left")
energy = cell.getEnergystored("left")
while true do
if energy > 2000000
then sleep(1)
redstone.setOutput("right", true)
else sleep(1)
redstone.setOutput("right", false)
end
end
Thanks in advance.