Posted 23 December 2014 - 12:37 AM
i'm programming a farming turtle for 2 different crop that grow in a way similar to cactus and sugar canes
i'm playing with gps function from previous versions of cc (maybe mc 1.5.2? i don't remember cc version), and now i see cc 1.6.5 gps localization (using old gps tower setup) is less accurate and final coordinations changes when i reload the world.
i'm programming a farming turtle for 2 different crop that grow in a way similar to cactus and sugar canes
maybe i make something wrong with this version (gps tower setup is changed?), but i found a way to bypass the problem.
if i use the string
local x, y, z = gps.locate(5)
the "world reload issue" is bypassed (actually i set the home position manually in the code).
unfortunely the turtle "forget" the coordinate when i call the "gohome" function
function gohome()
term.clear()
write("Positioning…")
shell.run("moveto", x,y,z) – actually x,y,z are numeric coordinates but i need use the cordinates given by the gps.locate(5) command
turtle.back() – this line and the next are to face the turtle correctly (there is a way to turn the turtle to the choosen direction?)
shell.run("moveto", x,y,z) – "moveto" script can be found here and it is not written by me (it moves the turtle to specific coordinates. i accept suggestions about a better way to do that)
term.setCursorPos(1,2)
term.write("I'm at home")
sleep(2)
end
there is the question:
so i want to create a file from the gps.locate() command results and call it to read the coordinates but i don't know how to do that.
i saw something similar in a script to control the turtle with an xbox controller but is not enough similar to what i need. i'm not so good with programming, i can read and understand what a script does but not modify it. i just copy and paste strings and make them works each other (sorry i can't explain better).
so what i need is:
launch gps.locate(5) and write a file called xyz with the result in the turtle memory
the turtle execute its job
by the "gohome" function the script run "moveto" and read x,y,z from the xyz file
sorry for the confused explanation, english is not my language.
P.S. i know some things are canged from older versions and many old script fails. idk if "moveto" is one of them so i recognize my problem in a less accurate gps localization. can somebody check that script or suggest me an alternative that works better?
thanks to everybody who wil answer me
i'm playing with gps function from previous versions of cc (maybe mc 1.5.2? i don't remember cc version), and now i see cc 1.6.5 gps localization (using old gps tower setup) is less accurate and final coordinations changes when i reload the world.
i'm programming a farming turtle for 2 different crop that grow in a way similar to cactus and sugar canes
maybe i make something wrong with this version (gps tower setup is changed?), but i found a way to bypass the problem.
if i use the string
local x, y, z = gps.locate(5)
the "world reload issue" is bypassed (actually i set the home position manually in the code).
unfortunely the turtle "forget" the coordinate when i call the "gohome" function
function gohome()
term.clear()
write("Positioning…")
shell.run("moveto", x,y,z) – actually x,y,z are numeric coordinates but i need use the cordinates given by the gps.locate(5) command
turtle.back() – this line and the next are to face the turtle correctly (there is a way to turn the turtle to the choosen direction?)
shell.run("moveto", x,y,z) – "moveto" script can be found here and it is not written by me (it moves the turtle to specific coordinates. i accept suggestions about a better way to do that)
term.setCursorPos(1,2)
term.write("I'm at home")
sleep(2)
end
there is the question:
so i want to create a file from the gps.locate() command results and call it to read the coordinates but i don't know how to do that.
i saw something similar in a script to control the turtle with an xbox controller but is not enough similar to what i need. i'm not so good with programming, i can read and understand what a script does but not modify it. i just copy and paste strings and make them works each other (sorry i can't explain better).
so what i need is:
launch gps.locate(5) and write a file called xyz with the result in the turtle memory
the turtle execute its job
by the "gohome" function the script run "moveto" and read x,y,z from the xyz file
sorry for the confused explanation, english is not my language.
P.S. i know some things are canged from older versions and many old script fails. idk if "moveto" is one of them so i recognize my problem in a less accurate gps localization. can somebody check that script or suggest me an alternative that works better?
thanks to everybody who wil answer me