Posted 13 June 2015 - 10:11 AM
Pastebin ~ Test program (clean)
Pastebin ~ (OLD) Test program (don't mind the notes)
Computercraft: 1.73
EnderStorage: 1.7.10-1.4.7.33-universal
Survival Multiplayer
This program uses Enderchests to restock items, only one enderchest specifically by using setFrequency() to change between different enderchests. Slot 16 is where this chest goes.
When the program runs for the first time (turtle placed, chest put in inv) it runs until it hits line 33 in function restock() and returns an attempt to index ? error. if run for a second time afterwards, it runs perfectly fine without errors. Run it for a third time and it breaks again only because the turtle picked it up from the last run and in this run it placed it before setting the frequency.
setFrequency() works fine outside of the function with a table reference, a value, or an integer. As you can see, I've spent a while working on what the problem is or finding a work about. what ever it may be, it seems to not update until after the program runs a second time.
EDIT: I've cleaned up the code to help, and the lines before the function are to help figure out what the problem is. Except now the same thing is happening as before, but it breaks on line 10 now.
test:10: attempt to index ? (a nil value)
Here's a reference photo:
Pastebin ~ (OLD) Test program (don't mind the notes)
Computercraft: 1.73
EnderStorage: 1.7.10-1.4.7.33-universal
Survival Multiplayer
This program uses Enderchests to restock items, only one enderchest specifically by using setFrequency() to change between different enderchests. Slot 16 is where this chest goes.
When the program runs for the first time (turtle placed, chest put in inv) it runs until it hits line 33 in function restock() and returns an attempt to index ? error. if run for a second time afterwards, it runs perfectly fine without errors. Run it for a third time and it breaks again only because the turtle picked it up from the last run and in this run it placed it before setting the frequency.
setFrequency() works fine outside of the function with a table reference, a value, or an integer. As you can see, I've spent a while working on what the problem is or finding a work about. what ever it may be, it seems to not update until after the program runs a second time.
EDIT: I've cleaned up the code to help, and the lines before the function are to help figure out what the problem is. Except now the same thing is happening as before, but it breaks on line 10 now.
test:10: attempt to index ? (a nil value)
Here's a reference photo:
Edited on 13 June 2015 - 08:14 PM