Jump to content




Variable Size Quarry (now with Super Ore Quarry™)

turtle

595 replies to this topic

#401 civilwargeeky

  • Members
  • 393 posts

Posted 04 November 2014 - 06:58 PM

View PostDJF, on 04 November 2014 - 12:43 PM, said:

View Postcivilwargeeky, on 04 November 2014 - 04:29 AM, said:

-snip-
Actually it does work. I just went back and tested for you. Make sure you right click on the wired modem to connect it, or else it won't work. The screen name appears in chat.

Also thanks! It's people like you that keep me making them :D

Thanks for video. Yes, it works. Amazing.

I also tried your Repeater code and found there one small bug. In the text you say, <code>'r' to remove channels</code> but in your code, you wait for letter c.
I fixed it and added 2 small features: If user tries to add already added channel, the channel won't be added. And when the repeater receives message, it automatically tries to add replay channel in channels.

So user can only add the channel, the turtle will tell him and don't have to bother with the reply number.
(I spent more then hour trying to find out, why the turtle did not get the return message from Receiver while using Repeater in the middle :-D )

I uploaded the modified code to pastebin so feel free to use it in one of your future updates: http://pastebin.com/sUGR6UtA
Glad it works :)

Thank you so much for the repeater revisions! I had neglected to add in 1.5.2 support to the repeater, I guess I just forgot. Also I didn't even think of auto-adding reply channels. That's a great idea and a simple solution :)

I have added your code to the OP, and your code will be put into the next release with a couple small changes.

If you ever want a more direct way (that gives you a bit more credit) to contribute, you can submit a pull request on Github :)

Thanks for being awesome!

Edit: 400th thread post :D

Edited by civilwargeeky, 04 November 2014 - 06:59 PM.


#402 elektronemulo

  • Members
  • 9 posts

Posted 05 November 2014 - 09:51 AM

Might I make a couple of suggestions for new features?
  • -flatBedrock [y/N]
    • would have the turtle mine down to the flat bedrock layer.
    • The Direwolf20 packs have had flat bedrock and the 1.7.10 version of his pack has diamonds concentrated a touch lower than default, so I hear. Also, Dark Iron tends to be down in the bedrock layers.)
  • -enderRefuel [y/N]
    • would have the turtle place an enderchest full of fuel, pull fuel from the ender chest and refuel itself, return the extra fuel back to the enderchest, break the chest, and resume.
Thanks for a superb program; it's one of my go-to programs for CC. As a matter of fact, it's the first one on my list.

#403 civilwargeeky

  • Members
  • 393 posts

Posted 05 November 2014 - 01:48 PM

View Postelektronemulo, on 05 November 2014 - 09:51 AM, said:

Might I make a couple of suggestions for new features?
  • -flatBedrock [y/N]
    • would have the turtle mine down to the flat bedrock layer.
    • The Direwolf20 packs have had flat bedrock and the 1.7.10 version of his pack has diamonds concentrated a touch lower than default, so I hear. Also, Dark Iron tends to be down in the bedrock layers.)
  • -enderRefuel [y/N]
    • would have the turtle place an enderchest full of fuel, pull fuel from the ender chest and refuel itself, return the extra fuel back to the enderchest, break the chest, and resume.
Thanks for a superb program; it's one of my go-to programs for CC. As a matter of fact, it's the first one on my list.
Thanks! These are really good feature suggestions, and have been slated for release in 3.5.6, after I finish integrating the new oreQuarry system into the base program.

#404 civilwargeeky

  • Members
  • 393 posts

Posted 13 November 2014 - 07:04 PM

Quarry Version 3.5.5 (The auto-restart update)

