Jump to content




help!!! bios:337: [string "house.lua"]:135: '=' expected


  • You cannot reply to this topic
3 replies to this topic

#1 marmig0404

  • New Members
  • 1 posts
  • Locationantarctica

Posted 11 August 2013 - 09:07 PM

Title: help!!!
dunno what this means
bios:337: [string "house.lua"]:135: '=' expected
help?
here is the code
function refuel()
turtle.select(2)
turtle.refuel(all)
turtle.select(3)
turtle.refuel(all)
turtle.select(4)
turtle.refuel(all)
turtle.select(5)
turtle.refuel(all)
turtle.select(6)
turtle.refuel(all)
turtle.select(7)
turtle.refuel(all)
turtle.select(8)
turtle.refuel(all)
turtle.select(9)
turtle.refuel(all)
turtle.select(10)
turtle.refuel(all)
turtle.select(11)
turtle.refuel(all)
turtle.select(12)
turtle.refuel(all)
turtle.select(13)
turtle.refuel(all)
turtle.select(14)
turtle.refuel(all)
turtle.select(15)
turtle.refuel(all)
end

function middle1()
turtle.place()
turtle.up()
turtle.forward()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.turnRight()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.turnRight()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.turnRight()
turtle.turnRight()
turtle.up()
end

function middle2()
turtle.place()
turtle.up()
turtle.forward()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.turnRight()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.turnRight()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.turnRight()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.turnRight()
turtle.turnRight()
turtle.up()
end

function top1()
turtle.place()
turtle.up()
turtle.forward()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward
turtle.select(16)
turtle.placeDown()
turtle.turnRight()
turtle.forward()
turtle.turnRight()
end

function top2a()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward
turtle.placeDown()
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
end

function top2b()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward()
turtle.placeDown()
turtle.forward
turtle.placeDown()
turtle.turnRight()
turtle.forward()
turtle.turnRight()
end

function top()
top1
top2a
top2b
top2a
top2b
end

function middle()
middle1
middle2
end
function house1()
refuel
middle
refuel
top
end
house1
end
anyone?

#2 Bubba

    Use Code Tags!

  • Moderators
  • 1,142 posts
  • LocationRHIT

Posted 12 August 2013 - 08:09 AM

Split into new topic.

You are writing the names of the function but not calling them. To call a function, you must put a parentheses after it like this:
function someFunction()
  print("Stuff happens here")
end

--# Here is how to call a function
someFunction() -- # Notice the parentheses after the function


#3 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 12 August 2013 - 05:42 PM

It looks like you definitely need some loops. Read about them here

#4 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 13 August 2013 - 02:13 PM

First of
turt.refuel(all) --Don't think this works, But hey, I'm not using turtles so often
turtle.refuel() -- Will refuel all if it don't have an argument

Also you forgot to call your function by adding parantheses at the end there of your code where it is 'middle1' etc
Otherwise the program will think it's a variable and it wants it to be declared
local function hello()
 print("Hello World!")
end

hello -- This will error since it think it's a variable add '()' next to it and it will be a function call :D/>/>

And this is a better refuel function that uses a for loop
function refuel()
for i = 2,15 do
  turtle.select(i)
  turtle.refuel()
 end
end

So a for loop can basically have 3 arguments, A start value, a finish value and a increment/decrement value
for i = 60, 1, -1 do
 print(i)
 sleep(.8)
end
So this will start at 60 and decrease by 1 until it reaches 1 and then the loop is finished
But the 3rd argument is never needed if you want it to only increase by 1.

Hope this was of any help to you! ;)





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users