Jump to content




Ultimate Wood Chopper [0.9.5 Prerelease B][Session Persistent]

turtle utility

415 replies to this topic

#21 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 13 January 2013 - 02:39 AM

Wow... this is VERY good stuff for a, how'd you put it, 'newbie'..... Keep up the good work :) Can't wait to see where else this goes, and what else you make :)


View PostUNOBTANIUM, on 10 January 2013 - 11:15 PM, said:

- special thanks goes to: TheOriginalBIT

Your welcome :)

#22 unobtanium

  • Members
  • 505 posts

Posted 13 January 2013 - 03:42 AM

Hey, nice to see you again :D
I know that i am not such a noob in programming, its just the lua programming + the turtle.
Thank you for the future perspective. I will work on it :P

#23 Kravyn

  • Members
  • 18 posts

Posted 13 January 2013 - 03:51 PM

I tried doing the expand your farm and you need to increase how much fuel it needs when it expands it seems to run out on me with the amount that it takes. It does not even finish the second triangle shape before it runs out and fails having to start over.

forced it to refuel 20 charcoal

Also the amount of materials your thing says to have in the inventory seems way off because it had the amount you said and it could not even get close to finishing it needs 327 pieces of stone bricks your picture says 212 it is off by over 100+.

When it builds the farm the first time it uses 336 fuel which is a bit over 4 charcoal when it ended. The problem is when the turtle is told to build the expanded farm it uses 5 more charcoal which is far from enough it needs 628 but it only got 400 more with the 64 still in the turtle at 464 its not enough it needs to eat another 3 more charcoal just to finish so 8 in total on expanding.

Add 8 refuel on expanded base and add another 115 more pieces of stone brick which is a total of 5 stacks and 7 pieces not 3 stacks and 20 pieces to the screenshot and information.


Does the turtle always have to have bonemeal or can it just let the tree grow and check after a set amount of time?

#24 unobtanium

  • Members
  • 505 posts

Posted 14 January 2013 - 04:36 AM

Hey,
Okay lets do some math here ^^
I checked the fuel level a charcoal gives here. On my feed the beast client it is still 96 fuel per charcoal. In the new version it got nerfed and it just give 80 now. I did some research with my program (which i should have made earlier but i was accually too lazy :/)
Build Program:
I will use the new fuel level a charcoal gives because i think it will be implemented in another update of ftb.
The Turtle just uses 3 charcoal for fuel: 80*3=240
For building the farm the Turtle need 176 fuel. So it has 64 fuel left after the farm built.
One of the other two charcoal are used as indicator for the user which chest the charcoal chest is and the last one is put into the furnace to turn the wood into charcoal.

Expand Program:
The program checks if it has more then 300 fuel. This was way too less, i have to agree! I increased it to 600. It now consumes around 7 and 8 coal.

I am 100% sure that the amount of blocks (3 stacks and 20 blocks) are perfect. You accually are not allowed to remove any blocks of the standard farm. The Turtle will dig down the old farm and use the blocks to rebuild the new farm. The funny thing is, that you are right with your 5 stacks and 7 blocks. The Turtle will destroy 115 blocks from the old farm to build the new farm. And at the end you have still one left, because it has to remove one block for the pipe system.

Two days ago i had the same idea, to let it grow the tree without bonemeal. I implemented it for both expanded and standard version in the chop programs menu.

NEW VERSION OUT!
Spoiler


#25 Kravyn

  • Members
  • 18 posts

Posted 14 January 2013 - 04:12 PM

Ok I double checked and realized you used a mining turtle not felling that is what kept loosing me I changed to a mining turtle and the total amount of stone brick it had picked up after collecting them all did equal the amount that it should have the 327 when I was using the felling turtle it was only able to use what I gave it and didn't pick any up.

Found another problem now tho and I tested it 3 times turtle gets a turtle:18:Slot number 17 out of range error.