Important changes:
  • Now makes an auto-restore file, and automatically renames startup. Re-adds old startup when done
  • Added new quarry to this version. Old Quarry still accessible with -oldOreQuarry
  • Added help to receiver
  • Added new theme: seagle (based on seagle23's old receiver hack)
  • Repeater has DJF's changes and a couple more
Downloads:
Quarry: http://pastebin.com/6Pdcb8Ay
Receiver: http://pastebin.com/2unS3htn
Repeater: http://pastebin.com/Te359WA2 (same)

Raw Changes:
Spoiler

New Parameters!
  • -blacklist: set the name of the oreQuarry blacklist file
  • -oldOreQuarry: forces use of old ore quarry, instead of new
  • -autoResume: saves a startup file to run quarry with resume
  • -autoRestart: same as above
  • -startupRename: changes what the startup file is renamed to
  • -startupName: the file to save the startup to (usually "startup" but I don't know what OSs may do)
  • -promptAll: feeling adventurous? This will prompt you for literally every parameter

Edited by civilwargeeky, 13 November 2014 - 07:11 PM.


#405 Kotawolf

  • Members
  • 26 posts

Posted 14 November 2014 - 12:54 AM

Got an error when trying to run the Receiver program with the -screen switch.

qrec:258: Expected String

It works fine if I don't push to the monitors, and I am using inf fuel.
Newest CC, and it is MC 1.7.10

Thanks for the help.

Tried with fuel turned on and off.
Using Advanced Computer and Monitors.

*Edit* just saw the new versions posted, will check those out.

With the new one, getting
name:455: Expected string
Again this is only when trying to send to the monitors

Edited by Kotawolf, 14 November 2014 - 12:58 AM.


#406 civilwargeeky

  • Members
  • 393 posts

Posted 14 November 2014 - 05:02 AM

View PostKotawolf, on 14 November 2014 - 12:54 AM, said:

-snip-
Hi! Thanks for using the programs
Wow, there were some pretty blatant errors. Another example was that pressing any key errored and the "resume" command didn't work.

What happened in your error was you said "-screen" without giving it a side name, causing an error. (You may have been looking for "auto"?)
Anyway, I sanitized that input now so it should properly work (or not work cuz you didn't give a screen...). And actually I misunderstood a function, so my fail-safe had broken too. Now that's fixed as well :)

All the bugs I found have been fixed, and the pastebins are updated. Just redownload :)
Thanks for the bug report!

Edit: Also sorry this took so long, it actually took me an unnecessary hour to figure out why the pause message wasn't sending.

Edited by civilwargeeky, 14 November 2014 - 05:04 AM.


#407 Renari

  • Members
  • 5 posts

Posted 14 November 2014 - 07:11 AM

Would anyone be willing to look over the changes I made to the code to attempt to make it work with the chunky mining peripheral? Every time I try to run this it goes forward once and then says "Cannot serialize type function".

Here's the changes I made http://pastebin.com/13FSFQG6 and I've tested that the peripheral functions for digging do in-fact exist.

#408 Imred Gemu

  • Members
  • 47 posts

Posted 14 November 2014 - 09:20 AM

Found a crash bug in version 3.5.5 in the function midRunRefuel at line 1469
turtle.refuel(math.min(numToRefuel-1, math.ceil((checkFuelLimit-checkFuel()) / singleFuel))) --The refueling part of the the doRefuel option
The error occurs where I assume you intended to subtract the output of checkFuel from the output of checkFuelLimit. You did not call checkFuelLimit, but instead referenced it as a variable. This causes the program to attempt to subtract the output of checkFuel from the value of checkFuelLimit, which causes an error. Instead it should read
turtle.refuel(math.min(numToRefuel-1, math.ceil((checkFuelLimit()-checkFuel()) / singleFuel))) --The refueling part of the the doRefuel option


#409 civilwargeeky

  • Members
  • 393 posts

Posted 14 November 2014 - 10:22 PM

View PostRenari, on 14 November 2014 - 07:11 AM, said:

Would anyone be willing to look over the changes I made to the code to attempt to make it work with the chunky mining peripheral? Every time I try to run this it goes forward once and then says "Cannot serialize type function".

Here's the changes I made http://pastebin.com/13FSFQG6 and I've tested that the peripheral functions for digging do in-fact exist.
Hi! Cool edit.
The error you are getting actually took me forever to figure out, because it used to happen with modems too. In the save function, it tries to serialize all tables that are loaded, including your mcm. However, it errors when trying to serialize functions. You have 3 options, all of them easy.
  • When you define your mcm table "mcm = whatever", make it a local. Just write "local mcm = whatever"
  • In function saveProgress, there is a table called "exclusions", add to it saying "mcm = true"
  • Use the "-doBackup false" parameter to turn off saving (not recommended)
Any one of these will fix your problem :D
Also, when you defined dig functions, why did you use turtle.inspectUp for the digDown function? That might also be a problem as it will detect up, then try to dig down.

Edit: Also, if you want, when you finish I can add it to the OP if you want for others to use.

View PostImred Gemu, on 14 November 2014 - 09:20 AM, said:

Found a crash bug in version 3.5.5 in the function midRunRefuel at line 1469
turtle.refuel(math.min(numToRefuel-1, math.ceil((checkFuelLimit-checkFuel()) / singleFuel))) --The refueling part of the the doRefuel option
The error occurs where I assume you intended to subtract the output of checkFuel from the output of checkFuelLimit. You did not call checkFuelLimit, but instead referenced it as a variable. This causes the program to attempt to subtract the output of checkFuel from the value of checkFuelLimit, which causes an error. Instead it should read
turtle.refuel(math.min(numToRefuel-1, math.ceil((checkFuelLimit()-checkFuel()) / singleFuel))) --The refueling part of the the doRefuel option
*facepalm*
Wow. It is now fixed, just redownload the program :)
Thanks so much for the bug report!

