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

Line 22 expected "="

Started by techmach, 09 January 2013 - 11:13 PM
techmach #1
Posted 10 January 2013 - 12:13 AM
WRONG SECTION SORRY I OPENED THE ASK A PRO TAB AND THE TUTORIAL TAB. CLICKED THE WRONG ONE. SORRY! D:

http://pastebin.com/XW5C4SGz

Just wrote the above treetap program only to find out that it dosent work D:
It gives me the following error:
bios: 338: [string "treetap"] :22: '=' expected

I've spent quite some time checking my code again and again, I really dont see why the system tells me a '=' is expected at line 22, which is just calling up a turtle.dig() function.

D:
Heracles421 #2
Posted 10 January 2013 - 04:04 AM
WRONG SECTION SORRY I OPENED THE ASK A PRO TAB AND THE TUTORIAL TAB. CLICKED THE WRONG ONE. SORRY! D:

http://pastebin.com/XW5C4SGz

Just wrote the above treetap program only to find out that it dosent work D:
It gives me the following error:
bios: 338: [string "treetap"] :22: '=' expected

I've spent quite some time checking my code again and again, I really dont see why the system tells me a '=' is expected at line 22, which is just calling up a turtle.dig() function.

D:
Line 21, you're missing () at the end of turtle.turnRight

Fixed your code:

function tappo()
  for i = 1,2 do
    for i = 1,7 do
      turtle.dig()
      turtle.up()
    end
    turtle.dig()
    turtle.turnLeft()
    turtle.forward()
    turtle.turnRight()
    turtle.forward()
    turtle.turnRight()
    for i = 1,7 do
      turtle.down()
      turtle.dig()
    end
    turtle.turnLeft()
    turtle.forward()
    turtle.turnRight()
    turtle.forward()
    turtle.turnRight()
  end
end

function t.forward(blocks)
  blocks = blocks or 1
  for i = 1,blocks do
    turtle.forward()
  end
end

function t.backward(blocks)
  blocks = blocks or 1
  for i = 1,blocks do
    turtle.backward()
  end
end

function t.turnRight(blocks)
  blocks = blocks or 1
  for i = 1,blocks do
    turtle.turnRight()
  end
end

function t.turnLeft(blocks)
  blocks = blocks or 1
  for i = 1,blocks do
    turtle.turnLeft()
  end
end

t.forward(2)
tappo()
t.turnRight(2)
turtle.forward()
tappo()
for i = 1,3 do
  turtle.turnRight()
  t.forward(3)
  turtle.turnLeft()
  tappo()
end
for i = 1,3 do
  t.turnRight(2)
  turtle.forward()
  tappo()
end
turtle.turnRight()
t.forward(3)
turtle.turnLeft()
tappo()
turtle.turnLeft()
t.forward(8)
turtle.turnRight()
t.forward(6)
turtle.turnLeft()
turtle.drop()
t.turnRight(2)
KaoS #3
Posted 10 January 2013 - 09:07 PM
if you want to move a post report it and in the report field ask to have it moved
techmach #4
Posted 10 January 2013 - 09:43 PM
thanks! =D didnt notice that =D
WRONG SECTION SORRY I OPENED THE ASK A PRO TAB AND THE TUTORIAL TAB. CLICKED THE WRONG ONE. SORRY! D: http://pastebin.com/XW5C4SGz Just wrote the above treetap program only to find out that it dosent work D: It gives me the following error: bios: 338: [string "treetap"] :22: '=' expected I've spent quite some time checking my code again and again, I really dont see why the system tells me a '=' is expected at line 22, which is just calling up a turtle.dig() function. D:
Line 21, you're missing () at the end of turtle.turnRight Fixed your code:
 function tappo()   for i = 1,2 do     for i = 1,7 do       turtle.dig()       turtle.up()     end     turtle.dig()     turtle.turnLeft()     turtle.forward()     turtle.turnRight()     turtle.forward()     turtle.turnRight()     for i = 1,7 do       turtle.down()       turtle.dig()     end     turtle.turnLeft()     turtle.forward()     turtle.turnRight()     turtle.forward()     turtle.turnRight()   end end function t.forward(blocks)   blocks = blocks or 1   for i = 1,blocks do     turtle.forward()   end end function t.backward(blocks)   blocks = blocks or 1   for i = 1,blocks do     turtle.backward()   end end function t.turnRight(blocks)   blocks = blocks or 1   for i = 1,blocks do     turtle.turnRight()   end end function t.turnLeft(blocks)   blocks = blocks or 1   for i = 1,blocks do     turtle.turnLeft()   end end t.forward(2) tappo() t.turnRight(2) turtle.forward() tappo() for i = 1,3 do   turtle.turnRight()   t.forward(3)   turtle.turnLeft()   tappo() end for i = 1,3 do   t.turnRight(2)   turtle.forward()   tappo() end turtle.turnRight() t.forward(3) turtle.turnLeft() tappo() turtle.turnLeft() t.forward(8) turtle.turnRight() t.forward(6) turtle.turnLeft() turtle.drop() t.turnRight(2) 
where is the report field? o.0 thanks though.
if you want to move a post report it and in the report field ask to have it moved
theoriginalbit #5
Posted 10 January 2013 - 09:55 PM
where is the report field? o.0 thanks though.

beside the MultiQuote button