it had the right amount of materials left it just added the obsidian pipe then the stone pipe then just failed after it got down under the platform to place the rest. it still has 33 fuel screenshots added.

http://imgur.com/a/PH7FM

either way good script the turtle now uses the the right amount of fuel I think.

#26 unobtanium

  • Members
  • 505 posts

Posted 14 January 2013 - 11:13 PM

Thank you for your help! I appreciate it that people "beta test" it and help me out with it, because i have not that much time for testing.
However, i think i fixed it now. Just a simple if statement.
NEW VERSION OUT!

#27 unobtanium

  • Members
  • 505 posts

Posted 15 January 2013 - 10:51 PM

NEW VERSION OUT!

I will add pictures later :D

#28 xInDiGo

  • Members
  • 105 posts

Posted 16 January 2013 - 06:39 AM

i'd like to see an implication where the turtle can idle on top of the furnace, and act as a hopper, putting more wood in the furnace when it can! currently with an iron furnace it generates a great amount of charcoal, but i've always gotta load the furnace with wood! so a hopper setting would be fan-f**king-tastic!

#29 unobtanium

  • Members
  • 505 posts

Posted 16 January 2013 - 07:33 AM

The basic idea behind the furnace is that the turtle never runs out of coal -> selfsustaining.
It allways makes a bit too much coal, so maybe every 12 hours the charcoal chest is full and has to be unload by a player.
I accually dont think that i will implement this, sorry :s (maybe if there are real hoppers ingame)
If you need more charcoal, pipe the wood out of the wood storage chests into furnaces or a hopper turtle.

#30 xInDiGo

  • Members
  • 105 posts

Posted 16 January 2013 - 08:17 AM

yeah i get what the idea behind the furnace is, but the amount of wood generated > the amount of charcoal. my chests will fill of wood before it fills with charcoal. w/ the current setup though it seems impossible to pipe the wood into the furnace even if i wanted to.

i'm actually working on my own hopper script for a turtle, and if i can get it to work right i'll share it with you! although you seem pretty resistant to the idea :(

#31 unobtanium

  • Members
  • 505 posts

Posted 16 January 2013 - 09:00 AM

I am not sure if i get your idea right :/ If you pipe the wood out and let it make a circle in the pipe system, it can refill all furnaces the wood items come over.

I am not resistant :D I accually want to see your script if its ready to release. Its just.. it just isnt on my to-do list ^^

#32 PhaxeNor

  • Members
  • 1 posts

Posted 26 January 2013 - 09:46 AM

Love the wood chopper, but when I try to debug expanded farm I get "fwc:381: attempt to call nil"

Just a typo I guess, but you have the wrong function set for debuging the expanded farm

#33 unobtanium

  • Members
  • 505 posts

Posted 26 January 2013 - 10:17 AM

Yeah, you are right ^^
Thank you for helping me out. I fixed the mistake :D

#34 DavEdward

  • Members
  • 17 posts

Posted 27 January 2013 - 06:08 AM

Gak, you made a new version already and it's way way better than my fix.

I kept getting too busy to make corrections to your code and by the time I finished it it seems you already made your new better version.

I and my friend Talonius did a small re-write to your older FWCChop program due to issues it had.

Bugs:
1.Turtle did turtle.detect() instead of turtle.detectUp() when looking to chop a tree
2.Turtle didn't know how to handle using a bonemeal that 'fails' making it get stuck
3.If the turtle had 16 or more saplings already in it's invintory when the program was started, the turtle didn't bother to check if it needed bonemeal
4.When out of bonemeal and the turtle returns to base, it tries to get more bonemeal from the bonemeal chest. If the chest is empty or doesn't have enough bonemeal. The turlte sits there forever instead of parking.

My Fixes:
1.Simply changed to turtle.detectUp()
2.Made sure turtle checks to make sure it always keeps at least 1 bonemeal in it's invintory so that saplings/logs don't fool it into thinking it has bonemeal when it chops things after using up all the bonemeal
3.When turtle checks for saplings, it also checks for bonemeal in the same check
4.Turtle now when out of bonemeal or full, returns to base, puts away wood, then checks if the lever is still 'on' if it is, it will then check for bonemeal and saplings.

Although it's a lot less valueable to you now, I'll share you my edits to your program. Hopefully you'll like some of the changes I made. I thought to share it in hopes to be helpful but it seems I'm almost an entire month late.

http://pastebin.com/jbUaVPBE

Keep up the great work! Cherrs.

#35 unobtanium

  • Members
  • 505 posts

Posted 27 January 2013 - 10:45 AM

Hello there,
I am impressed that someone really looked such deep in my code :D
Some of these improvements you made are still not in my new code. Like 2, 3.
I improved 4 in the way, that you can terminate it now :D
I may add the 2 and 3 if i get some time. They seem to be logic and better :D
Thank you for enjoying this program, fixing and improving it!
PS: The code you have. Which version was it? :D

#36 ughzug

  • Members
  • 24 posts

Posted 31 January 2013 - 10:42 PM

needs to have automatic resume functionality from restart or player leaving the area other then that it isnt too shabby. i would recomend adding a second program to complment this one though, a charcoal factory with auto resume functionality.

#37 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 31 January 2013 - 10:46 PM

View Postughzug, on 31 January 2013 - 10:42 PM, said:

needs to have resume functionality from restart or player leaving the area other then that it isnt too shabby. i would recomend adding a second program to complment this one though, a charcoal factory with resume functionality.
Adding resume is harder than you think ;) it does take a while to get working 100% without using an API. Maybe just use chunk loaders (obviously only work for player leaving) until the CC devs add persistence (in your words "resume") into CC itself. :)

