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

Program - Program error

Started by True_Dictionary, 24 February 2013 - 03:43 AM
True_Dictionary #1
Posted 24 February 2013 - 04:43 AM
Title: Program - Program error

My xp farm program for my ftb singleplayer is geting an error and i have look all over the forums with no luck, so i decided to ask a pro and see if i can get help.

*error* - bios:338: [string "mobspanwer"]:8: '(' expected

and here is the program, pretty basic.

function attack()
turtle.attack()
check()
sleep(.1)
end

function check
if turtle.getItemCount(16) > 0 then
for i = 1, 16 do
turtle.select(i)
turtle.dropDown
end

turtle.select(1)
end



i literally just started using turtles and writing scripts so please criticize so i can learn from my mistakes
SuicidalSTDz #2
Posted 24 February 2013 - 10:31 AM
You did not make the function correctly:

function attack()
turtle.attack()
check()
sleep(.1)
end
function check()
if turtle.getItemCount(16) > 0 then
for i = 1, 16 do
turtle.select(i)
turtle.dropDown
end
turtle.select(1)
end

function check should be function check() Functions must be enclosed with parenthesis to indicate the call.

The next error will be on line 10
You must close the line with parenthesis like so:
turtle.dropDown()