←  Wiki Discussion

ComputerCraft | Programmable Computers for Minecraft

»

Some typing errors on computercraft wiki

DarkEyeDragon's Photo DarkEyeDragon 17 May 2017

I was reading trough the GPS Self tracker guide and i kept getting the error: "then expected at line 10"

I havent used computercraft/lua in a while so I first didnt notice the flaw in the code. After a while I figured the != isn't used at all in lua.

So plz change this code on the wiki.:

from
function getLocation() -- return the location
if xPos != nil then
return xPos, yPos, zPos
elseif xPos == nil then
return nil
end
end
to

function getLocation() -- return the location
if xPos ~= nil then
return xPos, yPos, zPos
elseif xPos == nil then
return nil
end
end
Quote

Lyqyd's Photo Lyqyd 17 May 2017

Moved to Wiki Discussion.
Quote

Lupus590's Photo Lupus590 18 May 2017

Was going to fix it, but someone else did without commenting here.
Quote