Jump to content




neeed help on this code

turtle computer command

97 replies to this topic

#81 jdanner95

  • Members
  • 57 posts
  • LocationUS

Posted 21 November 2016 - 07:15 PM

it looks like this
Posted Image

#82 Dog

  • Members
  • 1,179 posts
  • LocationEarth orbit

Posted 21 November 2016 - 07:31 PM

It looks OK. Like I said, if you can't get the GPS cluster working right, try using the script I included in my last post. I recommend using a mining turtle so you only need one disk drive. The advantage to that script is that it will setup your cluster automatically - all you have to do is provide correct starting coordinates and it handles the rest.

Having said that, it shouldn't be too hard to stand on each computer, use F3 (subtracting one for the Y value), and get them all running right.

#83 jdanner95

  • Members
  • 57 posts
  • LocationUS

Posted 21 November 2016 - 07:31 PM

View PostDog, on 21 November 2016 - 06:55 PM, said:

FWIW, you don't need to be good at math to copy the numbers from F3 to the turtle. What does your GPS cluster look like? Is it staggered like the wiki recommends (2 high, 2 low) or are they all on the same level?

If you continue to have problems with your GPS cluster, then I'd recommend you disassemble it and rebuild it using this script.
I am going to give the script a try and I am going to see if that works

#84 jdanner95

  • Members
  • 57 posts
  • LocationUS

Posted 21 November 2016 - 08:37 PM

it looks like its getting the gps cluster right


Posted Image


here it is with the f3 screen while I am on the turtle after I have loacted it

Posted Image

#85 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 22 November 2016 - 12:48 AM

View Postjdanner95, on 21 November 2016 - 08:37 PM, said:

it looks like its getting the gps cluster right

That's still wrong. You got y as 68, when 67 was expected.

View PostDog, on 21 November 2016 - 06:55 PM, said:

If you continue to have problems with your GPS cluster, then I'd recommend you disassemble it and rebuild it using this script.

That still requires jdanner95 to supply the turtle's initial position... and apparently he can't interpret the co-ords on the debug screen in order to do that. :/

Again, jdanner95, stand directly on top of the turtle, you round all the values down (remembering that negative numbers round further away from 0), and that's it.

If you're reading the debug co-ords to locate a computer, you cannot stand inside the same block as you can with a turtle (computers are a perfect block shape, turtles are slightly shorter) - meaning you need to subtract a further 1 from the y co-ord the debug screen shows you, as you're standing in the block above. With a turtle you just round the y co-ord down, same as all the other values.

For example, in your last screenshot, the debug screen shows that the turtle is located at -200, 67, 256.

#86 jdanner95

  • Members
  • 57 posts
  • LocationUS

Posted 22 November 2016 - 03:12 AM

View PostBomb Bloke, on 22 November 2016 - 12:48 AM, said:

View Postjdanner95, on 21 November 2016 - 08:37 PM, said:

it looks like its getting the gps cluster right
That's still wrong. You got y as 68, when 67 was expected.

View PostDog, on 21 November 2016 - 06:55 PM, said:

If you continue to have problems with your GPS cluster, then I'd recommend you disassemble it and rebuild it using this script.
That still requires jdanner95 to supply the turtle's initial position... and apparently he can't interpret the co-ords on the debug screen in order to do that. :/
Again, jdanner95, stand directly on top of the turtle, you round all the values down (remembering that negative numbers round further away from 0), and that's it.
If you're reading the debug co-ords to locate a computer, you cannot stand inside the same block as you can with a turtle (computers are a perfect block shape, turtles are slightly shorter) - meaning you need to subtract a further 1 from the y co-ord the debug screen shows you, as you're standing in the block above. With a turtle you just round the y co-ord down, same as all the other values.
For example, in your last screenshot, the debug screen shows that the turtle is located at -200, 67, 256.
so you are saying instead of standing on the computers just stay in front of them right and do the debug screen like if one computer is -200 and the y is 253 it would be 252 meaning like this -200,252,253

#87 Dog

  • Members
  • 1,179 posts
  • LocationEarth orbit

Posted 22 November 2016 - 03:15 AM

No, stand on top of the computer and subtract one from the y value. If you were at -200, 253, 253, then you'd input -200, 252, 253.

#88 jdanner95

  • Members
  • 57 posts
  • LocationUS

Posted 22 November 2016 - 04:21 AM

View PostDog, on 22 November 2016 - 03:15 AM, said:

No, stand on top of the computer and subtract one from the y value. If you were at -200, 253, 253, then you'd input -200, 252, 253.
ok will I just said -200 252 253 but I work more on it tomorrow thank you

#89 jdanner95

  • Members
  • 57 posts
  • LocationUS

