Jump to content




[0.0.03] Updated again! Buildcraft Quarry Replacement! Ender Chest and Unlimited fuel Support!

turtle utility

16 replies to this topic

#1 deFENCE_

  • Members
  • 26 posts

Posted 30 October 2013 - 08:54 AM

Hi everybody! I started a new survival world and didn't have enough materials to make a BC quarry with engines. However, I had tons of coal and a few diamonds and a house under the ice and a bit of coding knowledge from java :). So I started to script this little quarry.

Usage: quarry <length> <width> <height>

Features:

+Variable size
+Calculates fuel usage (broken)
+Doesn't start if you don't have enough fuel
+Ender Chest Support! They go into slot 16!

Demo Videos:




Version 0.0.0000000001 alpha: http://pastebin.com/C3vLZEdM
Version 0.0.0000000002 alpha: http://pastebin.com/7vQjFQT7
Version 0.0.01 beta: http://pastebin.com/XhfhG8XH
Version 0.0.02 beta: http://pastebin.com/cJBrhLwv
Version 0.0.03 beta: http://pastebin.com/t2CCnSL9


Changelog:
0.0.03:
+Fixed a crash with nil params
+Added unlimited fuel support!
-Removed dungeon loot raiding

0.0.02:
+Added dungeon chest support!
[i][u][b][color=#ff0000]Don't use this if you don't want to get dungeon loot! This is slower than 0.0.01![/color][/b][/u][/i]

0.0.01:
+Added Ender Chest support
+Fixed fuel calculation (hopefully) Nope, still broken :/

Out of alpha stage! Finally!

0.0.0000000002: Fixed last bit of code not being inside the main loop and executing even if there is not enough fuel

0.0.0000000001: Initial release

Current code:


Spoiler

Please test this out and report bugs back to me!

-deFENCE

Edited by deFENCE_, 01 December 2013 - 06:19 AM.


#2 deFENCE_

  • Members
  • 26 posts

Posted 31 October 2013 - 02:07 AM

Changelog:
0.0.01:
-Added Ender Chest support
-Fixed fuel calculation (hopefully)
-Out of alpha stage! Finally!

#3 deFENCE_

  • Members
  • 26 posts

Posted 31 October 2013 - 05:05 AM

Can somebody check out what is wrong with fuel? I can't seem to resolve the issue :/

#4 deFENCE_

  • Members
  • 26 posts

Posted 31 October 2013 - 07:02 AM

0.0.02:
Added dungeon chest support!
Don't use this if you don't want to get dungeon loot! This is slower than 0.0.01!

#5 mdutcher

  • Members
  • 6 posts

Posted 01 November 2013 - 07:31 AM

Seems very cool, might wanna look into a way to keep it going after a server restart or something.
Would be really nice :P

#6 deFENCE_

  • Members
  • 26 posts

Posted 01 November 2013 - 11:43 PM

View Postmdutcher, on 01 November 2013 - 07:31 AM, said:

Seems very cool, might wanna look into a way to keep it going after a server restart or something.
Would be really nice :P
Yea, I thought of that too... But then I would have to rewrite the code... I'll see..

#7 valithor

  • Members
  • 1,053 posts

Posted 02 November 2013 - 12:13 AM

View PostdeFENCE_, on 31 October 2013 - 05:05 AM, said:

Can somebody check out what is wrong with fuel? I can't seem to resolve the issue :/

Just so you know it will be impossible to calculate exactly how much fuel it will use as its inventory might become full forcing it to go back up before you predicted it would. This will cause it to use more fuel than you expect. The only way around this is for it to use a enderchest only if it uses normal chests to store which is a feature that you have it will not work.

(((((x-1)*2)) * z)+((2*z)-2)) * y)+y-1 This right here is the equation required only for digging the area out
x+z+y-3 This is equation for fuel required to get back to home position assuming you use most efficient route to get back
This might fix the calculation for perfect world scenario.

​This calculation was done quickly based on the fact that in a 5 x 5 grid a turtle would have to move 44 times to move the entire area.
(((5-1)*2) * 5)+(4)) = 44
the equation above also includes the fuel required to get back to the home x and z coords but the one i worked out does not

If you wish me to explain this equation i can, but for sake of time i am not going to right now
This equation only will work for the way that the program is set up in the video if the mining pattern has been changed at all this equation will not work

Edited by valithor, 02 November 2013 - 12:33 AM.


#8 deFENCE_

  • Members
  • 26 posts

Posted 02 November 2013 - 12:28 AM

View Postvalithor, on 02 November 2013 - 12:13 AM, said:

View PostdeFENCE_, on 31 October 2013 - 05:05 AM, said:

Can somebody check out what is wrong with fuel? I can't seem to resolve the issue :/

Just so you know it will be impossible to calculate exactly how much fuel it will use as its inventory might become full forcing it to go back up before you predicted it would. This will cause it to use more fuel than you expect. The only way around this is for it to use a enderchest only if it uses normal chests to store which is a feature that you have it will not work.
Well, at that time it needs ender chests to work. I will try your method of calculating out, I don't know if it fit the code though. It should work though :)