Edited by civilwargeeky, 14 November 2014 - 10:50 PM.


#410 Stylomax

  • Members
  • 5 posts

Posted 15 November 2014 - 03:13 AM

I really like the progress that has been made on this program. The only issue I have is that for some reason it refuses to pay attention to the blacklist file. I created an oreQuarryBlacklist.txt file with the following in it:


minecraft:stone, minecraft:dirt, minecraft:cobblestone, minecraft:gravel

I run it with the OreQuarry option set to true, and the turtle recognizes that the option has been set when it starts, yet it still mines the items on the blacklist. It may be because I'm running CC 1.65 as a part of the DW20 1.7.10 server set. Is there a way to get this to work or is there a way I can at least use the compare blocks option?

edit I must've missed the oldOreQuarry option the first time around. I just tried it and it's still mining the blocks I don't want it to mine. I put the blocks I don't want it to mine in the first 4 slots for comparison, or are they supposed to go elsewhere?

Edited by Stylomax, 15 November 2014 - 04:09 AM.


#411 Imred Gemu

  • Members
  • 47 posts

Posted 15 November 2014 - 05:22 AM

Quote

Wow. It is now fixed, just redownload the program :)
Thanks so much for the bug report!
I already fixed it in my copy. I just wanted to let you know so other people wouldn't run into the same issue. I'm glad I could help. Issues like that are easy to overlook in lua since they don't cause compilation errors.

#412 Kotawolf

  • Members
  • 26 posts

Posted 15 November 2014 - 03:16 PM

View PostStylomax, on 15 November 2014 - 03:13 AM, said:

I really like the progress that has been made on this program. The only issue I have is that for some reason it refuses to pay attention to the blacklist file. I created an oreQuarryBlacklist.txt file with the following in it:


minecraft:stone, minecraft:dirt, minecraft:cobblestone, minecraft:gravel

I run it with the OreQuarry option set to true, and the turtle recognizes that the option has been set when it starts, yet it still mines the items on the blacklist. It may be because I'm running CC 1.65 as a part of the DW20 1.7.10 server set. Is there a way to get this to work or is there a way I can at least use the compare blocks option?

edit I must've missed the oldOreQuarry option the first time around. I just tried it and it's still mining the blocks I don't want it to mine. I put the blocks I don't want it to mine in the first 4 slots for comparison, or are they supposed to go elsewhere?

I think I'm having the same issue, I tried to run the "new" oreQuarry option, CC 1.65 and MC 1.7.10 (my custom built pack), and it started mining everything, tried with compare blocks, it still mined everything, I'm at a point that I am sure I did it wrong, but I thought it said with the newest version, we didn't need the Blacklist file.

/signed
slightly confused.

#413 civilwargeeky

  • Members
  • 393 posts

