This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
astonish01's profile picture

Help with my energy cell program "running low alarm"

Started by astonish01, 07 August 2014 - 09:45 PM
astonish01 #1
Posted 07 August 2014 - 11:45 PM
m = peripheral.wrap('top')
c = peripheral.wrap('left')
while true do
en = c.getEnergyStored('east')
m.clear()
m.setCursorPos(4,1)
m.write(en..' ')
if en<5000000
then redstone.setBundledOutput(right, colors.white)
else
sleep(0.5)
end
end

the name of the program is energy
it keeps saying " energy:9: Expected string, number

just like i wrote, i've looked in all the APIs and still didnt find nothing tht helpped me
Cranium #2
Posted 08 August 2014 - 12:00 AM
On line 9, it's expecting two things in the redstone.setBundledOutput() function, with is a string, then a number. You passed it a variable(which hadn't been defined) named right, and colors.white. Put quotations around the "right" and you should be fine.

On a slightly related note, which version of ComputerCraft are you using? If it's 1.6x, then you won't be able to use bundled cables.
astonish01 #3
Posted 08 August 2014 - 12:13 AM
On line 9, it's expecting two things in the redstone.setBundledOutput() function, with is a string, then a number. You passed it a variable(which hadn't been defined) named right, and colors.white. Put quotations around the "right" and you should be fine.

On a slightly related note, which version of ComputerCraft are you using? If it's 1.6x, then you won't be able to use bundled cables.

I know about the bundled cables, but im using rednet cables from MFR

Edit: Thank you, it worked fine
Edited on 07 August 2014 - 10:14 PM