Posted 10 March 2014 - 02:15 PM
I just started working on computercraft and going through some of the examples. I've setup a GPS and testing out some of the LUA language. Running into an issue.
From the tutorial I tried this
The last line bombs with attempt to index ? a nil value. So I guess it's null but yet I get values from the other variables if I print them out.
Is the tutorial outdated or did I miss something?
From the tutorial I tried this
local home = vector.new(5, 91, 478)
print("Home is "..home.x..", "..home.y..", "..home.z)
local position = vector.new(gps.locate(5))
print("position is "..position.x..", "..position.y..", "..position.z)
local displacement = position - home
print("displacement is "..displacement.x..", "..displacement.y..", "..displacement.z)
print("I am "..displacement.tostring().." away from home!!!")
The last line bombs with attempt to index ? a nil value. So I guess it's null but yet I get values from the other variables if I print them out.
Is the tutorial outdated or did I miss something?