Posted 15 November 2014 - 05:18 PM

View PostImred Gemu, on 15 November 2014 - 05:22 AM, said:

I already fixed it in my copy. I just wanted to let you know so other people wouldn't run into the same issue. I'm glad I could help. Issues like that are easy to overlook in lua since they don't cause compilation errors.
Glad to hear, thanks again :)


View PostStylomax, on 15 November 2014 - 03:13 AM, said:

-snip-

View PostKotawolf, on 15 November 2014 - 03:16 PM, said:

View PostStylomax, on 15 November 2014 - 03:13 AM, said:

I really like the progress that has been made on this program. The only issue I have is that for some reason it refuses to pay attention to the blacklist file. I created an oreQuarryBlacklist.txt file with the following in it:


minecraft:stone, minecraft:dirt, minecraft:cobblestone, minecraft:gravel

I run it with the OreQuarry option set to true, and the turtle recognizes that the option has been set when it starts, yet it still mines the items on the blacklist. It may be because I'm running CC 1.65 as a part of the DW20 1.7.10 server set. Is there a way to get this to work or is there a way I can at least use the compare blocks option?

edit I must've missed the oldOreQuarry option the first time around. I just tried it and it's still mining the blocks I don't want it to mine. I put the blocks I don't want it to mine in the first 4 slots for comparison, or are they supposed to go elsewhere?

I think I'm having the same issue, I tried to run the "new" oreQuarry option, CC 1.65 and MC 1.7.10 (my custom built pack), and it started mining everything, tried with compare blocks, it still mined everything, I'm at a point that I am sure I did it wrong, but I thought it said with the newest version, we didn't need the Blacklist file.

/signed
slightly confused.

Okay, so I went in to a new world with a fresh turtle and tried the oreQuarry functions, thinking I had done something painfully dumb, but everything worked out fine... I tried without blacklist, with blacklist, and with oldOreQuarry, and they all worked fine.
So, to make sure you guys are aware of how to properly use oreQuarry, I made a video that will be going in the OP. Here you go :)



Also, if you don't want any cobble/dirt/gravel, check out the "dumpCompareItems" and "extraDropItems" parameters for oldOreQuarry. The dumpCompareItems doesn't yet work with new oreQuarry, but I have it on my todo for 3.5.6, which will hopefully come out soonish.

Edit: If it still doesn't work for you, could you please provide some more information so I can properly help you?

Edited by civilwargeeky, 15 November 2014 - 05:39 PM.


#414 Renari

  • Members
  • 5 posts

Posted 16 November 2014 - 03:40 AM

View Postcivilwargeeky, on 14 November 2014 - 10:22 PM, said:

-snip-
Any attempt I've had at getting a working build that retains the base codes functionality hasn't panned out. For example the current code tends to randomly crash when changing inventory slots.
function getChangedSlots(tab1, tab2) --Returns a table of changed slots. Format is {slotNumber, numberChanged}
  local toRet = {}
  for i=1, min(#tab1, #tab2) do
	diff = math.abs(tab2[i]-tab1[i])
	if diff > 0 then
	  table.insert(toRet, {i, diff})
	end
  end
  return toRet -- crash here (attempt to call nil)
end

I haven't changed anything relating to that however, the builds I've got that work tend to be a full replacement and make mining turtles not function with that code anymore.

Edited by Renari, 16 November 2014 - 03:41 AM.


#415 civilwargeeky

  • Members
  • 393 posts

Posted 16 November 2014 - 03:55 AM

View PostRenari, on 16 November 2014 - 03:40 AM, said:

-snip-
Well, that is a very strange error, considering it says "attempt to call nil", and there's literally nothing there to call (and table.insert and math.abs are pre-defined...)

I would love to help you make this work, and I feel that private message would be the best way to continue this. Talk with you soon!

#416 Bullen

  • Members
  • 8 posts

Posted 19 November 2014 - 04:07 PM

View Postcivilwargeeky, on 15 November 2014 - 05:18 PM, said:

-snip-

I got the same problem as they do. What I think is the problem is that even though dumpCompareItems is true by default, it will still not drop the blocks on the ground but return to the chest.

Edited by Bullen, 19 November 2014 - 04:12 PM.


#417 civilwargeeky

  • Members
  • 393 posts

Posted 19 November 2014 - 11:18 PM

View PostBullen, on 19 November 2014 - 04:07 PM, said:

View Postcivilwargeeky, on 15 November 2014 - 05:18 PM, said:

-snip-

I got the same problem as they do. What I think is the problem is that even though dumpCompareItems is true by default, it will still not drop the blocks on the ground but return to the chest.

View Postcivilwargeeky, on 15 November 2014 - 05:18 PM, said:

The dumpCompareItems doesn't yet work with new oreQuarry, but I have it on my todo for 3.5.6, which will hopefully come out soonish.

:)

