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

Error code "multiple points" from turtle API

Started by LiefZifer, 09 December 2016 - 11:45 PM
LiefZifer #1
Posted 10 December 2016 - 12:45 AM

--mineShaft
--V0.1
--Prompt for area
print("Distance Forward: (Blank for 16)")
vGoalF = tonumber(read())
if vGoalF == nil then vGoalF = 16 end
print("Distance Right: (Blank for 16)")
vGoalR = tonumber(read())
if vGoalR == nil then vGoalR = 16 end
print(vGoalF*vGoalR*2.." total blocks will be destroyed.")
function forward()
vTravelF = 0
while vGoalF > vTravelF do
  if turtle.forward() then vTravelF = vTravelF + 1
   else turtle.dig() turtle.suck() turtle.forward()
	vTravelF = vTravelF + 1
  end
  if turtle.up() then
   else turtle.digUp() turtle.suckUp() turtle.up()
  end

  if turtle.forward() then vTravelF = vTravelF + 1
   else turtle.dig() turtle.suck() turtle.forward()
	vTravelF = vTravelF + 1
  end

  if turtle.down() then
   else turtle.digDown() turtle.suckDown() turtle.down()
  end
end
end --forward()
vTravelR = 0
while vGoalR > vTravelR do
forward()
vTravelR = (vTravelR + 1)
turtle.turnRight()
turtle.turnRight()

forward()
vTravelR = (vTravelR + 1)
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
end
--

My lines

vTravelR = (vTravelR + 1)
used to be

vTravel = (vTravelR + 1)
and it was causing a logic error. Changing it to vTravelR caused the "multiple points" error.

I'm relatively new to ComputerCraft, but I've done quite a bit of messing around on my own. I'm stumped on this, and I don't see anything wrong with it. Anyone able to shed some light on it?
Lyqyd #2
Posted 10 December 2016 - 04:33 AM
The print statement with vGoalR*2.. needs parentheses around the mathematic expression, or you need to change the order so the number isn't adjacent to the concatenation operator.
LiefZifer #3
Posted 10 December 2016 - 05:00 AM
The print statement with vGoalR*2.. needs parentheses around the mathematic expression, or you need to change the order so the number isn't adjacent to the concatenation operator.

Thank you very much! I heard somewhere that parentheses should be used all the time, even when unnecessary, just to be sure. I'm gonna start doing that.