The error code I am getting is as follows:
farm9x9:12: bios:14: [string "refuel"]:8: unexpected symbol
Here is the pastebin of the farm9x9 (main) file in question: http://pastebin.com/mQkvff7G
Here is the pastebin of the refuel file: http://pastebin.com/z3dmLu3L
I've tried changing the way that I have the fuel level passed into the "function" file with no change, so help please?
Raw Code:
Spoiler
--@Author: Zach Combs aka TehNoiseBomb
--@Version: 1.2
local inputs = {...}
local crop, seed, fullyGrown, sleepTime --variables passed in (inputs)
local moveLine = assert(loadfile("moveLine")) --Load the moveLine code as a variable that can be called as a function
local nextRow = assert(loadfile("nextRow")) --Load the nextRow code as a variable that can be called as a function
local moveHome = assert(loadfile("moveHome")) --Load the moveHome code as a variable that can be called as a function
local getSeed = assert(loadfile("getSeed")) --Load the getSeed code as a variable that can be called as a function
local itemDump = assert(loadfile("itemDump")) --Load the itemDump code as a variable that can be called as a function
local refuel = assert(loadfile("refuel")) --Load the refuel code as a variable that can be called as a function
local east = true --boolean flag determining if the turtle is facing east(true) or west(false) -> You can check in F3 mode, when placed the turtle is facing the same way as the player
local seedData = getSeed() --Get the data about the seed in the turtle's inventory
local fuelLevel = turtle.getFuelLevel() --Get the amount of fuel the turtle has
--Assign passed in variables here
--'k' is the number, 'v' is the variable
for k, v in pairs(inputs) do
if k == 1 then crop = v end
if k == 2 then seed = v end
if k == 3 then fullyGrown = v end
if k == 4 then sleepTime = v end
end
print("Working on crop: ", crop)
print("Working with seed: ", seed)
--While the turtle has fuel, repeat the following steps:
-- Print the amount of fuel the turtle has
-- Reset the turning flag to true
-- Get how much fuel the turtle has
-- If the turtle has seeds in it's inventory:
-- Move through the first row and get how many seeds the turtle has in it's inventory
-- Starting in the first row, repeat eight times:
-- Move to the next row on the right and get set the new orientation to the east slag
-- Move through the row and get how many seeds the turtle has in it's inventory
-- Move to the home position
-- Move to the chest, dump excess inventory and transfer the seeds to the first slot in the turtle's inventory
-- Move to the fuel chest and refuel
-- Get how much fuel the turtle has
-- Sleep for the passed in amount of time
while fuelLevel > 0 do
print("Fuel left... ", fuelLevel)
east = true
fuelLevel = turtle.getFuelLevel()
if seedData.count > 0 then
seedData = moveLine(crop, seed, fullyGrown)
for i = 0, 7 do
east = nextRow(east)
seedData = moveLine(crop, seed, fullyGrown)
end
moveHome()
seedData = itemDump(seedData)
fuelLevel = refuel(fuelLevel)
end
os.sleep(sleepTime)
end
Edit: added link to refuel pastebin (my bad)