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

bios:338: [string "haus"]:59: '=' expected

Started by Valmond, 06 February 2013 - 11:39 AM
Valmond #1
Posted 06 February 2013 - 12:39 PM
Hi,
my english isn't so good. My german is much better ^^
ehm..
have the same problem.
my turtle tells me: bios:338: [string "haus"]:59: '=' expected
Follow programm build a house. Isn't finish. I would test is, but is this error. Line 59 is
hoch = hoch + 1
Whats wrong in this line?
it's my first lua programm ^^

and sorry for my bad english ^^


local hoch = 0
local reihen = 0
local laenge = 12
local treppenslot = 11
local materialslot = 2
function baumstamm()
   turtle.select(1)
   turtle.placeDown()
   turtle.turnLeft()
   turtle.forward()
   turtle.select(materialslot)
end
function pruefen()
   if turtle.getItemCount(materialslot) < 1 then
	  materialslot = materialslot + 1
   turtle.select(materialslot)
	  turtle.placeDown()
	  turtle.forward()
   else
	  turtle.placeDown()
	  turtle.forward()
   end
end
function treppe()
   turtle.select(treppenslot)
   if turtle.getItemCount(treppenslot) < 1 then
	  treppenslot = treppenslot + 1
   turtle.select(treppenslot)
	  turtle.placeDown()
	  turtle.forward()
   else
	  turtle.placeDown()
	  turtle.forward()
   end
end
--Wände hochziehen******************
while hoch < 5 do
   baumstamm()
   --lange Hausseite
   for i = 1,18 do
	  pruefen()
   end
   baumstamm()
   --kurze Hausseite
   for i = 1,10 do
	  pruefen()
   end
   baumstamm()
   --lange Hausseite
   for i = 1,18 do
	  pruefen()
   end
   baumstamm()
   --kurze Hausseite
   for i = 1,10 do
	  pruefen()
   end
   turtle.up
   hoch = hoch + 1
   if hoch == 1 then
	  materialslot = 3
   end
end
--************************************
-- Dach*******************************
-- Erste Reihe mit Wand
turtle.turnLeft()
turtle.turnLeft()
while laenge > 0 do
treppe()
if laenge > 2 then
   turtle.select(materialslot)
   for i = 1,laenge do
	  prüfen()
   end
turtle.turnLeft()
turtle.turnLeft()  
treppe()
turtle.up()
laenge = laenge - 2
end
--********
--zum Start
turtle.turnLeft()
turtle.forward()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.down()
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.forward()
turtle.turnRight()
turtle.forward()
turtle.forward()
turtle.turnRight()
--*****
--Dachsims
for i = 1,5 do
   treppe()
   turtle.up()
end
treppe()
for i = 1,5 do
   turtle.down()
   turtle.forward()
end
turtle.turnLeft()
turtle.turnLeft()
for i = 1,5 do
   treppe()
   turtle.up()
end
treppe()
--*****
--zum Start
turtle.turnLeft()
turtle.forward()
turtle.forward()
turtle.turnLeft()
for i = 1,5 do
   turtle.down()
   turtle.forward()
end
turtle.turnLeft()
turtle.turnLeft()
--Dachboden
turtle.select(materialslot)
turtle.down()
turtle.forward()
while reihen < 18 do
for i = 1,10 do
   pruefen()
end
reihen = reihen + 1
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
turtle.forward()
for i = 1,10 do
   pruefen()
end
reihen = reihen + 1
turtle.turnRight()
turtle.forward()
turtle.turnRight()
turtle.forward()
end
Lyqyd #2
Posted 06 February 2013 - 01:48 PM
Split into new topic.

The problem is on the previous line. Change turtle.up to turtle.up(). Without the parentheses, it thinks you're trying to set a new value rather than calling the function.
theoriginalbit #3
Posted 06 February 2013 - 01:49 PM
line 58:
turtle.up
this is not how to call a function, you need () at the end.

turtle.up()

EDIT: Damn ninja'd
Valmond #4
Posted 07 February 2013 - 12:41 AM
ahh thx
to not see the forest for the trees