Posted 11 December 2013 - 05:07 AM
Hi there,
I am trying to build my own goto script and clash on the first issue, the variables x,y and z are not being saved trough the gps.locate() command. I have set up a satelite with 4 computers and my turtle can easily find its correct position when I type gps locate.
Here is the code:
local tArgs = {…}
local xCoord = tArgs[1]
local yCoord = tArgs[2]
local zCoord = tArgs[3]
x = 0
y = 0
z = 0
local function getPos()
gps.locate(5)
end
x,y,z = getPos()
print(x, y, z)
instead of printing out the x,y and z it prints nothing! What did I do wrong? Btw I'm on Minecraft 1.5 and am using Direwolf20 Pack 1.5.2.
Any help would be most apreciated! Thank you!
igel :)/>
I am trying to build my own goto script and clash on the first issue, the variables x,y and z are not being saved trough the gps.locate() command. I have set up a satelite with 4 computers and my turtle can easily find its correct position when I type gps locate.
Here is the code:
Spoiler
rednet.open("right")local tArgs = {…}
local xCoord = tArgs[1]
local yCoord = tArgs[2]
local zCoord = tArgs[3]
x = 0
y = 0
z = 0
local function getPos()
gps.locate(5)
end
x,y,z = getPos()
print(x, y, z)
instead of printing out the x,y and z it prints nothing! What did I do wrong? Btw I'm on Minecraft 1.5 and am using Direwolf20 Pack 1.5.2.
Any help would be most apreciated! Thank you!
igel :)/>