Posted 10 June 2012 - 12:26 PM
I am trying to create a auto-crafting system and i am currently having a small problem with this code
every time i run this script i keep getting
torch:21: attempt to index ? (a nil value)
please help
Spoiler
version = "v0.1"
function homescreen()
term.clear()
term.setCursorPos(1,1)
print(string.rep("*", 47))
term.setCursorPos(1,10)
end
function getInput(intype, character)
write(intype)
amount = read(character)
return amount
end
function home()
homescreen()
print("How many do you want to make?")
amount = getInput("Amount: ")
if amount <= "4" then
rs.setBundledOutput("left", color.white)
rs.setBundledOutput("left", color.black)
sleep(1)
rs.setBundledOutput("left", 0)
shell.run(Auto-Workbench)
elseif amount >= "5" and amount <= "8" then
rs.setBundledOutput("left", color.white)
rs.setBundledOutput("left", color.black)
sleep(2)
rs.setBundledOutput("left", 0)
shell.run(Auto-Workbench)
elseif amount >= "9" and amount <= "12" then
rs.setBundledOutput("left", color.white)
rs.setBundledOutput("left", color.black)
sleep(1)
rs.setBundledOutput("left", 0)
shell.run(Auto-Workbench)
elseif amount >= "13" and amount <= "16" then
rs.setBundledOutput("left", color.white)
rs.setBundledOutput("left", color.black)
sleep(1)
rs.setBundledOutput("left", 0)
shell.run(Auto-Workbench)
end
end
home()
every time i run this script i keep getting
torch:21: attempt to index ? (a nil value)
please help