Jump to content




[1.4] Add/Remove/Change some functions to more usbale


  • You cannot reply to this topic
14 replies to this topic

#1 Chlorek

  • New Members
  • 8 posts
  • LocationPoland

Posted 11 March 2012 - 10:10 AM

I have some ideas that should be great to be added in the future. I know if these changes appear, so many programs stop to work and they will need to update. However my ideas:
1. turtle.getPos()
Example:
local x,y,z
x,y,z = turtle.getPos() -- returns turtle position in X, Y, Z
2. Remove some functions and add params
That would be great, intead of:
turtle.select(1)
turtle.drop()
there should be:
-- remove this function turtle.select(1)
turtle.drop(1, 64) -- where 1 is slot and 64 is value how many items you want to drop
Same turtle.dig/up/down. There should be:
turtle.dig("down")
turtle.dig("up")
turtle.dig("front")
3. turtle.detect()
This function should return block ID, it's much more usable and will let to make more advenced programs
4. print()
This functions should not make new lines itself (I know there is another function to print), instead of this to go to the next line should be:
print("First Line!nLine no.2n...no.3")
print(" and again no.3")

Sorry for bad english, I am Polish, but I try to write correctly.
Thank you, Chlorek.

#2 Casper7526

    OG of CC

  • Members
  • 362 posts

Posted 11 March 2012 - 10:19 AM

View PostChlorek, on 11 March 2012 - 10:10 AM, said:

I have some ideas that should be great to be added in the future. I know if these changes appear, so many programs stop to work and they will need to update. However my ideas:
1. turtle.getPos()
Example:
local x,y,z
x,y,z = turtle.getPos() -- returns turtle position in X, Y, Z
2. Remove some functions and add params
That would be great, intead of:
turtle.select(1)
turtle.drop()
there should be:
-- remove this function turtle.select(1)
turtle.drop(1, 64) -- where 1 is slot and 64 is value how many items you want to drop
Same turtle.dig/up/down. There should be:
turtle.dig("down")
turtle.dig("up")
turtle.dig("front")
3. turtle.detect()
This function should return block ID, it's much more usable and will let to make more advenced programs
4. print()
This functions should not make new lines itself (I know there is another function to print), instead of this to go to the next line should be:
print("First Line!nLine no.2n...no.3")
print(" and again no.3")

Sorry for bad english, I am Polish, but I try to write correctly.
Thank you, Chlorek.

#1, it won't be like that, but we are hoping for a way to tell their relative position, return coords is kinda "magic"
#2, I agree drop could take a parameter on how many you wanna drop, select is there for another reason so it should stay.
#3, Not everyone's block id's are the same so if you wrote a program it might not be the same for everyone, also it's "magic".
#4, use write()

#3 Liraal

  • New Members
  • 477 posts
  • LocationPoland

Posted 11 March 2012 - 10:22 AM

casper was a bit quicker :mellow:/>

BTW, can you make it at least recognize Vanilla blocks?

#4 Casper7526

    OG of CC

  • Members
  • 362 posts

Posted 11 March 2012 - 10:23 AM

The'll be peripherals for things like this, don't worry :mellow:/>

#5 Liraal

  • New Members
  • 477 posts
  • LocationPoland

Posted 11 March 2012 - 10:24 AM

But will there be peripheral docs? :mellow:/>

#6 Casper7526

    OG of CC

  • Members
  • 362 posts

Posted 11 March 2012 - 10:25 AM

Yes, wait for 1.31, if Dan doesn't have them done by then I'll write them my damn self :mellow:/>

#7 Sebra

  • Members
  • 726 posts

Posted 11 March 2012 - 02:39 PM

View PostCasper7526, on 11 March 2012 - 10:19 AM, said:

#3, Not everyone's block id's are the same so if you wrote a program it might not be the same for everyone, also it's "magic".
At least block name is not magic. Even if it can be changed by localization. Allow us to get name at least.

#8 passinglurker

  • New Members
  • 88 posts

Posted 11 March 2012 - 02:48 PM

functions to compare with blocks already in the turtles inventory to get block IDs or names to a limited degree? (basically what we do right now but with out the digging)

#9 Casper7526

    OG of CC

  • Members
  • 362 posts

Posted 11 March 2012 - 10:33 PM

There is a feature in 1.31 that will allow you to determine what you are digging more realistically.

#10 passinglurker

  • New Members
  • 88 posts

Posted 11 March 2012 - 11:07 PM

so turtles will still visualize their world destructively i take it (unless some one uses a peripheral)

#11 Casper7526

    OG of CC

  • Members
  • 362 posts

Posted 11 March 2012 - 11:52 PM

You will be able to have a more realistic way to determine if you should dig or not, you also have a realistic way to determine your position in the world :mellow:/>

#12 Sebra

  • Members
  • 726 posts

Posted 12 March 2012 - 02:37 PM

But it seems there is no way to detect liquids. Moving turtle just destroy water/lava source.

#13 Chlorek

  • New Members
  • 8 posts
  • LocationPoland

Posted 12 March 2012 - 03:47 PM

But I really don't know how you can make turtle coords another way than just "normal" coords :mellow:/>. However, that would be useful to tell turtle it must go to given coords and e.g. start mining, then come back to you. That's possible with getting its coords.

#14 Liraal

  • New Members
  • 477 posts
  • LocationPoland

Posted 12 March 2012 - 03:59 PM

it's actually possible right now, you just have to give the turtle its starting coords.

#15 passinglurker

  • New Members
  • 88 posts

Posted 12 March 2012 - 04:57 PM

and the have the turtle do the math its not like the turtle can loose track like us





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users