Jump to content




Line 22 expected "="



4 replies to this topic

#1 techmach

  • Members
  • 3 posts

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:

#2 Heracles421

  • Members
  • 258 posts

Posted 10 January 2013 - 04:04 AM

View Posttechmach, on 10 January 2013 - 12:13 AM, said:

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)


#3 KaoS

    Diabolical Coder

  • Members
  • 1,510 posts
  • LocationThat dark shadow under your bed...

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

#4 techmach

  • Members
  • 3 posts

Posted 10 January 2013 - 09:43 PM

thanks! =D didnt notice that =D

View PostHeracles421, on 10 January 2013 - 04:04 AM, said:

View Posttechmach, on 10 January 2013 - 12:13 AM, said:

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.

View PostKaoS, on 10 January 2013 - 09:07 PM, said:

if you want to move a post report it and in the report field ask to have it moved


#5 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 10 January 2013 - 09:55 PM

View Posttechmach, on 10 January 2013 - 09:43 PM, said:

where is the report field? o.0 thanks though.

beside the MultiQuote button





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users