Jump to content




Turtle Tweaks


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

#1 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 18 July 2015 - 08:51 PM

While playing with turtles today, I thought of something;

These functions, (for example)...
compareUp()
compareDown()

suckUp()
suckDown()

equipLeft()
equipRight()

Why don't they work like this:
compare("top")
compare("bottom")

suck("top")
suck("bottom")

equip("left")
equip("right")
(There are others, like dig, detect, inspect ect)

Obviously, they would have to error if you used a side that doesn't work, like trying to equip something on top of a turtle, or sucking from the back of a turtle.
Alternatively, they could just not do anything when given a nonsense side.

What do you guys think?
Has this been suggested before?


I made an API that does this:
http://www.computerc...tle-tweaks-api/

Edited by HPWebcamAble, 18 July 2015 - 11:34 PM.


#2 Lupus590

  • Members
  • 2,028 posts
  • LocationUK

Posted 18 July 2015 - 10:14 PM

I don't think that this is a good suggestion, as the error messages caused by attempting to do something on an invalid side is useful.

Other than the convince of being able to loop through a table with "up", nil, "down" to call each, I see no point. Also I'm sure that people more creative than me will be able to replicate that without making a wrapper function.

Another note, what will be do with the old functions? You will cause a lot of compatibility issues if you remove them.

#3 jerimo

  • Members
  • 74 posts

Posted 18 July 2015 - 10:46 PM

I would think the main reason it was implemented implementer his way is because it's much faster this way.

Let's compare;
The current way you call the function it does its thing and its done.
The way you are proposing you call a function, which then needs to compare strings, followed by assigning a few more variables to determine which block needs to be checked based on the strong and finally do its thing.

If the turtles and computers did not have to share a single thread it would not matter but due to the way that the system is made any acceleration is good

On a server I played in we had over three hundred computers running at all times, around fifty of those being turtles that were not assigned to a farm, such as the wither boss farm

#4 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 18 July 2015 - 11:32 PM

Ok first, maybe I'm the only one who wants this. In which case, I'll just use my API.

What API? Oh this api:
http://www.computerc...tle-tweaks-api/
It perfectly implements what I envisioned.

Lupus

jerimo

Edited by HPWebcamAble, 18 July 2015 - 11:33 PM.


#5 jerimo

  • Members
  • 74 posts

Posted 25 July 2015 - 07:09 AM

View PostHPWebcamAble, on 18 July 2015 - 11:32 PM, said:

-- snip --
The difference would be small, yes but there would be a difference which would start showing if you had a hundred turtles all trying to do this as quickly as they can





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users