Posted 15 September 2012 - 10:25 AM
I keep getting this error:
Here's the code:
test:17: attempt to perform arithmetic __sub on nil and number
Here's the code:
local tArgs = { ... }
if #tArgs == 3 then
local x,y,z
x = tonumber(tArgs[1])
y = tonumber(tArgs[2])
z = tonumber(tArgs[3])
print( ""..x..","..y..","..z )
os.sleep(1)
else
print( "blah" )
return
end
rednet.open("right")
local cx,cy,cz = gps.locate(2, true)
print( ""..cx..","..cy..","..cz )
x = x-cx
y = y-cy
z = z-cz
print( ""..x..","..y..","..z )