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

Working On An Automated Turtle Ore Processor, Need Help Resolving A Probably Basic Mistake.

Started by DZCreeper, 16 September 2013 - 06:48 PM
DZCreeper #1
Posted 16 September 2013 - 08:48 PM
I get the following when I try to run it:

bios:337: [string "orePlacer"]:5: '(' expected

If someone could let me know what I did wrong or maybe upload a fixed version, I would be grateful because to my eyes this should be working.


currentSlot = 1

function selectFull
	turtle.select(currentSlot)
	if turtle.getItemCount(currentSlot) == 0 then
		if currentSlot == 16 then
			turtle.select(1) and currentSlot == 1
		else
			currentSlot = currentSlot + 1
		end
		
	end
end


while true do
	if turtle.detectDown() == false then
		turtle.placeDown()
	end
	selectFull
	sleep(0.5)
end
Edited by
Lyqyd #2
Posted 16 September 2013 - 10:22 PM
Function declarations take the form:


function nameOfFunction()

Note the parentheses. You are missing those both when you declare your function, and when you call it in your while loop.
DZCreeper #3
Posted 16 September 2013 - 10:36 PM
Edit: Basic logic derp, got it working now. Thanks!