Posted 22 November 2016 - 03:29 PM

I think I have gotten it now

Posted Image


Posted Image

#90 Dog

  • Members
  • 1,179 posts
  • LocationEarth orbit

Posted 22 November 2016 - 03:42 PM

You're close, but you didn't round down on x (which should be 199, not 200) - that's my fault, I gave you the wrong numbers in my last post - apologies. Remember, you have to round down all values, not round up.

#91 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 22 November 2016 - 03:46 PM

Actually all the numbers are correct this time around; -199.72769 indeed floors to -200.

Edited by Bomb Bloke, 22 November 2016 - 03:47 PM.


#92 jdanner95

  • Members
  • 57 posts
  • LocationUS

Posted 22 November 2016 - 04:23 PM

View PostBomb Bloke, on 22 November 2016 - 03:46 PM, said:

Actually all the numbers are correct this time around; -199.72769 indeed floors to -200.
ya finely lol now I need to get the turtle to mine in the area that I want it to go to but that is still a problem because I can send it to the area but it wont go back after it gets to the to home and unload its stuff it don't go back to the area to quarry again from where it started do I need to move the gps code down to the end of the code or do I need to do something else to the code?
here is the code just in case you need to see it again
http://pastebin.com/4z3qZKb0
and yes it uses the manger to tell it where it should quarry here is the that code too
http://pastebin.com/TGsEffzC

Edited by jdanner95, 22 November 2016 - 04:24 PM.


#93 Dog

  • Members
  • 1,179 posts
  • LocationEarth orbit

Posted 22 November 2016 - 04:32 PM

I can't see any reason in your code why your turtle is not properly returning to it's last position after dumping it's inventory. As far as can tell, moving the code around won't fix the problem. I'll spend some time today reviewing the code again and try to figure out why it's behaving the way you describe. Maybe Bomb Bloke or somebody will see something I'm missing in the mean time.

#94 jdanner95

  • Members
  • 57 posts
  • LocationUS

Posted 22 November 2016 - 04:57 PM

View PostDog, on 22 November 2016 - 04:32 PM, said:

I can't see any reason in your code why your turtle is not properly returning to it's last position after dumping it's inventory. As far as can tell, moving the code around won't fix the problem. I'll spend some time today reviewing the code again and try to figure out why it's behaving the way you describe. Maybe Bomb Bloke or somebody will see something I'm missing in the mean time.
ok thanks I mean it could be that the manger code is wrong but I might have to do more testing with that cause I am not sure ether for that cause the manger is the one that tells the turtle where to go quarry and it it ment to tell 10 turtles to mine in a big area with out hiting each other, but see It seems to not be working but I am not sure on that until I test it or just it could be my f3 debug is wrong with the area too

Edited by jdanner95, 22 November 2016 - 05:11 PM.


#95 jdanner95

  • Members
  • 57 posts
  • LocationUS

Posted 22 November 2016 - 07:47 PM

it got the area and started minning like it should :)

Posted Image now to see if it will return here after unloading its things

#96 jdanner95

  • Members
  • 57 posts
  • LocationUS

Posted 22 November 2016 - 07:53 PM

it works now thank you all who have helped me now I just to figure out a way to get it to move the next job once its done with that area and go on to a new area with the manger to mange more turtlles other then that it works its not perfect tut I am happy it works :) thanks again all
one thing I want to know is how can I program to where the trutle can refuel and go on quarrying instead of canceling the program and having to redo his job again

Edited by jdanner95, 22 November 2016 - 08:49 PM.


#97 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 22 November 2016 - 09:34 PM

View Postjdanner95, on 22 November 2016 - 07:53 PM, said:

one thing I want to know is how can I program to where the trutle can refuel and go on quarrying instead of canceling the program and having to redo his job again

Make a function which checks the turtle fuel level, if it's low then search the inventory for a fuel item and consume it. I would call this function before every time I move.

#98 jdanner95

  • Members
  • 57 posts
  • LocationUS

Posted 23 November 2016 - 01:20 PM

View PostLupus590, on 22 November 2016 - 09:34 PM, said:

View Postjdanner95, on 22 November 2016 - 07:53 PM, said:

one thing I want to know is how can I program to where the trutle can refuel and go on quarrying instead of canceling the program and having to redo his job again

Make a function which checks the turtle fuel level, if it's low then search the inventory for a fuel item and consume it. I would call this function before every time I move.
ok cool I should do that and I should note my goal is to get it to where the manger and the turtle will pick the areas and quarry out without me inputing them in to the manger and the other goal is to get a other turtle quarry in a other area but I don't know if there is a way to make the manger do that. For now at least it works
thanks to all ya
jdanner95





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users