The update should be out by the end of this weekend. I just need to test the ender-refueling and code in the dumpCompareItems. The code for dropping compareItems should be easy, but I was thinking of expanding the inventory system to possibly record everything that was mined. I think that would be a cool option, for the turtle to tell you that you got 12 diamonds, 70 tin, etc. I could even send it back through rednet and maybe pop up when you get diamonds or something. But that will come at a later time.

Anyway, I could probably mock something up real quick. I'll post back in a little bit

Edit: Coding one line in to fix it was not working in a timely manner. It'll get done later :)

Edited by civilwargeeky, 20 November 2014 - 12:39 AM.


#418 civilwargeeky

  • Members
  • 393 posts

Posted 22 November 2014 - 03:32 AM

Quarry Version 3.6.0 (The Basic Changes Update)

Important changes:
  • Quarries can left instead of right now! Just use "-left true"
  • Turtle no longer goes back to start at the end of a layer, it just goes down! This is very important as it saves tons of time and fuel
  • dumpCompareItems parameter works with new oreQuarry
  • With -flatBedrock parameter, turtle will automatically go to bedrock before starting quarry (still starts from top of defined range)
  • Fixed bedrock function to help with above and account for new row switching
  • You can now fuel turtles via enderChest! Recommended use: "-fuelChest [true/slot] -doCheckFuel false -maxFuel [someNumber]" (if you don't use doCheckFuel false, still does initial fuel check)
  • In receiver, up arrow selects last command and down arrow clears command line

Downloads:
Quarry: http://pastebin.com/YTgKCcVy
Receiver: http://pastebin.com/mLYKBZ4Y
Raw Changes:
Spoiler
New Parameters!
-flatBedrock [t/f]: The turtle will initially dig down to bedrock (or possibly a mob) and set startDown from that
-left [t/f]: The turtle will quarry to the left instead of the right
-maxFuel [number]: The number the turtle will stop fueling at. Basically just sets checkFuelLimit to this number
-fuelChest [nothing or slot number]: Prompts for a chest with fuel it. This will be used if the turtle runs out of fuel. Recommended with maxfuel and doCheckFuel false

Receiver Parameter!
-modem: sets the side that the modem is on

#419 civilwargeeky

  • Members
  • 393 posts

Posted 22 November 2014 - 03:41 AM

Also, to anyone who reads this, I hope to eventually make a video series on all the cool different things you can do with the quarry now. I would do like a full tutorial, but that would be like half an hour long or more, and no one wants to watch that long :)

I hope to have a basic video that goes over the basics, maybe oreQuarry, then different parameters by grouping, like a fuel and enderChests video, then a quarry restarting video, then a miscellaneous video. I hope it will be useful and fun

#420 Kotawolf

  • Members
  • 26 posts

Posted 23 November 2014 - 12:42 PM

Not sure what it means, but may have found something.
Setup a quarry, 32x32

Left it to run overnight. It stopped about 29% in.
This is what I came back to: (Bah won't let me paste a screenshot apparently.

quarry: 262: Too long without yielding



I'll restart it, but thought you should know.
Note:
This was done with the update you posted
YTgKCcVy

MC 1.7.10, CC 1.65
If you need other information, just ask and I'll give you what I can.

I was able to restart it from the same spot, so the recovery/restart function worked perfectly.

Edited by Kotawolf, 23 November 2014 - 01:04 PM.






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users