Skip to main content
replaced http://gaming.stackexchange.com/ with https://gaming.stackexchange.com/
Source Link

I'm using this code from How do I detect if MFSU has half below energyHow do I detect if MFSU has half below energy, from an answeran answer about half way down the page:

mfe = peripheral.wrap("left")
while true do
  euPercent = mfe.getEUStored() / mfe.getEUCapacity()
  if euPercent==1 then
    redstone.setOutput("right", false)
  elseif euPercent<=.5 then
    redstone.setOutput("right", true)
  end
  sleep(1)
end

This is so that I can have my computer turn off my nuclear reactor when it's full of power and on when it's not full, but when I run the program it says

reactor:3: attempt to index ? (a nil value)

I'm using this code from How do I detect if MFSU has half below energy, from an answer about half way down the page:

mfe = peripheral.wrap("left")
while true do
  euPercent = mfe.getEUStored() / mfe.getEUCapacity()
  if euPercent==1 then
    redstone.setOutput("right", false)
  elseif euPercent<=.5 then
    redstone.setOutput("right", true)
  end
  sleep(1)
end

This is so that I can have my computer turn off my nuclear reactor when it's full of power and on when it's not full, but when I run the program it says

reactor:3: attempt to index ? (a nil value)

I'm using this code from How do I detect if MFSU has half below energy, from an answer about half way down the page:

mfe = peripheral.wrap("left")
while true do
  euPercent = mfe.getEUStored() / mfe.getEUCapacity()
  if euPercent==1 then
    redstone.setOutput("right", false)
  elseif euPercent<=.5 then
    redstone.setOutput("right", true)
  end
  sleep(1)
end

This is so that I can have my computer turn off my nuclear reactor when it's full of power and on when it's not full, but when I run the program it says

reactor:3: attempt to index ? (a nil value)
added 198 characters in body; edited tags; update code per comments
Source Link
SevenSidedDie
  • 33.4k
  • 17
  • 105
  • 170

ImI'm using thethis code from How do I detect if MFSU has half below energy, from an answer about half way down the page:

mfe = peripheral.wrap("side""left")
while true do
  euPercent = mfe.getEUStored() / mfe.getEUCapacity()
  if euPercent==1 then
    redstone.setOutput("side""right", false)
  elseif euPercent<=.5 then
    redstone.setOutput("side""right", true)
  end
  sleep(1)
end

This is so that iI can have my computer turn off my nuclear reactor when itsit's full onof power and on when itsit's not full, but when i try andI run the program it says "reactor:3: attempt to index ? (a nil value)

reactor:3: attempt to index ? (a nil value)

Im using the code

mfe = peripheral.wrap("side")
while true do
  euPercent = mfe.getEUStored() / mfe.getEUCapacity()
  if euPercent==1 then
    redstone.setOutput("side", false)
  elseif euPercent<=.5 then
    redstone.setOutput("side", true)
  end
  sleep(1)
end

This is so that i can have my computer turn off my nuclear reactor when its full on power and on when its not full but when i try and run the program it says "reactor:3: attempt to index ? (a nil value)

I'm using this code from How do I detect if MFSU has half below energy, from an answer about half way down the page:

mfe = peripheral.wrap("left")
while true do
  euPercent = mfe.getEUStored() / mfe.getEUCapacity()
  if euPercent==1 then
    redstone.setOutput("right", false)
  elseif euPercent<=.5 then
    redstone.setOutput("right", true)
  end
  sleep(1)
end

This is so that I can have my computer turn off my nuclear reactor when it's full of power and on when it's not full, but when I run the program it says

reactor:3: attempt to index ? (a nil value)
added 42 characters in body
Source Link
alexanderpas
  • 17.6k
  • 17
  • 88
  • 136

Im using the code mfe = peripheral.wrap("side") while true do euPercent = mfe.getEUStored() / mfe.getEUCapacity() if euPercent==1 then redstone.setOutput("side", false) elseif euPercent<=.5 then redstone.setOutput("side", true) end sleep(1) end

mfe = peripheral.wrap("side")
while true do
  euPercent = mfe.getEUStored() / mfe.getEUCapacity()
  if euPercent==1 then
    redstone.setOutput("side", false)
  elseif euPercent<=.5 then
    redstone.setOutput("side", true)
  end
  sleep(1)
end

This is so that i can have my computer turn off my nuclear reactor when its full on power and on when its not full but when i try and run the program it says "reactor:3: attempt to index ? (a nil value)

Im using the code mfe = peripheral.wrap("side") while true do euPercent = mfe.getEUStored() / mfe.getEUCapacity() if euPercent==1 then redstone.setOutput("side", false) elseif euPercent<=.5 then redstone.setOutput("side", true) end sleep(1) end

This is so that i can have my computer turn off my nuclear reactor when its full on power and on when its not full but when i try and run the program it says "reactor:3: attempt to index ? (a nil value)

Im using the code

mfe = peripheral.wrap("side")
while true do
  euPercent = mfe.getEUStored() / mfe.getEUCapacity()
  if euPercent==1 then
    redstone.setOutput("side", false)
  elseif euPercent<=.5 then
    redstone.setOutput("side", true)
  end
  sleep(1)
end

This is so that i can have my computer turn off my nuclear reactor when its full on power and on when its not full but when i try and run the program it says "reactor:3: attempt to index ? (a nil value)

Source Link
Loading