#38 ughzug

  • Members
  • 24 posts

Posted 01 February 2013 - 12:04 AM

View PostTheOriginalBIT, on 31 January 2013 - 10:46 PM, said:

View Postughzug, on 31 January 2013 - 10:42 PM, said:

needs to have resume functionality from restart or player leaving the area other then that it isnt too shabby. i would recomend adding a second program to complment this one though, a charcoal factory with resume functionality.
Adding resume is harder than you think ;) it does take a while to get working 100% without using an API. Maybe just use chunk loaders (obviously only work for player leaving) until the CC devs add persistence (in your words "resume") into CC itself. :)

while redundant it is not difficult to have it write to a table every action and delete the action before it and to have it check the table at startup to jump into the program and line that was last recorded.

#39 sjkeegs

  • Members
  • 75 posts

Posted 01 February 2013 - 04:07 AM

View Postughzug, on 01 February 2013 - 12:04 AM, said:

while redundant it is not difficult to have it write to a table every action and delete the action before it and to have it check the table at startup to jump into the program and line that was last recorded.
Recording the data isn't hard. Depending on the application, structuring the code so that it knows where to jump back in can be the tricky part. I'm looking at doing that for a branch miner and it isn't all that easy. The code performs a number of different functions, and the resume needs to know what function was being executed, and how far into that process the turtle got, so that it can intelligently resume.

#40 unobtanium

  • Members
  • 505 posts

Posted 01 February 2013 - 05:50 AM

View Postughzug, on 31 January 2013 - 10:42 PM, said:

needs to have automatic resume functionality from restart or player leaving the area other then that it isnt too shabby. i would recomend adding a second program to complment this one though, a charcoal factory with auto resume functionality.

Hello there,
i allready tought about save and load the progress of the turtle, but the code is over 1300 lines long and kinda messy. If i would make such a program again i would change a lot of it.
However, i dont plan on adding a resume feature to this, because i hope that they will add the persistence to CC in the near future.
If your turtle stoped working while chopping the tree i recommand the debug programs, so you dont have to chop down the half tree by yourself.
At the moment i just can say, that you should use World Anchors and shutdown the turtle with the lever if you log out and playing in SSP.
Nevertheless, thank you for your suggestion :D





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users