#9 valithor

  • Members
  • 1,053 posts

Posted 02 November 2013 - 12:34 AM

View PostdeFENCE_, on 02 November 2013 - 12:28 AM, said:

View Postvalithor, on 02 November 2013 - 12:13 AM, said:

View PostdeFENCE_, on 31 October 2013 - 05:05 AM, said:

Can somebody check out what is wrong with fuel? I can't seem to resolve the issue :/

Just so you know it will be impossible to calculate exactly how much fuel it will use as its inventory might become full forcing it to go back up before you predicted it would. This will cause it to use more fuel than you expect. The only way around this is for it to use a enderchest only if it uses normal chests to store which is a feature that you have it will not work.
Well, at that time it needs ender chests to work. I will try your method of calculating out, I don't know if it fit the code though. It should work though :)

make sure to use the most recent i updated it some where around 10 times
also if you wish you could come onto my server and i could help you with it if you need help
http://www.computerc...tive-valicraft/ -- server information

#10 deFENCE_

  • Members
  • 26 posts

Posted 02 November 2013 - 01:13 AM

View PostdeFENCE_, on 02 November 2013 - 12:28 AM, said:

View Postvalithor, on 02 November 2013 - 12:13 AM, said:

View PostdeFENCE_, on 31 October 2013 - 05:05 AM, said:

Can somebody check out what is wrong with fuel? I can't seem to resolve the issue :/

Just so you know it will be impossible to calculate exactly how much fuel it will use as its inventory might become full forcing it to go back up before you predicted it would. This will cause it to use more fuel than you expect. The only way around this is for it to use a enderchest only if it uses normal chests to store which is a feature that you have it will not work.
Well, at that time it needs ender chests to work. I will try your method of calculating out, I don't know if it fit the code though. It should work though :)
Fail...
Gives me this
bios:339: [string "quarry"]:64:
unexpected symbol

Current code is:
Spoiler

View Postvalithor, on 02 November 2013 - 12:34 AM, said:

View PostdeFENCE_, on 02 November 2013 - 12:28 AM, said:

View Postvalithor, on 02 November 2013 - 12:13 AM, said:

View PostdeFENCE_, on 31 October 2013 - 05:05 AM, said:

Can somebody check out what is wrong with fuel? I can't seem to resolve the issue :/

Just so you know it will be impossible to calculate exactly how much fuel it will use as its inventory might become full forcing it to go back up before you predicted it would. This will cause it to use more fuel than you expect. The only way around this is for it to use a enderchest only if it uses normal chests to store which is a feature that you have it will not work.
Well, at that time it needs ender chests to work. I will try your method of calculating out, I don't know if it fit the code though. It should work though :)

make sure to use the most recent i updated it some where around 10 times
also if you wish you could come onto my server and i could help you with it if you need help
http://www.computerc...tive-valicraft/ -- server information
Sure I can come on your server :D
I'll be happy to :)

#11 kelm

  • Members
  • 9 posts

Posted 02 November 2013 - 12:11 PM

View PostdeFENCE_, on 31 October 2013 - 05:05 AM, said:

Can somebody check out what is wrong with fuel? I can't seem to resolve the issue :/

The movement makes the calculation harder. If at the end of a row, instead of having the turtle come back to the starting place and then moving over, it just moved over and dug on its way back, the fuel would be (height * width * length). You've made it traverse every block twice, basically, so it is (height * width * length * 2).

#12 deFENCE_

  • Members
  • 26 posts

Posted 02 November 2013 - 11:55 PM

View Postkelm, on 02 November 2013 - 12:11 PM, said:

View PostdeFENCE_, on 31 October 2013 - 05:05 AM, said:

Can somebody check out what is wrong with fuel? I can't seem to resolve the issue :/

The movement makes the calculation harder. If at the end of a row, instead of having the turtle come back to the starting place and then moving over, it just moved over and dug on its way back, the fuel would be (height * width * length). You've made it traverse every block twice, basically, so it is (height * width * length * 2).
The problem is, it isn't height*2, it is (height-1)*2 because if it is 5 long, it goes 4 blocks forward. Then it goes 4 blocks backward. I have thought of ((height-1) * width * length * 2) too, but that didn't work sadly.

#13 deFENCE_

  • Members
  • 26 posts

Posted 01 December 2013 - 05:49 AM

I'm adding unlimited fuel support right now...

#14 deFENCE_

  • Members
  • 26 posts

Posted 01 December 2013 - 06:08 AM

Update released!
0.0.03:
+Fixed a crash with nil params
+Added unlimited fuel support!
-Removed dungeon loot raiding

#15 deFENCE_

  • Members
  • 26 posts

Posted 03 December 2013 - 09:04 AM

Save movement coming soon!

#16 apemanzilla

  • Members
  • 1,421 posts

Posted 03 December 2013 - 09:32 AM

Could you just use the edit button next time?

#17 deFENCE_

  • Members
  • 26 posts

Posted 05 December 2013 - 06:46 AM

View PostApemanzilla, on 03 December 2013 - 09:32 AM, said:

Could you just use the edit button next time?
What? I'm using the edit button actually...





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users