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

startup: 1: attempt to call nil

Started by MrBn100ful, 17 May 2015 - 03:54 PM
MrBn100ful #1
Posted 17 May 2015 - 05:54 PM
startup: 1: attempt to call nil

My program


reactor = peripheral.warp("back")
cube = peripheral.warp("left")
actif = reactor.getActive()
maxCube = cube.getMaxEnergy()
while true do
 
  energystore = cube.getStored()
  level = (energystore*100)/maxCube
 
  if actif then
    if level >= 99 then reactor.setActive(false) end
   else
	 if level <= 10 then reactor.setActive(true) end
    end
   
   
    sleep(1)
  end
Thank
Lyqyd #2
Posted 17 May 2015 - 06:08 PM
The correct spelling is peripheral.wrap, not peripheral.warp.
MrBn100ful #3
Posted 17 May 2015 - 06:18 PM
Thank guy :)/>
Waitdev_ #4
Posted 22 May 2015 - 01:24 PM
pro tip, always remember to check the spelling in any line that makes an error.
fishermedders #5
Posted 22 May 2015 - 06:55 PM
pro tip, always remember to check the spelling in any line that makes an error.

Very smart to do, and sometimes, there are functions that have the first word's letter lowercase and the second, third, etc in Uppercase. That used to trip me up alot.
Happy Computing!