Posted 14 October 2012 - 10:00 PM
Hello, I'm kinda new to computercraft but since I already program a bit in C++, Java and some other languages I though I should give it a try.
The program I made is a system to retrieve and deposit from multiple chest. When depositing it just sends everything to a sorting system so thats no problem. I set the program as the startup file so it should start autmoticaly but when I reboot my pc it says:
startup:2: attempt to index ? (a nil value)
Also, if there is a way to make it work beter than it would now than please tell me :)/>/>
Here is the program in pastebin: http://pastebin.com/0gE4TGMe
The program I made is a system to retrieve and deposit from multiple chest. When depositing it just sends everything to a sorting system so thats no problem. I set the program as the startup file so it should start autmoticaly but when I reboot my pc it says:
startup:2: attempt to index ? (a nil value)
Also, if there is a way to make it work beter than it would now than please tell me :)/>/>
Here is the program in pastebin: http://pastebin.com/0gE4TGMe
while true do
terminal.clear()
terminal.setCursorPos(1.1)
itemType = read()
if itemType == "ingots"then
print("clearing chest")
rs.setBundledOutput("back", color.gray)
sleep(40.0)
rs.setBundledOutput("back", colors.white)
elseif itemType == "special" then
print("clearing chest")
rs.setBundledOutput("back", color.gray)
sleep(40.0)
print("Getting the special items.")
rs.setBundledOutput("back", colors.orange)
elseif itemType == "crap" then
print("clearing chest")
rs.setBundledOutput("back", color.gray)
sleep(40.0)
print("Getting the converted crap.")
rs.setBundledOutput("back", colors.magenta)
elseif itemType == "ores"then
print("clearing chest")
rs.setBundledOutput("back", color.gray)
sleep(40.0)
print("Getting the ores.")
rs.setBundledOutput("back", colors.lightBlue)
elseif itemType == "rest" then
rs.setBundledOutput("back", color.gray)
sleep(40.0)
rs.setBundledOutput("back", colors.yellow)
print("Getting the 'rest' items.")
elseif itemType == "clear" then
print("clearing chest")
rs.setBundledOutput("back", color.gray)
sleep(40.0)
else
print("Available commands: ingots, clear, special, crap, ores and rest")
sleep(2.0)
terminal.clear()
end
rs.setBundledOutput("back", 0)
sleep(2.0)
terminal.clear()
end
The gray bundled cable is to deposit all the items and the other ones to get from certain chests.