This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
PonyKuu's profile picture

Turtle Swarm Quarry v0.3 and master/module APIs

Started by PonyKuu, 13 March 2013 - 07:27 PM
PonyKuu #1
Posted 13 March 2013 - 08:27 PM
Quarry version 0.3

Features:
- No gps requirement for modules. If there is no gps at all, master will use relative coordinates.
- System use only two modem channels for communication
- Modules that went too far to communicate to Master will return and receive a new task
- Modules mine 3 layers at once

Known bugs:
- Master should face South to work. Sorry for that. That's the issue with some placement code, dan200 said that it was fixed in 1.51. If not, i'll try to fix it by myself. Have an Idea, actually.

Usage:
1) Set up a gps system (if you don't want to do that, use relative coordinates)
2) Put down a wireless mining turtle at some elevation and a disk drive with a floppy disk in it as shown at the picture

3) Put some Ender Chests with some fuel in the first slot, some Ender chests linked to your sorting system in the second slot, and a bunch of wireless mining turtles into the third slot.
4) Copy all the files on the turtle's drive
5) Run "mastermine <xstart> <ystart> <zstart> <xsize> <ysize> <zsize>" where <xstart>, <ystart> and <zstart> are the starting coordinates of your quarry, and <xsize>, <ysize> and <zsize> is the size. Any size is OK, but it is not recommended to mine something less than 5x5.

More detailed explanation by Levorto:
Spoiler
  • If you want 5 turtles active, you put 5 enderchests of one color (e.g. orange) in the first slot.
  • This will from now on be your Fuel chest slot. Add 1 enderchest for each turtle you add.
  • Then you put 5 enderchests of another color (e.g. green) in the second slot.
  • This will from now on be your Output / Sorting chest slot. Add 1 enderchest for each turtle you add.
  • Now you should have 5 enderchests in the first AND second slot of the Main Controller Turtle.
  • Add 5 unlabeled mining turtles to slot 3 of the Main Controller Turtle.
  • Fill up the first enderchest - your Fuel chest - with coal/charcoal or another simple fuel source (try to avoid lava buckets).
  • I recommend automatically filling it with a hopper - e.g. place down a Fuel chest in your base, and place a hopper on top of it. You then place a chest on top of the hopper. In this chest you can add as much coal/charcoal as you want.
  • Install the four programs listed in the first post only on the Main Controller Turtle, using "pastebin get <program> <name>".
  • Do NOT install anything on the disk drive - keep it empty.

A modification to master API by Levorto that allows to use labeled turtles placed in a chest above the Master.
http://pastebin.com/SKKyFPiS

Downloads: https://github.com/PonyKuu/CC_Swarm

Pastebin:
master: http://pastebin.com/ZLh56Jmd
module: http://pastebin.com/b1eQmHRb
mastermine: http://pastebin.com/kLjirQgx
modulemine: http://pastebin.com/vdijtxSr

Old version:
Spoilermastermine has only 5 parameters:
mastermine <xstart> <ystart> <zstart> <xsize> <zsize>
master API: http://pastebin.com/J3i3TrjU
module API: http://pastebin.com/dULznkqY
mastermine: http://pastebin.com/MtLj3MfZ
modulemine: http://pastebin.com/N0truQQe
PonyKuu #2
Posted 15 March 2013 - 02:42 AM
New version. I didn't test it, though, so there are might be some mistakes and typos ^_^/>'
*deleted*

Probably fixed issues 2 and 3 since there are no restriction of only one turtle relocationg at the same time. Instead I'm using the "highway" navigation method suggested by Doyle3694 in this thread
PonyKuu #3
Posted 15 March 2013 - 11:56 AM
A working version is out!

Also I'm just wondering - is it interesting for anyone, or it's too primitive and everyone did that by himself?
yarma92 #4
Posted 16 March 2013 - 07:07 AM
Kuu, I think I just turned you into my own personal idol. Thankyou for figuring out how Eloraam did this :D/> Its a fantastic peice of code. I will let you know if any bugs crop up.

Yarma.
PonyKuu #5
Posted 16 March 2013 - 07:15 AM
Actually I don't know if Elo did that the same way I did…
I'm also planning to reorganize the code a bit and made a "module" and "master" APIs to allow making maybe other swarm-based programs.
Or just to make it a bit cleaner ^_^/>'
Maybe I'll add some GUI later, but I never wrote any GUI before, so, that's might happen not very soon… or not happen at all ^_^/>'
yarma92 #6
Posted 16 March 2013 - 07:40 AM
No need to rush. And it may not be the same way elo did it, but damn it does the same job haha :D/>
Nerox #7
Posted 16 March 2013 - 01:56 PM
Wow, I'll defiently set up one of these on my server :o/>

But the only problem is, that I don't really know how, lol. I don't know alot about turtles (and about 0.1% of programming), but I can follow the guide perfectly fine until step 6.
After feeding the turtle with what it needs, I placed a disk drive 2 blocks infront of it with an empty floppy in it, but then I don't know at all what to do..
I know the guide says "Copy all the files on the turtle's drive.." But… How?
It would be really awesome if you could go a little more in-deph in how to exactly do everything, so we turtle idiots can follow properly. :D/>
PonyKuu #8
Posted 16 March 2013 - 05:39 PM
You can use "pastebin get" command to get those files directly from pastebin. If you are on someone's server and there is http API enabled on that server, that's the only way, I think… If you have access to the save file of your world. <blah-blah>/minecraft/saves/computer/ There is set of folders with numeric names. Each folder has a name equal to some computer ID, you can copy the files to one of your computers/turtles just by placing them to a corresponding folder.
yarma92 #9
Posted 17 March 2013 - 12:55 AM
Another way is to have an auto typer do it but they can go a bit haywire from my experience.
Nerox #10
Posted 17 March 2013 - 05:00 AM
Alright, got it working, it's awesome.
However, do they continue after a logout on SSP? With a "modulestartup" I imply that they do, but it gives me an "startup:88: attempt to index ? (a nil value)" error after logging back into the world.
PonyKuu #11
Posted 17 March 2013 - 06:51 AM
No, they don't. Currently, they don't save their state, and master doesn't do it either. The error occurs because they try to get some data from master and master doesn't respond. I think I'll implement state maintainance eventually, but not now…
oxgon #12
Posted 17 March 2013 - 06:28 PM
Hello I would really like to get this working but i'm not sure what step 6 means.

6) Copy all the files on the turtle's drive and make a "modulestartup" containing this:
shell.run ("copy", "/disk/kuunet", "/kuunet")
shell.run ("copy", "/disk/navigation", "/navigation")
shell.run ("copy", "/disk/modulemine", "/startup")

shell.run ("/startup")

What is a modulestartup? I have copied 4 files to a floppy disk and the turtle. Placed disk drive in front 2 spaces so there is blank space. When trying to run program I get copy failed. I know I'm missing something here, thank you ahead.
PonyKuu #13
Posted 17 March 2013 - 06:41 PM
You should make this file and add those strings to it. It just a set of commands for a module to copy all the files on its hdd and run "startup" program
oxgon #14
Posted 17 March 2013 - 07:18 PM
OK as a complete 100% novice I didn't even know what a file was, did some research and figured it out. I just got it working, seems like I will need 2 ender chests for each turtle so it's time to do a lot more farming. Thanks.
oxgon #15
Posted 17 March 2013 - 08:37 PM
Hello sorry to bother you again, I really enjoy this so far but I was wondering if there is a way to change this up a little just so I can learn also.

When it calls for a turtle in slot 3 is there a way to have it keep checking so from 3-4 and so on then come back to 3? I like to keep my turtles refueled before hand vs having a refilling ender chest.


local function minerPlace ()
turtle.select (3) – select a turtle
turtle.place () – put it down

I'm not sure what code I would need to have it skip from 3 to 4 and so on.

Sorry to bother you, thanks. If you could just give me an example that would be great.
PonyKuu #16
Posted 17 March 2013 - 09:28 PM
You want to have turtles in slots 3 and 4? Actually, in some of my previous programs I made a function that selects an Item from inventory according to a sample in the slot. There was this function:

        --[[
      This function searches the turtle inventory for same item
      as in the given slot, or selects that slot if there are more than one item
      ]]--

    function searchItem (slot)
        turtle.select (slot)
        local found = 0
        for i=1,16 do
            if i ~= slot then
                if turtle.getItemCount (i) > 0 then
                    if turtle.compareTo (i) then
                        found = i
                    end
                end
            end
        end
        if found == 0 then
            if turtle.getItemCount (slot) > 1 then
                found = slot
            else
                turtle.select(1)
                return false
            end
        end
        turtle.select (found)
        return true
    end
oxgon #17
Posted 17 March 2013 - 10:45 PM
OK thanks for that so much!
But it seems there is a slight problem. When you Label a turtle it seems to give it a unique id so this script seems to only drop one and then lock up.

My goal was to load the 1st turtle up with 6 fully fueled turtles that are labeled and let them go, but maybe can't do that because of the id.


Maybe if it was set up like, if 1 blank go to slot 3 if slot 3 blank go to 4 and so on, skipping 2 of course. I've been trying to find some code like this but have been unable to so far.
Nerox #18
Posted 17 March 2013 - 11:17 PM
Hey.. here I am again.
I've played around a bit, and always ran into the same problem after some time.
If I start an excavation, it works perfectly fine until the turtles finish digging to bedrock the first time… after they go up, move to the new spot, most of them freeze.
The turtle itself says "Can't pass obstruction" (or similar) while it is in mid-air and has a flat ground beneath it.. also a few turtles continue without problems.

Here's an example of what I mean.. If that helps.
http://i48.tinypic.com/2lm289f.png
oxgon #19
Posted 17 March 2013 - 11:19 PM
Hey.. here I am again.
I've played around a bit, and always ran into the same problem after some time.
If I start an excavation, it works perfectly fine until the turtles finish digging to bedrock the first time… after they go up, move to the new spot, most of them freeze.
The turtle itself says "Can't pass obstruction" (or similar) while it is in mid-air and has a flat ground beneath it.. also a few turtles continue without problems.

Here's an example of what I mean.. If that helps.
http://i48.tinypic.com/2lm289f.png

Mine are doing the same thing
PonyKuu #20
Posted 18 March 2013 - 12:06 AM
They are probably went out of the range of the master's modem, so they can't get their next task. The ideal variant for the Master is to be as high as possible.
june012006 #21
Posted 18 March 2013 - 12:03 PM
I keep getting gps:69:attempting to convert nil from number. I tried adding a timeout to the locate command but that gives me "no gps found". I'm using tekkit lite.
oxgon #22
Posted 18 March 2013 - 03:52 PM
They are probably went out of the range of the master's modem, so they can't get their next task. The ideal variant for the Master is to be as high as possible.

Yeah that's what it seemed to be, I built a platform above and hasn't happen. Great program!
PonyKuu #23
Posted 18 March 2013 - 05:37 PM
I keep getting gps:69:attempting to convert nil from number. I tried adding a timeout to the locate command but that gives me "no gps found". I'm using tekkit lite.
Looks like your gps failed at some point. so timeout won't help… Are you sure you set up your GPS correctly? Does Master see all the satellites?

Yeah that's what it seemed to be, I built a platform above and hasn't happen. Great program!
Thank you!
Actually, it's possible to have them move to master when they can't get a task… That might be a good idea, but now I working on master API and module API.
oxgon #24
Posted 18 March 2013 - 06:07 PM
I keep getting gps:69:attempting to convert nil from number. I tried adding a timeout to the locate command but that gives me "no gps found". I'm using tekkit lite.
Looks like your gps failed at some point. so timeout won't help… Are you sure you set up your GPS correctly? Does Master see all the satellites?

Yeah that's what it seemed to be, I built a platform above and hasn't happen. Great program!
Thank you!
Actually, it's possible to have them move to master when they can't get a task… That might be a good idea, but now I working on master API and module API.

I can't wait for the update, keep up the good work!
oxgon #25
Posted 18 March 2013 - 07:24 PM
When I do a 64 x 64 no matter what it always goes to far because the master is always in top right of the 64x64 but like you said you are working on it. Just have to stick to smaller number for now, not a problem. Just wanted to give you some feed back :)/>
PonyKuu #26
Posted 18 March 2013 - 08:57 PM
APIs are amost done, but there are not very much new features… It's more like code reorganisation. But some of the features are:
1) Module ensures that he can place a chest before placing it
2) Modules don't use gps. Actually, all the system can run without gps, master will just use relative coordinates
3) Module that runs into any turtle dig()s it after 60-second timeout
4) Master now automatically creates startup file for modules
There are some things that I don't like for now, so I'll try to fix them.

It's kinda weird that they go too far at 64x64 because the modem range is much bigger, isn't it?

Modem range is increased with higher altitudes. If there is no thunderstorm, the range will always be higher than 64, and at max altitude you would have a range of 384 meters.
PonyKuu #27
Posted 19 March 2013 - 12:39 AM
I was thinking about something… And… well… Why all the modules request the channel, Master ID, Position and navigation zones from Master, if all those things are the same for each module? I think, they can read those things from disk! I think, I'll add this to APIs… So, some data will be stored on disk, and other data module will request from Master
oxgon #28
Posted 19 March 2013 - 07:20 AM
Wow I didn't know the higher you got the better the range. I went up to about 200 and everything is working perfect! I have a 64x64 going and so much crap that I have to have 3 recyclers going thats about with 15 turtles.
PonyKuu #29
Posted 19 March 2013 - 09:27 AM
And here comes version 0.1! As well as master/module API

Features:
- No gps requirement for modules. If there is no gps at all, master will use relative coordinates.
- You can have more than 64 modules. The downside is that Master keeps at least one of each chests and mining turtle as samples and don't place them
- System use only two modem channels for communication
- Modules that went too far to communicate to Master will return and receive a new task
- Modules now place chests more carefully
- Master and modules use new APIs

Known bugs:
- Master should face South to work. Sorry for that. That's the issue with some placement code, dan200 said that it was fixed in 1.51. If not, i'll try to fix it by myself. Have an Idea, actually.

Usage:
1) Set up a gps system (if you don't want to do that, use relative coordinates)
2) Put down a wireless mining turtle at some elevation and a disk drive with a floppy disk in it as shown in the picture
[attachment=1083:2013-03-18_23.58.13.png]
3) Put some Ender Chests with some fuel in the first slot, some Ender chests linked to your sorting system in the second slot, and a bunch of wireless mining turtles into the third slot. You can put any of this items everywhere in Master's inventory, if 63 modules is not enough for you. Just keep 16'th slot free, or refuel Master manually.
4) Copy all the files on the turtle's drive
5) Run "mastermine <xstart> <ystart> <zstart> <xsize> <zsize>" where <xstart>, <ystart> and <zstart> are the starting coordinates of your quarry, and <xsize> and <zsize> is the size. However, modules will mine the 4x4 squares, so the real hole size will be rounded down.

Downloads:
master API: http://pastebin.com/J3i3TrjU
module API: http://pastebin.com/dULznkqY
mastermine: http://pastebin.com/MtLj3MfZ
modulemine: http://pastebin.com/N0truQQe

I'll explain those APIs later, but anyways, there are some pretty good notes about using those APIs at the beginning of those files. It is also a lot of comments in the code.
Nerox #30
Posted 19 March 2013 - 11:53 AM
Alright, been trying that one out…
The first thing I'm not sure about… If you name a program, doesn't it have to be just one word, not like 2 with a space inbetween? If i type in "pastebin get J3i3TrjU master API" it names the program just master, instead of master API

And the second thing… I tried it out with 128 mining turtles (oh so much fun/lag) and it seems like they tend to mine each other… ended up with a bunch of wireless mining turtles in my storage chests. Could be my own stupidity, but I don't think that I did anything wrong.
PonyKuu #31
Posted 19 March 2013 - 04:02 PM
Well, you should name APIs just "master" and "module"? so that's OK
Turtle mine other turtle only if that turtle hasn't moved for 60 seconds, so I don't know what's happened there. Can you find out when they eat each other?
PonyKuu #32
Posted 19 March 2013 - 05:28 PM
Tested a 64x64 quarry with 127 modules. All worked fine except for one thing - one fuel chest was eaten by other turtle.
I added refuel commands to gotoOne and height functions, so, for now that's much less likely to happen. Downloads are the same.

P.S. These holes are big O_O
http://ompldr.org/va...19_08.33.39.png
PonyKuu #33
Posted 19 March 2013 - 08:06 PM
Alright, been trying that one out…
The first thing I'm not sure about… If you name a program, doesn't it have to be just one word, not like 2 with a space inbetween? If i type in "pastebin get J3i3TrjU master API" it names the program just master, instead of master API

And the second thing… I tried it out with 128 mining turtles (oh so much fun/lag) and it seems like they tend to mine each other… ended up with a bunch of wireless mining turtles in my storage chests. Could be my own stupidity, but I don't think that I did anything wrong.

Also, if you are still running into that problem, please do the following:
1) Find the functions forcePlaceUp() and move(direction) in module API.
2) Comment the lines waitTime = waitTime - 1 in those functions
3) Try to reproduce that bug. If it still occurs, you should find a bunch of turtles hanging somewhere and doing nothing. Please take a screenshot of that and post it here
oxgon #34
Posted 20 March 2013 - 01:48 PM
So far been running it with out any problems and seems to work better. It was funny at first because I had the disk drive set up like the first set up and turtle knocked it out lol.
PonyKuu #35
Posted 20 March 2013 - 05:32 PM
Yeah, it moves forward first now ^_^/>

OK, guys, this one is slow… Because Dire broke the Mining Well from Buildcraft… 5 seconds down to bedrock?! Come on, that's crazy!
https://www.youtube.com/watch?v=UPKNUaGXm0M
PonyKuu #36
Posted 21 March 2013 - 06:35 AM
OK, they can mine each other. Most commonly it occurs when fuel chest is empty and some of modules are waiting for refueling, while some other are not.
I think I'll remove the ability to mine turtles.
Simtimzero #37
Posted 21 March 2013 - 09:40 PM
This thing looks epic, im going to have to set up a turtle army soon =D Thx
Lirai #38
Posted 22 March 2013 - 03:18 AM
I keep getting gps:69:attempting to convert nil from number. I tried adding a timeout to the locate command but that gives me "no gps found". I'm using tekkit lite.

I'm encountering the same problem. gps is running just fine though, and it also runs into this error if I stop gps alltogether. Couldn't pinpoint the error yet.
LordIkol #39
Posted 22 March 2013 - 03:22 AM
Really Nice im working on a Fleet script too, i like your Idea of the Master Turtle, im Using a Computer as Server at the moment, using a Turtle to do Set Up the Turtles.
But mine will take a while until i can release it looking forward to see what Features you will add in the future.
CoolisTheName007 #40
Posted 22 March 2013 - 03:31 AM
In Module API

A little bit of pony magic is used to calculate how should it turn
lol
PixelToast #41
Posted 22 March 2013 - 03:34 AM
dont pull a __hithere and put derp comments in your code
i dont like mlp soz
other than that its awesome :D/>
PonyKuu #42
Posted 22 March 2013 - 03:51 AM
There are a lot of normal comments that explain how things work and a few jokes. About derp - that was just a joke about "tTasks [task.Task](task)" string.
About poniz, I like them. That's it.
Really Nice im working on a Fleet script too, i like your Idea of the Master Turtle, im Using a Computer as Server at the moment, using a Turtle to do Set Up the Turtles.
But mine will take a while until i can release it looking forward to see what Features you will add in the future.
Wel… I don't know. I want to add some GUI to Master eventually. And actually I don't want to mess up with state saving for now… Maybe because of my lazyness ^_^/>'
Other thing I'm thinking about - is that the APIs aren't actually useful for anything other than this quarry. Maybe APIs should contain only communication and navigation parts… Honestly, I don't know.
PonyKuu #43
Posted 22 March 2013 - 03:52 AM
I'm encountering the same problem. gps is running just fine though, and it also runs into this error if I stop gps alltogether. Couldn't pinpoint the error yet.
Latest version doesn't need any GPS actually. Master uses GPS if it finds it, but if there are no GPS it just usees relative coordinates considering that it is sitting at {0, 0, 0, 0}
oxgon #44
Posted 23 March 2013 - 06:40 AM
I know you said it works without GPS but do you have to put anything different in if you don't have GPS? Every time I try to mine without GPS the turtle goes to about 250 height and just starts going off in one direction and doesn't stop.
PonyKuu #45
Posted 23 March 2013 - 07:03 AM
Which parameters do you give to it? Actually, I tested it only without GPS…
Without it you should give relative coordinates assuming that Master is at {0, 0, 0} and facing positive X. And if you want turtle to go down that's negative Y, not positive.

I think your turtle was going somewhere… It just was… A bit far away ^_^/>'
oxgon #46
Posted 23 March 2013 - 09:34 AM
Yeah so I gave it X Y Z that the master is located. In the master it shows where it will be mining but it always just flies off and never stops. I didn't know about the negative Y so I'll try that. So if I want to mine at 80 and I'm at 180 I would need to do a -100 Y ?


So far I've been going to different Biomes that are far away and just setting up new GPS there and it's been working, but would like to have it working without that aspect.


Again, everything besides that is working amazing, great program and thank you!
PonyKuu #47
Posted 23 March 2013 - 10:30 AM
Yeah, -100 Y. And if you want it to mine starting at the Master's x/z position, that's 0, -100, 0, since Master doesn't know anything about its actual coordinates if there is no gps. So it decides that it is at 0, 0, 0. That's why Y would be negative in your case.
Lirai #48
Posted 24 March 2013 - 03:23 AM
I'm encountering the same problem. gps is running just fine though, and it also runs into this error if I stop gps alltogether. Couldn't pinpoint the error yet.
Latest version doesn't need any GPS actually. Master uses GPS if it finds it, but if there are no GPS it just usees relative coordinates considering that it is sitting at {0, 0, 0, 0}

And it just doesnt work. I tried without GPS, and it still throws that GPS error.
PonyKuu #49
Posted 24 March 2013 - 03:25 AM
New version simply cannot throw that error ~_~ Did you get it?
Lirai #50
Posted 24 March 2013 - 03:53 AM
Yes. Just to make sure I rm ed your programm and got it again just 10 minutes ago. Same result… andthere. I'm trying in the Nether atm … surely no gps there.

PS: there is GPS working in this world (just not the nether of course) thus I'm sure the gps programm works just fine.
PonyKuu #51
Posted 24 March 2013 - 05:02 AM
O-okay, what does it print to you? And which version of CC do you use?
Lirai #52
Posted 24 March 2013 - 08:43 PM
gps:69: attempting to compare nil with number

and CC 1.481

Line 69 (and 70) in gps reads:
while timeElapsed < timeOut and (p1 == nil or p2 ~= nil) do
local sender, message, distance = rednet. receive( timeOut - timeElapsed )

Somehow you seem to give gps a value where it expects nil. Btw, gps all by itself runs just fine (or in this case returns that no gps is present).
PonyKuu #53
Posted 24 March 2013 - 08:50 PM
I have no idea what happens there. Did you also downluaded a new module program and API? Because module doesn't use gps at all and master use it only once.
theoriginalbit #54
Posted 24 March 2013 - 08:58 PM
try changing on line 331 and 341 of master api to this


gps.locate(nil, true)

it should print out some debug info so you can see whats going on…

also I notice that you do not open the gps channel when attempting to locate.


modem.open( gps.CHANNEL_GPS )
PonyKuu #55
Posted 24 March 2013 - 09:05 PM
Oh my, that was changed? I thought it works like it was before… I thought they do not change things that break existing programs…
But anyways, there are only two gps calls, so why in the hell it can make that error?

OK, fixed that, I think…
theoriginalbit #56
Posted 24 March 2013 - 09:08 PM
using rednet api might allow it to still work, but if you're going to use channels then you gotta do it the new way.

idk, thats why I suggested look at the debug info.
PonyKuu #57
Posted 24 March 2013 - 09:13 PM
The problem is that I don't get that error at all >_<
Lirai #58
Posted 24 March 2013 - 09:36 PM
Give me a few mins, my turtles are almost done with the commone OreQuarry :D/>
Lirai #59
Posted 24 March 2013 - 09:37 PM
Btw, would you consider adding suh a functionality to your program? So that no strip mining would occur, but instead selective mining for ores only, omitting certain blocks? Would speed up the mining process.
PonyKuu #60
Posted 24 March 2013 - 10:07 PM
I'm not sure. Unfortunately that would cause some changes to the APIs, if I understand the algorithm correctly… There are some things with these API I don't like actually, but I'm not sure how to fix that. Basically those APIs are not very easy to use with programs other than these mastermine/modulemine pair or similar.
Lirai #61
Posted 24 March 2013 - 10:10 PM
OK, tried it WITh the changes suggested at line 331 and 341 … and still throws the same error.
theoriginalbit #62
Posted 24 March 2013 - 10:16 PM
but does it print anything first?
Lirai #63
Posted 24 March 2013 - 10:19 PM
Finding position …
gps:69: attempt to compare nil with
number
PonyKuu #64
Posted 24 March 2013 - 10:21 PM
I don't know ._.
I use CC v1.5, so maybe that's the reason? Redownload all the files please and try again… I fixed the mistakes TheOriginalBit noticed
Lirai #65
Posted 24 March 2013 - 10:31 PM
OK, now it seems to work, but stalls when it has moved forth and back and selected the first trutle. Btw, I labeled my turtles (to keep fuel status), might this cause a problem?
PonyKuu #66
Posted 24 March 2013 - 10:35 PM
Yes. It always keeps one turtle in its inventory to compare it to other inventory slots and find more turtles, same for the chests. It is useful if you want to use more than 64 modules. And I think, "turtle.compareTo()" returns false when you try to compare different labeled turtles. So, it thinks that it has only one turtle, and it can't place it.
Lirai #67
Posted 24 March 2013 - 10:38 PM
OK, I gave it now 3 unlabeled turtles. its facing south, discdrive with an empty disc is southeast. Command is mastermine 3 0 0 8 8, it starts, moves forward and back … and stalls again

And if CTRL-t is done:

master:265: attempt to call nil
PonyKuu #68
Posted 24 March 2013 - 10:39 PM
And what about Ender Chests?
Lirai #69
Posted 24 March 2013 - 10:41 PM
Why does it throw an error when it tries to close the modem? o.O

One ender chest in first slot, containing charcoal, one empty ender chest in second slot, 3 turtles in 3rd.

I assume it needs 2 of each ender chest? :D/>
PonyKuu #70
Posted 24 March 2013 - 10:45 PM
It needs one of each chest for each turtle and one spare to compare to other slots… Also, I'm not sure. Maybe 64 turtles is more that enough, so it should just use them all and forget about other slots… That might help if you are low on chests/turtles, so you wouldn't have to make extra ones that it never would use…
Lirai #71
Posted 24 March 2013 - 10:49 PM
^^ would be helpfull for starting players yeah. Btw, with 2 of each it gets further … but stalls when the module calls the master, and the master has a closed modem (module throws a module:470)

the master stalled with a master:265
PonyKuu #72
Posted 24 March 2013 - 10:56 PM
265 is modem.closeAll() That's weird… maybe this function didn't exist in 1.481…

I don't know… It seems like modem API has changed between 1.481 and 1.5… Does someone know what exactly has changed?
theoriginalbit #73
Posted 24 March 2013 - 10:58 PM
heaps changed. channels were added in 1.5
Lirai #74
Posted 24 March 2013 - 11:00 PM
I would switch to 1.5 … but playing on a tekkit lite server v5.7 … and given the explosion of requirements for 6.1 (3x the requirements) the admins are reluctant to change the version.

so BIT any way to get it working anyway?
PonyKuu #75
Posted 24 March 2013 - 11:01 PM
Redesigned Wireless Modems; they can now send and receive on multiple channels, independent of the computer ID. To use these features, interface with modem peripherals directly. The rednet API still functions as before.
THIS IS BAD…
It seems like in 1.481 there are just regular rednet API… I designed the program to use modems from 1.5 - those channels and stuff…
So, unfortunately, to get it working with 1.481 I have to change the communication parts in APIs ~_~
Lirai #76
Posted 24 March 2013 - 11:05 PM
Or I have to get the admins to go for a version that allows only 1/3 of the people grmpf.
PonyKuu #77
Posted 24 March 2013 - 11:20 PM
*Sigh*
I'll try to think about it, but not now, I'm sorry, I'm just not in "coding mood" now… Those changes are not THAT hard, they just annoying to make…
Lirai #78
Posted 24 March 2013 - 11:29 PM
Understandable :D/>
Lirai #79
Posted 25 March 2013 - 10:21 AM
Would it be possible to add channels to turtles by just replacing the OS? After all, it's just software isn't it?
PonyKuu #80
Posted 25 March 2013 - 04:54 PM
I don't think so. AFAIK those OSes are just shells with some whistles, while the problem is API
PonyKuu #81
Posted 25 March 2013 - 10:42 PM
That was a bit easier than I thought…

1.481 - compatible version. Be careful, it uses broadcasts to communicate.
module API: http://pastebin.com/MZEPY5vN
master API: http://pastebin.com/mzAa07Wn
mastermine: http://pastebin.com/FfuqQ8XB

modulemine is the same. Didn't test it though…
Lirai #82
Posted 26 March 2013 - 02:09 AM
With one module it works like a charm, building more enderchests now :D/>
PonyKuu #83
Posted 26 March 2013 - 02:13 AM
Hehe, I don't have a single Ender Chest in my legit world yet ^_^/>' Can't find a fortress ._.
All the testing I do in testing worlds with NEI
Lirai #84
Posted 26 March 2013 - 02:39 AM
You do know that you can use a minium stone, dont you? 4 iron = 1 ender eye.
PonyKuu #85
Posted 26 March 2013 - 02:50 AM
I know. But you can't do that for blaze rods… I have to find a Nether Fotress, and not die in there…
Lirai #86
Posted 26 March 2013 - 03:01 AM
^^ Yeah, and you only need one blaze rod ;)/>
yarma92 #87
Posted 26 March 2013 - 03:02 AM
Kuu, I have found a small problem, the turtles are not mining where instructed.

mastermine -49 63 912 16 16
Module 1 is mining at {-37, 63, 924}
Module 2 is mining at {-37, 63, 920}
Module 3 is mining at {-37, 63, 916}
Lirai #88
Posted 26 March 2013 - 03:10 AM
And the ytend to eat the master :D/>
PonyKuu #89
Posted 26 March 2013 - 03:11 AM
^^ Yeah, and you only need one blaze rod ;)/>
Really? I thought I need four of them for each chest ~_~
Kuu, I have found a small problem, the turtles are not mining where instructed.

mastermine -49 63 912 16 16
Module 1 is mining at {-37, 63, 924}
Module 2 is mining at {-37, 63, 920}
Module 3 is mining at {-37, 63, 916}
Are you sure? They start from the furthest square and then mine each of them…

in your case it seems like they took these squares:

			 x 3 2 1 <- {-37, 63, 924}
			 x x x x
			 x x x x
{-49, 63, 912} -> x x x x
PonyKuu #90
Posted 26 March 2013 - 03:15 AM
And the ytend to eat the master :D/>
Umm… what is the position of the Master? I think, you told them to mine at higher y than Master's and in the same zone…
yarma92 #91
Posted 26 March 2013 - 03:16 AM
Yup, tyhats deifinately what they were doing… And the turtle was facing south. Gonna build a second gps platform and see if it helps.
PonyKuu #92
Posted 26 March 2013 - 03:18 AM
And what's wrong? That's how it works. At the end they'll mine the whole 16x16 area.
yarma92 #93
Posted 26 March 2013 - 03:26 AM
They are mining out the wrong chunk haha!

This is what you said they are doing.

						 x 3 2 1 <- {-37, 63, 924}
						 x x x x
						 x x x x
	   {-49, 63, 912} -> x x x x
However -37, 63, 924 is a different chunk :S It is the chunk to the east of the one I want them to mine.
Edited on 26 March 2013 - 02:32 AM
Lirai #94
Posted 26 March 2013 - 03:29 AM
^^ Yeah, I forgot to give them a +1 so taht the master wouldnt be in the mining area.
PonyKuu #95
Posted 26 March 2013 - 03:32 AM
They are mining out the wrong chunk haha!
Awww… But it seemed to work for me… Are you sure that your gps is correct? Does master see the gps and get the correct coordinates from it?
yarma92 #96
Posted 26 March 2013 - 03:35 AM
Yes the co-ordinates the master is saying they are mining at are the correct ones the turtles are actually mining at and gps.locate is giving the correct location as well :S
PonyKuu #97
Posted 26 March 2013 - 03:42 AM
A-a-and? You didn't want it to mine at that location? ._.
You said to the Master "mine an area of 16x16 starting at -49, 912"
That's all the area between {-49, 912} and {-33, 928}
That's exactly what they are doing…
yarma92 #98
Posted 26 March 2013 - 07:32 AM
problem was Kuu it was not starting at -49 912, it was starting at -33, 928 and mining across left to right towards -49, 912. I wanted it to start from -49, 912 and mine 16*16 from there. Sorted in the end by shifting the cords by 16 to -49, 918 so it would start at -49 912 and mine 16x16 from there to the right of that point.
PonyKuu #99
Posted 26 March 2013 - 08:06 AM
That's just the way you deal with coordinates… When 1.51 would be available to all the "tech" people I hope there won't be that "South only" restriction. And that's mean that it wouldn't know anything about "left" and "right" parts. It always mines from the highest x and z to the lowest ones. The lowest are that you specify as xstart, zstart, and the highest ones are xstart+xsize, zstart+zsize.
I know, that's might be confused, because the "start" square is actually the one that's mined last, but the area is specified correctly.
Lirai #100
Posted 27 March 2013 - 04:56 AM
Ok something weird happend. When I tried the turtles outside of the nether (after a ghast blasted my mining site) … they are having incredible difficulty with bedrock. Apparently without gps there is no way for them to know when t stop to dig down.
PonyKuu #101
Posted 27 March 2013 - 06:09 AM
Actually, they stop digging after they hit something they can't dig… That means bedrock. Does Nether have a bedrock layer?
Lirai #102
Posted 27 March 2013 - 06:31 AM
It even has two. But in nether I did usually send them up … and it seems I got lucky when they dug down to the lower bedrock layer. Would it be possible to give them a "height" as optional parameter (only if gps is not active) which limits how deep they dig?
PonyKuu #103
Posted 27 March 2013 - 06:41 AM
That would be not very hard… Please, wait a bit, since I'm messing with APIs again…
And you still need 1.481 version? It's kinda sucks since I have to make two versions… rednet API is backward-compatible, but I don't like rednet-based solution…
Lirai #104
Posted 27 March 2013 - 06:51 AM
I'm still trying to get our server owner to switch to 6.1
Lirai #105
Posted 27 March 2013 - 07:30 AM
You know what would be an even more important change? To reduce the number of turns. As it is now, the turtle has to turn twice for every 4 blocks dug. Basically its:

dig
move
turn
dig
move
dig
move
dig
move
turn

10 actions per row. At the end of the layer the turtle even turns twice if I saw it correctly. So 41 actions per layer, at 58 layers (ocean level to bedrock) thats 2378 actions, plus one way … ~ 2500+ actions. at 0.4s per action thats 16+ Minutes or roughly 1 sec per block mined.

If you change it like this:

dig down
move down

dig forward
dig down
move down

repeat the last 3 steps 56 times

dig down
dig forward
move forward


repeat the last 3 steps twice


dig forward
dig up
move up

repeat the last 3 steps 57 times

dig forward
move forward
turn right
dig forward
move forward
turn right

and you are at the second row…

Overall you should be able to get by with <1500 actions in this pattern. Thats 600 seconds or 10 minutes, 6 minutes less then the current pattern. A reduction by 40%. I think well worth it.
PonyKuu #106
Posted 27 March 2013 - 07:38 AM
So, you basically suggesting to move vertical instead of horizontal? It might work nice, but the problem is that the bedrock is not a flat surface. It is a random mess of randomness, so turtle could trap itself…
Lirai #107
Posted 27 March 2013 - 07:48 AM
You might be able to reduce time needed even more if you get away from 4xyx4 diggings.

One option would be to calculate which of the three dimensions is the shortest. Each turtle would then be assigned a layer of this shortest dimension, and make most moves along the longest dimension.

Example:

The hole to be dug is:

16x58x4

In your current setup this would be a job for up to 4 turtles each digging a 4x58x4 shaft. 4x16 = 64 turtleminutes.

If you calculate it differently, each turtle would dig a layer 16x58x1, with the y Axis being the one used for the most movement. If the user supplied 16 turtles, each turtle would be assigned a 4x58x1 layer, thus, once down, once up, always digging front and up/down. Roughly 38 turtleminutes in both cases, though the 16 turtles could be done in ~ 2.5 minutes.
Lirai #108
Posted 27 March 2013 - 07:54 AM
So, you basically suggesting to move vertical instead of horizontal? It might work nice, but the problem is that the bedrock is not a flat surface. It is a random mess of randomness, so turtle could trap itself…

Honestly, I dont care much about bedrock. Just let the turtle stop at level 5. It doesn't dig a few ressources? Who cares? In the time it would need to work out where the stuff in the bedrock is, it can dig dozens of blocks … In the end the payout will be higher this way. And if there is only limited area to be mined … the player can always manually search the bedrock anyway.
PonyKuu #109
Posted 27 March 2013 - 08:09 AM
Well, sometimes it just doesn't know where is the layer 5. It can run without GPS, by the way… Actulally it is possible to set a "stopY" as extra parameter…
I'll think about that. My APIs allow to do such changes without remaking the whole program….
PonyKuu #110
Posted 27 March 2013 - 08:17 AM
You might be able to reduce time needed even more if you get away from 4xyx4 diggings.

One option would be to calculate which of the three dimensions is the shortest. Each turtle would then be assigned a layer of this shortest dimension, and make most moves along the longest dimension.

Example:

The hole to be dug is:

16x58x4

In your current setup this would be a job for up to 4 turtles each digging a 4x58x4 shaft. 4x16 = 64 turtleminutes.

If you calculate it differently, each turtle would dig a layer 16x58x1, with the y Axis being the one used for the most movement. If the user supplied 16 turtles, each turtle would be assigned a 4x58x1 layer, thus, once down, once up, always digging front and up/down. Roughly 38 turtleminutes in both cases, though the 16 turtles could be done in ~ 2.5 minutes.
Well, that's a bit harder… And I have to use Y axis as "longest" anyways, or develop a new navigation method…
Lirai #111
Posted 27 March 2013 - 08:18 AM
^^ Also take into account: a turtle can dig three blocks for each move, if those blocks are forward, down and up… So you might even be right to go for horizontal movement for large digs, but only if the turtle mines the layer below and above at the same time as the current layer.

The theoretically limit you could approach is 3 blocks dug in 1.6 seconds (3 digs, one move). Practically anything below 0.6 sec per block is very good.
PonyKuu #112
Posted 27 March 2013 - 08:23 AM
Well, the issue is the same - possible trap under bedrock. But that's possibility, if you can specify Y at which it will stop mining.
But I actually like your "linear" mining idea. all the XxYxZ area can be divided into slices 1xYxZ or XxYx1 and master will distribute those slices between modules….

*sigh* But that won't be as fast as Dire's mining well nonsense anyways…
Lirai #113
Posted 27 March 2013 - 08:29 AM
Well, that's a bit harder… And I have to use Y axis as "longest" anyways, or develop a new navigation method…

Then I'd go like this:

First turtle digs down and forward till level 6.
From there on its dig: forward, up, down, move forward.
Once it reaches the end of the longest of x or z, it moves/digs up three times, turns 180 degree
Repeat step two and three (but omitting the blocks already dug on the way down) till it reaches the surface

The second (and each following) turtle doesnt follow the first, but does the very same with the second (and following) slice of the shortest dimension.

This is perfect if you have as many turtles as is the longest dimension.

If you have half of that number, the turtles dont ascend three layers and turn 180 degree at the end of each row, but instead turn 90 degree, move once, turn another 90 degree and dig a second row in the opposite direction. Its a spiral.

If you have more turtles than slices of the shortest dimension … then you have to divide the work differently. ;)/>
Lirai #114
Posted 27 March 2013 - 08:37 AM
*sigh* But that won't be as fast as Dire's mining well nonsense anyways…

Sure. But I dont have to leave home to send my turtles, especially if I combine your program with programs to maneuver the master to its place and monitor it from home.
Lirai #115
Posted 27 March 2013 - 10:37 AM
Yihaa, server owner updated "for a test" to 6.1. and thereby CC 1.5. lets hope it stays that way.
Lirai #116
Posted 28 March 2013 - 11:06 PM
And managed to crash the server … back to tekkit lit 5.7 -> CC 1.481
PonyKuu #117
Posted 29 March 2013 - 01:39 AM
Grr… I have to think about something that can make this easier to maintain… ~_~
theoriginalbit #118
Posted 29 March 2013 - 01:39 AM
Grr… I have to think about something that can make this easier to maintain… ~_~
GitHub…
Lirai #119
Posted 29 March 2013 - 01:59 AM
^^ The admin did a complete server restart, now it works. :D/>
PonyKuu #120
Posted 29 March 2013 - 02:02 AM
GitHub…
Yeah, I'm trying to figure out how to use it ^_^/>'
^^ The admin did a complete server restart, now it works. :D/>
CC 1.5 works? Yay.
Lirai #121
Posted 29 March 2013 - 03:31 AM
Yeah, have to rebuild everything from scratch but yes.
PonyKuu #122
Posted 29 March 2013 - 03:44 AM
Nice. So, let's work on our slicing quarry ^_^/>'

I actually made a quick prototype, and it is working pretty well for small quarries. And, actually, it will work very well for big quarries as well. Just have to make a good distribution function, that takes into account size of the quarry and available modules…
Lirai #123
Posted 29 March 2013 - 06:10 AM
Sounds great :D/>
Lirai #124
Posted 29 March 2013 - 09:04 PM
OK some more efficency calculations:

first baselines:
  • a turtle that digs a 1m&sup2; wide trench has a max speed of 1m per 0.8s (one dig, one move). That's 4,500 bph (blocks per hour).
  • the same turtle digging a 2m high trench has a max speed of 1m per 1.2s (two digs, one move). Still that's 6,000 bph.
  • and finally a 3m high trench means a max speed of 1m per 1.6s (three digs, one move). Only 6,750 bph.
So the major effect for efficency comes from the second block mined per move. The third block mined is a mere 12.5% win, which can be negated if the overhead gets to high to achieve it.

The costs for overhead (digging to the place, traveling to the chest, turning, checking for ore) depends on many factors, but most importantly on the layout of the "slices". Let's assume a worst case, and best case.

Worst case: a 4x58x4 hole, dug from bottom up, one block per move. Yeah, actually this is the worst case, as it maximizes the turns and movements needed.
Best case: a 144x57x144 quarry. Thats the best you can do without world anchors, as this is the number of chunks a single player keeps loaded.

Worst case:

The turtle moves forward once [1], then digs down 58 [116] and starts it's routine with 41 actions per layer [2378]. If we assume that it empties it's chest twice [~2x20] then it will reach it's starting point after a tad less then 2500 [2477] actions of 0.4s each … 1,000 seconds for less than 1,000 (928) blocks mined. If only 5% of those blocks where air in caves, this gets down to an even more unimpressive count of ~3200 bph. The overhead (turns and moves not directly coupled to successfull digs) would be a whooping 100%.

Best case:

A single turtle doing the gigantic area. Moves forward once, digs down twice [5]. Each row takes 582 actions, each (triple) layer 83,814 actions, the whole dig [1,592,466] actions. Add to that a chest emptying every ~512 blocks dug [~2308x20] and the move back [~200] and you end at ~ 1.64 million actions or 182 hours. Only 7 hours of those are "overhead", 175 hours are spend dig-moving. So an overhead of at least 4% seems inevitable.

Out of those 1.639 million actions, 1.576 million are directly related to move-digs, 0.046 million are for chest actions and 0.017 are turns. But depending on the number of caves, a large number of digs was … empty air. How many caves are there? Is it as much as 5% or less?

Let's start with the simplest option for optimization: chest actions. module.checkSpace() takes one tick, right? Theoretically a turtle could be full after 14 digs … practically I'd guess even in Feed the Beast with it's many different ores, in a heavy ores Mystcraft world only 10% of the mined stuff would be usefull … btw. Is there a way for a turtle to "vaporize" cobblestone? So assuming a rather difficult environment, checking every time it digs (as I understand your code, is that correct?) seems a bit over the top. I'd check every 4 moves (12 digs) max, or design a function to check only if the turtle can't move. This might even be the most practical way: if it can't move, check if it's due to being full. Oh and I'd only check slot 15. ;)/>

Next: checking for empty air. If you add a "check" before every dig, that raises overhead by a whooping 10% (1.75s per 3dig-move instead of 1.6). But: it cuts down the number of unneccessary digs. If 300 blocks are mined at a standard 3 dig-one move pace, that will take 62.5 seconds. If 5% of those blocks are empty and we do a check before every dig, we've got 300 more 1 tick checks, but 15 less 8 tick digs. So the break even point for checks vs. digging empty air would be at 12.5% So definitely not worth if digging in the ground.

Still you might consider adding such a function … but use it only if the user calls a parameter (like C for check?) Cause it can be worth it if you dig very uneven terrain, or the nether, or a skyblock terrain. The break even point as said is one out of eight blocks "empty". Btw … is there an easy way to check for air, water or lava? Cause all three can be considered empty, can't they?

The most difficult beast to tackle is slice distribution though … that I'll have a look into after breakfast.
PonyKuu #125
Posted 29 March 2013 - 09:24 PM
That is a lot of words! ^_^/>

1. It have to check inventory every time it digs. turtle.getItemCount() is almost instant - check that by running this:

for i = 1, 1000 do
    local count = turtle.getItemCount (16)
end
It won't run for 50 seconds, it finishes almost instantly.
And a simple example, why you should check every move: turtle is full of stuff, but slot 16 is empty. It digs a piece of cobble, it goes in slot 16 and then it digs a diamond which is dropped to ground.
2. Digging the air doesn't take 8 ticks. I think it takes only a tick or something like that.
3. And while you talking about efficiency, don't forget that max speed is reached by using all the modules available. That's the main goal. Area distribution has a lower priority. Of course we are using 3-blocks-per-move method.
4. The most efficient way to dig 4-long slice is
1) Go down/dig forward
2) move forward twice
3) Go up/dig forward.
Nerox #126
Posted 30 March 2013 - 12:55 PM
Okay, I've been using this (awesome) program for a while now on a (legit) server.

I've so far however encountered a problem:

It is that some modules (around 3 of 64 (in my case)) are getting stuck in the process. That happens because the turtle somewhy doesn't consume the fuel it grabbed from the fuel ender chest. That ends in fuel (in my case charcoal) getting stored in slot 1 while the fuel-ender-chest then is stored somewhere else in the module'e inventory. Results in the module to stop.

But beside that.. loving this program so much. Already dug out around 20 iridium and felt 3000 stacks of ores. :D/>
xInDiGo #127
Posted 30 March 2013 - 03:39 PM
mastermin30: attempt to index ? (a nil value)

after installing the API as moduleAPI and masterAPI and the other as Mastermine and Modulemine i was getting that error. i've placed the items as i see in the image, with a blank disk in the disk drive south east to the turtle. the turtle is facing south.
PonyKuu #128
Posted 30 March 2013 - 05:09 PM
Okay, I've been using this (awesome) program for a while now on a (legit) server.

I've so far however encountered a problem:

It is that some modules (around 3 of 64 (in my case)) are getting stuck in the process. That happens because the turtle somewhy doesn't consume the fuel it grabbed from the fuel ender chest. That ends in fuel (in my case charcoal) getting stored in slot 1 while the fuel-ender-chest then is stored somewhere else in the module'e inventory. Results in the module to stop.

But beside that.. loving this program so much. Already dug out around 20 iridium and felt 3000 stacks of ores. :D/>
Do you auto-resupply the fuel chest with some fuel? This might happen if chest has no empty space while module tries to put fuel back.
I guess that it's better to let it eat all the fuel it has rather than stuck, so I'll think about it…
mastermin30: attempt to index ? (a nil value)

after installing the API as moduleAPI and masterAPI and the other as Mastermine and Modulemine i was getting that error. i've placed the items as i see in the image, with a blank disk in the disk drive south east to the turtle. the turtle is facing south.
you should name APIs "master" and "module". And module script should be "modulemine".
lewanator1 #129
Posted 31 March 2013 - 03:59 PM
Is there somthing I can edit out in the code to make him deploy ALL turtles so it doesnt keep one to compare (I'm a noob)
PonyKuu #130
Posted 31 March 2013 - 05:08 PM
Just wait for the next version ^_^/>' I removed that feature, because I thing that 64 modules is more than enough
Lirai #131
Posted 02 April 2013 - 01:14 AM
Any idea when you'll publish it?
Shnupbups #132
Posted 02 April 2013 - 01:15 AM
Any idea when you'll publish it?
Congratulations! You just posted the 18,500th reply in this section of the forums! Not that anyone really cares. Oh well.
PonyKuu #133
Posted 02 April 2013 - 03:41 AM
Any idea when you'll publish it?
I'm sorry, I was quite busy today and quite lazy yesterday… The only thing that's left to do is develop a distribution method for Master. Module code is working now, but slicing quarry requires a bit more complicated module distribution…
Lirai #134
Posted 04 April 2013 - 10:52 PM
^^ So how is it going?
PonyKuu #135
Posted 04 April 2013 - 11:05 PM
I think it almost working. I made a recursive distribution algorithm, and changed a bit maneuvering logic for modules, so they shouldn't stuck under bedrock. I have to test it first, and I'll do it this evening.
PonyKuu #136
Posted 05 April 2013 - 08:55 PM
A new version is out!

GitHub link: https://github.com/PonyKuu/CC_Swarm

Mastermine now requires 6 parameters: xstart, ystart, zstart, xsize, ysize, zsize
so you can specify the depth of your quarry.
Quarry can be any size, because now modules mine using a different pattern.
Lirai #137
Posted 05 April 2013 - 10:19 PM
I'll ttake a look soon. Btw, can you support lava buckets?
PonyKuu #138
Posted 05 April 2013 - 10:27 PM
Well, that might work even now, but you should supply the fuel chest with lava buckets AND always leave one empty slot in that chest. Or you want modules to carry a bucket and use it if they finde some lava?
Lirai #139
Posted 05 April 2013 - 11:02 PM
Basically I was thinking about both options.

Load the fuel chest with lava buckets, have the modules consume them but keep the buckets till they either have to unload (and then drop the empty buckets in the ore chest) or fill them with lava if the find it, whatever happens first.
PonyKuu #140
Posted 05 April 2013 - 11:56 PM
Well, I'll think about it. But I'm not sure.
VerTiGo_Etrex #141
Posted 06 April 2013 - 11:45 AM
Hey, I have a few bugs to report.

First, in relative coordinate mode, you've got the x and z coordinates the wrong way around. Z should be forward depth, and X should be side to side, right? I've got the master facing south, like you said.

Also, when turtles are returning to the master, you can get a rare bug where they run out of fuel in the "stack" and can't place their fuel fairly common bug where turtles can't place their sorting enderchest above them since there are turtles there. They seem to do it right before they are broken by the master.

Other than that, fantastic job. The 3 level slicing scheme is extremely fast!
PonyKuu #142
Posted 06 April 2013 - 06:23 PM
1) It's how it is supposed to be. South restriction won't be there forever, it should be fixed in 1.51. I just decided to say that master is facing positive x, since there is no way to determine that without gps…

2) They supposed to return to Master from below, not from above, so that won't be an issue. Is it necessary for you to make them move higher than Master?
PonyKuu #143
Posted 06 April 2013 - 06:34 PM
Actually, if you want them to come from above, it's easy to fix…
Done. They now place chest after moving forward, so other modules that come from above won't interfere. They shouldn't place fuel chest while moving down, since they do that BEFORE they move down, so, chests shouldn't be an issue anymore.
VerTiGo_Etrex #144
Posted 06 April 2013 - 07:57 PM
Dat one line fix… Nicely done, it's pretty robust now that we've got that out of the way!
PonyKuu #145
Posted 06 April 2013 - 08:25 PM
Yay!
Lirai #146
Posted 07 April 2013 - 09:26 PM
^^ had no chance tio test it, as I moved to a FTB server (yay magic AND bees) but what I read sounds promising. :D/>
macktruck6666 #147
Posted 08 April 2013 - 11:11 AM
Okay guys, I can't get it to work.

I manually copied the raw data from the link on the first post and created files without file extensions
I copied the files from the in-game disk to the turtle using
cp /disk/master master
cp /disk/mastermine mastermine
cp /disk/module module
cp /disk/modulemine modulemine

I put enderchests in the first and second slot and turtles in the third.

I ran the command
mastermine -283 64 205 10 40 10

It outputs
"No gps found. Using relative coordinates"

The inventory selection is now #16 and it won't do anything.

Any ideas? I tried making sure I copied everything correctly.
PonyKuu #148
Posted 08 April 2013 - 11:29 AM
I think it tries to refuel. I'm sorry, refuel code is pretty simple and it doesn't check whether it really placed a chest. Modules use more advanced version of refuel function, so that won't happen for modules.
Terminate the program, and try again, but make sure that it can place a chest above itself.
macktruck6666 #149
Posted 08 April 2013 - 11:44 AM
Okay, got it kinda working. Have the master facing south on Reis minimap, they turtle's are placed facing west and they starting travelling very far away.
PonyKuu #150
Posted 08 April 2013 - 05:33 PM
That's because you don't have gps. How do you think Master will know what's its current position? If it don't find GPS, it thinks that it is at {0, 0, 0, 0} And I'm not sure why turtles are facing West. Do you have a solid block right below the block in front of Master?
per #151
Posted 10 April 2013 - 11:13 AM
I've been testing this on my test world for a while now..and I just created a 16 strong swarm on the server I play..and…WOW..kickass stuff man!

Love what you have been doing so far! Keep it coming :)/>
PonyKuu #152
Posted 11 April 2013 - 03:55 AM
Yay. thank you!
Nerox #153
Posted 11 April 2013 - 03:57 AM
Hey again!

Been using the new version on my server for a while now. 64 modules just need around 4 hours digging a 112x90x112 hole, which is kickass.

However, I have 3 things I'd like to suggest.

First of all, the new version doesn't seem to support having more than 64 modules at once. It'd be very nice to have that feature added back in.

Further on, since the mastermine command now requires a Y-size-coordinate, would it be possible to add an optional "ignore height"? I mean, it sometimes happens that I get disconnected or the server restarts, therefore do the modules stop (even though it's chunkloaded… that's how my server works), and if they already dug about 50 levels, it's not that nice to reset them at the very top.
So as example, I did set the master up at X16 Y80 Z16 and told it to dig a 64x75x64 hole to the start of bedrock. In the middle, modules at around Y 50, I get disconnected and the whole mining process stops.
Then I'd run the command "mastermine 16 80 16 64 75 64 25". The red highlighted number would be the number each module, after it got to it's position, goes down before starting the mining process.
It'd be pretty time and fuel saving… However, just a suggestion. :)/>

And at last…The last 2 modules (if the number of modules are the same as the X-size) do dig up the disk drive (dropping the floppy on the ground, letting it despawn) and the master blocks the last module from mining.
PonyKuu #154
Posted 11 April 2013 - 09:00 PM
1) Well, I'm not sure if I want to add it for now… In the new version of APIs I added an option to disable or enable fuel or stuff chests and thus it's a bit harder to make it work that way again.

2) You already can do that by changing ystart parameter. if you want modules to mine starting at height 40, then set ystart to 40

3) It seems like you set your quarry location {xstart, ystart, zstart} the way that it contains disk drive. I suggest you to set ystart at least 5 blocks lower than master's height to avoid such things
firerebel #155
Posted 13 April 2013 - 07:29 AM
So I need two enderchests per turtle in the master turtles inventory?

Also what happens when a restart of the server occurs?
PonyKuu #156
Posted 13 April 2013 - 08:01 AM
Yes you need.

Nothing good happens. All the programs stop ~_~
I'm sorry, I don't feel like making a persistance code for all of these… At least for now.
brandonk #157
Posted 14 April 2013 - 02:42 PM
Could you give me a hand with mine? I put my turtle down and ran mastermine 219 88 18 10 10 (I was using the old version since the newer didnt work as it did the same thing. I also had it facing south) and it spammed the "Movement obstructed. Waiting" and I cannot get it to work. I place it flat on the ground without modifying any terrain. Does it need to be up in the air or somewhere special to work? Would it be possibly to be a bit more detailed in the setup, since I'm a bit new to CC and not really sure about copying to Drive.
PonyKuu #158
Posted 14 April 2013 - 06:08 PM
It should be able to place chest above it and move forward and then back. And don't forget Disk Drive.
per #159
Posted 15 April 2013 - 11:46 AM
After our server was having some issues and rebooted several times I have some wishes :D/>

would it be difficult to enable the minions/master to report via rednet ?
I would love to have the master report back to my main computer in my base so I would know when a run was finished etc…
I've tried to modify this myself, but my coding skills are sorely out of date (I'm more 6502 Assembler and Perl)

A "bug out" routine for when the server restarts that sends all the minions up to the same level that the master is at (a lot easier to find :D/> them then)
Might be as simple as creating a startup file for each of the minions at the beginning of a run that tells them to "dig up to <masterminer> level"

A "Recall All" menu choice when masterminer is running, press Q to recall all minions for example.
firerebel #160
Posted 15 April 2013 - 08:43 PM
It works great, but the coordinates seem to be a bit off. It may just be my server. It never mines exactly where I tell it to, and its always like 40~ off in height. I tell it to mine a 55 height starting at 60 and it starts at 25 and mines to bedrock and then stops.
PonyKuu #161
Posted 15 April 2013 - 09:53 PM
After our server was having some issues and rebooted several times I have some wishes :D/>

would it be difficult to enable the minions/master to report via rednet ?
I would love to have the master report back to my main computer in my base so I would know when a run was finished etc…
I've tried to modify this myself, but my coding skills are sorely out of date (I'm more 6502 Assembler and Perl)

A "bug out" routine for when the server restarts that sends all the minions up to the same level that the master is at (a lot easier to find :D/> them then)
Might be as simple as creating a startup file for each of the minions at the beginning of a run that tells them to "dig up to <masterminer> level"

A "Recall All" menu choice when masterminer is running, press Q to recall all minions for example.
Well, that require some serious changes… Currently modules send requests to Master and get responses, they do not listen to messages during operations, so "recall" will require some work and changes to this concept.
"bug out" routine will require state saving (file.open, file.write, file.close) for modules each time they move, which I don't like. It is possible to implement, but it is almost the same work as persistance for master/module, and, as I said earlier, I'm too lazy to do that ^_^/>
Maybe I'll implement some of this things later, but for some time, I'd like to rest a bit from coding and play some FTB Ultimate.

It works great, but the coordinates seem to be a bit off. It may just be my server. It never mines exactly where I tell it to, and its always like 40~ off in height. I tell it to mine a 55 height starting at 60 and it starts at 25 and mines to bedrock and then stops.
Is your gps correct?
firerebel #162
Posted 16 April 2013 - 06:04 AM
I used the gps builder tool http://www.computercraft.info/forums2/index.php?/topic/9528-gps-deploy-10/. Does the gps have to be directly above my turtle? Its kind of off to the side a bit but still well within range.
PonyKuu #163
Posted 16 April 2013 - 05:45 PM
No it doesn't. Does gps locate give you correct position of the Master?
TheLoiteringKid #164
Posted 17 April 2013 - 04:06 PM
Always wanted an army of turtles mining away controlled by 1 master turtle, Love It!
firerebel #165
Posted 18 April 2013 - 08:46 AM
No it doesn't. Does gps locate give you correct position of the Master?
I tested and it doesn't :o/>.

I gives a height 40 more than what it should be. Any clue why?
PonyKuu #166
Posted 18 April 2013 - 05:58 PM
Maybe you did something wrong with your gps script ._. I don't know…
per #167
Posted 19 April 2013 - 08:22 AM
I'm planning to tweak your code a little :)/>

1st up is a check of the GPS system..so it DON'T start using relative mode if the GPS is wonky :D/>…I hade a turtle go bye ye on me today becaus one of the computers in my GPS node for some reason did not activate it's Modem..weird stuff…

2nd is trying to make a "oh shit server rebooted" restart program that only needs a minimum of updates..

Actually that turns out to be an issue as the minion turtles dont have lables and therefor don't save their programs on server reboots..
My plan is as follows:

1)deploy minion
2)add label
3)set "Safe altitude"
4)write startup file to have it return to "safe altitude" on reboot
5)if no reboot , unset label before being sucked up by master again

and yes I see the issue of figuring out what level the turtle is at … I might have to use one of the GPS API's that gives me a GPS_MoveTo function for the turtle..argh…this is just like work :D/>

oh well … this IS fun thou :D/>

thanks again mate!
PonyKuu #168
Posted 19 April 2013 - 08:39 AM
As you wish. I have to point you to the fact that it is generally a bad idea of using just some random "moveTo" function, because there are a lot of turtles moving and they can stuck together.

And AFAIK, unlabeled turtles don't lose programs on reboot. They lose them on break-and-place
per #169
Posted 19 April 2013 - 10:19 PM
Ah yes I know, and that is why I'm going to try and stagger them so they don't all return to the same point :)/>..

Hmm…my test on my singleplayer seems to indicate that the turtle lost everything (programs, fuelstate) if not labeled..okay..need more testing.

And I can see this is gonna take a while :)/> I get sidetracked with "Oh you can do THAT..gotta try that" :D/>
Omen964 #170
Posted 20 April 2013 - 12:35 PM
Getting a error on line master:235 i guess it have with fuel to do.
The server do not use fuel so i wounder if there is anyway to bypass it?
PonyKuu #171
Posted 20 April 2013 - 06:25 PM
fixed
Omen964 #172
Posted 21 April 2013 - 12:51 PM
It dose nothing.
i run the program and all it dose is go forward 1 block then back. and give me one message and just stand there.
Message: "No GPS found.using relative coordinates"
it then select slot 3


ps: /)
PonyKuu #173
Posted 21 April 2013 - 05:40 PM
It wants a fuel chest. It's a bit harder to fix, so for now put a stack of cobble in the first slot, stuff chests in the second and turtles in the third

(\
Omen964 #174
Posted 22 April 2013 - 06:50 AM
It wants a fuel chest. It's a bit harder to fix, so for now put a stack of cobble in the first slot, stuff chests in the second and turtles in the third

(\
Did that and same thing happend
PonyKuu #175
Posted 22 April 2013 - 08:46 PM
Weird. Can you explain what exactly do you do?
Omen964 #176
Posted 23 April 2013 - 08:15 AM
Weird. Can you explain what exactly do you do?
Putting the codes into the "Master" turtle then putting the codes into a disk.
put the layout as you say in the front page.
putting the disk in the disk drive and having the turtle facing Old South

First slot 1 stack cobble second slot a chest and third slot 50+ wireless mining turtles.
write in the command and the parameters and hit enter.
PonyKuu #177
Posted 23 April 2013 - 05:19 PM
First of all, which version did you get?

Also, you need a bunch of ChickenBones' EnderChests in the second slot - one for each module. They are needed for modules to clean their inventories when they are full. Vanilla EnderChests won't work because they are stupid and cannot be broken and I think mods don't like them.
Omen964 #178
Posted 24 April 2013 - 05:13 AM
What ever version is in the FTB:Ultimate
Why would normal wooden chest not work?
PonyKuu #179
Posted 24 April 2013 - 10:06 AM
I mean script version…
But anyways, normal chests wouldn't work because to dump stuff module
1) Places the chests
2) Puts items into it
3) Gets chest back.
So it should be ChichenBones EnderChest hooked to a sorting system.
Omen964 #180
Posted 24 April 2013 - 11:19 AM
Latest Version of your scrip
Keridos #181
Posted 04 May 2013 - 09:47 AM
Hi there, just a small info for you: When you use lava buckets as fuel, the turtles put the empty buckets back in the enderchest so they can be refilled again. But: When a turtle pulls an empty bucket from the enderchest (when there is still one left by another turtle, before the refilling system can pull it out) the turtle gets stuck. Maybe add in a check that checks if refueling from the slot you put the item in works, and if it does not, put the item back in the enderchest and wait a second, then try refueling again.

/edit: made a pull request with a small fix for that: https://github.com/PonyKuu/CC_Swarm/pull/1
PonyKuu #182
Posted 05 May 2013 - 03:53 AM
Hi there, just a small info for you: When you use lava buckets as fuel, the turtles put the empty buckets back in the enderchest so they can be refilled again. But: When a turtle pulls an empty bucket from the enderchest (when there is still one left by another turtle, before the refilling system can pull it out) the turtle gets stuck. Maybe add in a check that checks if refueling from the slot you put the item in works, and if it does not, put the item back in the enderchest and wait a second, then try refueling again.

/edit: made a pull request with a small fix for that: https://github.com/P...CC_Swarm/pull/1
Thank you! I think I merged it to the main branch. I'm sorry, I'm still pretty new to GitHub, so I might did something wrong.
Keridos #183
Posted 05 May 2013 - 08:30 AM
It is fine, just means you have incorporated my fix into your own branch. So the small fix is now in your repository aswell. And you can see my commit in your commit history in the project now too.
PonyKuu #184
Posted 05 May 2013 - 10:47 AM
Ah, OK. I think that's what I wanted. Thank you again.

Also, I heard that devs decided to make turtles have breakable tools.
that means two things:
1) We will not be able to repair the module during operation.
2) They will not stack.

I'm not sure that I'll be able to fix these scripts to work with new "features". That's ridiculous.
SyberSmoke #185
Posted 05 May 2013 - 05:57 PM
Where did you get the info about the developers choosing to have degrading tools?
Keridos #186
Posted 05 May 2013 - 07:33 PM
Ah, OK. I think that's what I wanted. Thank you again.

Also, I heard that devs decided to make turtles have breakable tools.
that means two things:
1) We will not be able to repair the module during operation.
2) They will not stack.

I'm not sure that I'll be able to fix these scripts to work with new "features". That's ridiculous.

Well you could add in another chest where the player has to refill the tools, i really hope they make them repair/exchangable from the program, without intervention of players.

Ok when the turtles do not stack it makes it impossible to use more than 10 or so then. Lets hope they have an idea of how to fix that then.
PonyKuu #187
Posted 05 May 2013 - 11:36 PM
Where did you get the info about the developers choosing to have degrading tools?
I actually don't know. But I saw this many times at FTB forums.
Ah, OK. I think that's what I wanted. Thank you again.

Also, I heard that devs decided to make turtles have breakable tools.
that means two things:
1) We will not be able to repair the module during operation.
2) They will not stack.

I'm not sure that I'll be able to fix these scripts to work with new "features". That's ridiculous.

Well you could add in another chest where the player has to refill the tools, i really hope they make them repair/exchangable from the program, without intervention of players.

Ok when the turtles do not stack it makes it impossible to use more than 10 or so then. Lets hope they have an idea of how to fix that then.
Yeah, I know. But it is still a pain in the butt. And even with, say, extra chest with turtles, it would be a pain to bring it with you and set to a new position.
SyberSmoke #188
Posted 06 May 2013 - 12:37 AM
Where did you get the info about the developers choosing to have degrading tools?
I actually don't know. But I saw this many times at FTB forums.
Ah, OK. I think that's what I wanted. Thank you again.

Also, I heard that devs decided to make turtles have breakable tools.
that means two things:
1) We will not be able to repair the module during operation.
2) They will not stack.

I'm not sure that I'll be able to fix these scripts to work with new "features". That's ridiculous.

Well you could add in another chest where the player has to refill the tools, i really hope they make them repair/exchangable from the program, without intervention of players.

Ok when the turtles do not stack it makes it impossible to use more than 10 or so then. Lets hope they have an idea of how to fix that then.
Yeah, I know. But it is still a pain in the butt. And even with, say, extra chest with turtles, it would be a pain to bring it with you and set to a new position.

Well….depending on implementation and available mods I suppose you could also pack a crafty turtle, placing it in a slot. The turtle is then deployed in a position between two chests. As turtles come in they go to the first chest and deposit materials like diamonds or gems (based on mods) and craft them into replacement tools.

Second thought would be an auto-crafting table or a Fabricator. Then the turtle builds the pattern.

Third of coarse is a second set of Ender Chests where the player has to build the auto-craft based on sorted materials. This of coarse removes the need to craft things because the chest should have a supply of crafted goods already.

and the list goes on and on I guess…just depends on the approach and how the devs choose to make the items have durability and if a turtle will be able to choose and swap their tools them selves or need outside intervention.
croswat #189
Posted 06 May 2013 - 12:43 AM
the degrading tools news came from slowpokes stream, here's what dan said about it on reddit:
http://www.reddit.com/r/feedthebeast/comments/1d4qyu/from_slowpoke101s_stream_major_nerfs_to_turtles/c9n6eqv
PonyKuu #190
Posted 06 May 2013 - 03:02 AM
Well….depending on implementation and available mods I suppose you could also pack a crafty turtle, placing it in a slot. The turtle is then deployed in a position between two chests. As turtles come in they go to the first chest and deposit materials like diamonds or gems (based on mods) and craft them into replacement tools.

Second thought would be an auto-crafting table or a Fabricator. Then the turtle builds the pattern.

Third of coarse is a second set of Ender Chests where the player has to build the auto-craft based on sorted materials. This of coarse removes the need to craft things because the chest should have a supply of crafted goods already.

and the list goes on and on I guess…just depends on the approach and how the devs choose to make the items have durability and if a turtle will be able to choose and swap their tools them selves or need outside intervention.
If they won't add any self-repair commands, the only solution would be a crafting mining turtle for each module. Because you'll need to pick up a module, craft it with a pick (which you have to get somewhere, and that means another ender chest with tools), and put it down.
It requires state saving and FOUR chests per module - Fuel, Stuff, Crafty Turtle and Tools. It's complicated as hell and makes this script nearly useless… Not taking into account the issue with non-stackable turtles… I hate it so much…
Keridos #191
Posted 06 May 2013 - 07:12 PM
Well….depending on implementation and available mods I suppose you could also pack a crafty turtle, placing it in a slot. The turtle is then deployed in a position between two chests. As turtles come in they go to the first chest and deposit materials like diamonds or gems (based on mods) and craft them into replacement tools.

Second thought would be an auto-crafting table or a Fabricator. Then the turtle builds the pattern.

Third of coarse is a second set of Ender Chests where the player has to build the auto-craft based on sorted materials. This of coarse removes the need to craft things because the chest should have a supply of crafted goods already.

and the list goes on and on I guess…just depends on the approach and how the devs choose to make the items have durability and if a turtle will be able to choose and swap their tools them selves or need outside intervention.
If they won't add any self-repair commands, the only solution would be a crafting mining turtle for each module. Because you'll need to pick up a module, craft it with a pick (which you have to get somewhere, and that means another ender chest with tools), and put it down.
It requires state saving and FOUR chests per module - Fuel, Stuff, Crafty Turtle and Tools. It's complicated as hell and makes this script nearly useless… Not taking into account the issue with non-stackable turtles… I hate it so much…
Well let's hope that they make the turtles able to repair their own tools, with diamonds f.ex. Would require the player to setup a enderchest with diamonds in it. but making the turtles able to repair their own tools from time to time. When the turtle is finished, it simply repairs up and then goes back to the main turtle. That way we would have all turtles stackable when they return.
croswat #192
Posted 07 May 2013 - 01:07 AM
Well….depending on implementation and available mods I suppose you could also pack a crafty turtle, placing it in a slot. The turtle is then deployed in a position between two chests. As turtles come in they go to the first chest and deposit materials like diamonds or gems (based on mods) and craft them into replacement tools.

Second thought would be an auto-crafting table or a Fabricator. Then the turtle builds the pattern.

Third of coarse is a second set of Ender Chests where the player has to build the auto-craft based on sorted materials. This of coarse removes the need to craft things because the chest should have a supply of crafted goods already.

and the list goes on and on I guess…just depends on the approach and how the devs choose to make the items have durability and if a turtle will be able to choose and swap their tools them selves or need outside intervention.
If they won't add any self-repair commands, the only solution would be a crafting mining turtle for each module. Because you'll need to pick up a module, craft it with a pick (which you have to get somewhere, and that means another ender chest with tools), and put it down.
It requires state saving and FOUR chests per module - Fuel, Stuff, Crafty Turtle and Tools. It's complicated as hell and makes this script nearly useless… Not taking into account the issue with non-stackable turtles… I hate it so much…

what about using a crafty turtle as the master, and let him have an ender chest of picks? the only problem is that the pickaxe of the turtles will eventually break.. maybe have them come back to the master for a new one?
PonyKuu #193
Posted 07 May 2013 - 03:18 AM
Master should be a wireless mining turtle. No space for crafting peripheral. Also, It's not a good idea to return modules to Master to repair them.
SyberSmoke #194
Posted 07 May 2013 - 04:57 AM
Well….depending on implementation and available mods I suppose you could also pack a crafty turtle, placing it in a slot. The turtle is then deployed in a position between two chests. As turtles come in they go to the first chest and deposit materials like diamonds or gems (based on mods) and craft them into replacement tools.

Second thought would be an auto-crafting table or a Fabricator. Then the turtle builds the pattern.

Third of coarse is a second set of Ender Chests where the player has to build the auto-craft based on sorted materials. This of coarse removes the need to craft things because the chest should have a supply of crafted goods already.

and the list goes on and on I guess…just depends on the approach and how the devs choose to make the items have durability and if a turtle will be able to choose and swap their tools them selves or need outside intervention.
If they won't add any self-repair commands, the only solution would be a crafting mining turtle for each module. Because you'll need to pick up a module, craft it with a pick (which you have to get somewhere, and that means another ender chest with tools), and put it down.
It requires state saving and FOUR chests per module - Fuel, Stuff, Crafty Turtle and Tools. It's complicated as hell and makes this script nearly useless… Not taking into account the issue with non-stackable turtles… I hate it so much…

what about using a crafty turtle as the master, and let him have an ender chest of picks? the only problem is that the pickaxe of the turtles will eventually break.. maybe have them come back to the master for a new one?

Reading the reddit post placed in above, it looks like turtles will be able to swap out their peripherals as necessary through an API command. This means master or any other turtle could swap out their tool for a new one or change to a different peripheral like going from miner to crafty. Allot of possibility there as master could be a miner when needed or crafty as needed as with any other turtle.
neonblue #195
Posted 07 May 2013 - 09:44 AM
Ide like to try it but i cant actually figure out how to download it from github onto the turtle?
PonyKuu #196
Posted 08 May 2013 - 02:50 AM
Added pastebin links. For pastebin get only - it seems it ate the intendation, so that code is not very readable
Vorg #197
Posted 10 May 2013 - 02:05 PM
Still reading through the 10 pages of post and want to look into it more, but, I am interested on the ore seeker method over making a giant hole in the ground.

I tried http://www.computerc...-branch-mining/ first and it seem to start ok, but then the chunk loading mining turtle was lost under a desert when it hit a cave under sand formed without support. May need to quarry the are to find it, but it seems to have gone a long way from the start. Tried a second time and it went a short ways, then errored with can't find update. Then found one that didn't make all those long tunnels.

http://www.computerc...efinder-tunnel/ is more to my liking and first try in the nether with a chunk loader mining turtle and it got almost done, then shut down at the top of a shaft. Don't know if it was a server reboot or what. no messages left.

So I would like to use that for the mining op instead of open pit quarry.

Also side note I have noticed with several programs i've tried. When the DL/update/what ever, they expect everything to be dumped in the root. They store data files, program files, etc and expect them to be there instead of staying within the folder provided. Is this a flaw with CC? or just programs using absolute paths. Makes things messy, and harder to clean up as wildcards don't seem to be supported like "delete cbm*" or even just "delete *"

For fuel chest, I use an ender chest linked to a charcoal gen with a full quantum barrel providing the main charcoal storage.

Just finished going through the thread. While I REALLY like the plan to let turtles change tools, I agree about tools breaking being bad. If that is put in, then it must also support enchanted and other types as you can make tools with self repair on them. Also, you can use mining lasers though they cost a lot more in resources to make and can set stuff on fire and distory the target if not used on low power.

Using the ore finding version of digging I linked to I think would solve the problem of hitting bedrock because horizontal movement is more limited.
PonyKuu #198
Posted 11 May 2013 - 05:14 AM
Actually, I'd like to make some sort of orefinding version of the script (it will dig only down, no movement near bedrock)
That would require some API changes (making equipment table really useful) and some calculations. I just have to be less lazy at first :3
Infiduke #199
Posted 11 May 2013 - 11:47 AM
I followed the instructions and the master starts deploying modules, fuels them up and sends them on their way, however the stuff and fuel chests in the modules' inventory get swapped. This results in the module placing the fuel chest and trying to offload its cargo in that chest instead of the Stuff chest.

Both fuel and stuff chests are Ender Chests, but with a different color combination.
PonyKuu #200
Posted 11 May 2013 - 12:30 PM
um, did you put the chests right? First chest is the fuel chest and second chest is the stuff chest…
Infiduke #201
Posted 11 May 2013 - 12:39 PM
Yes, I triple checked that, I also put them in the wrong order to test that, but that does not work (since there is no fuel in the Stuff chest, the module never leaves due to lack of fuel)
PonyKuu #202
Posted 11 May 2013 - 03:02 PM
That's just weird…I tested that a lot of times so it should work good…
PonyKuu #203
Posted 12 May 2013 - 02:01 AM
Actually, if chests got swapped, it will never move away from master.

Which CC version do you use? Can you make a small testing for me?
1) Put down a turtle.
2) Put a chest above it.
3) Enter the lua command line.
4) put item in the SECOND slot
5) Run turtle.dropUp () command
Infiduke #204
Posted 12 May 2013 - 08:58 AM
I am using CC 1.52 and Minecraft 1.5.1 (and a whole bunch of other mods)

I performed the test with a turtle and an (Ender) Chest above. I placed an Ender Chest in slot 2 and ran the Lua command (turtle.dropUp). This placed the Ender Chest that was in slot 2 in the chest above the turtle and returned true.
PonyKuu #205
Posted 12 May 2013 - 09:51 AM
Aha. So I know what happened. It's that small fix that was made recently. Fixed.
Infiduke #206
Posted 12 May 2013 - 10:51 AM
I just downloaded the latest version from Github and tested that. Unfortunately things are still the same.

The master places the module, the module fuels up and for some reason the fuel and stuff chests get swapped. However the module still leaves to go mining.

If I swap fuel and stuff back myself the module starts mining but on the next refuel the chests get swapped again: stuff ends up in slot 1, fuel in slot 2
PonyKuu #207
Posted 12 May 2013 - 10:58 AM
I just don't get it. Can you look what EXACTLY happens on refuel?
Infiduke #208
Posted 12 May 2013 - 11:37 AM
Step 1: module is placed fuel chest is in slot 1, stuff chest in slot 2
Step 2: fuel chest placed above turtle
Step 3: fuel (lava in my case) in slot 1, stuff chest in slot 2
Step 4: fuel chest is broken
Step 5: stuff chest in slot 1, fuel chest in slot 2, module takes off.

Step 5 is very quick and I don't really have the time to see what happens, I don't know for sure but looks like the stuff chest is moved to slot 1 and the fuel chest "lands" in slot 2.

Edit: To be clear. This is right as the program starts and the master deploys modules, not as the turtles refuel. All modules are deployed incorrectly.
Edited on 12 May 2013 - 10:30 AM
PonyKuu #209
Posted 12 May 2013 - 02:25 PM
._.
I have no idea…
Keridos #210
Posted 13 May 2013 - 04:34 PM
Should be easy to fix: just add in a delay that makes the placed turtle wait before it tries to refuel.
So instead of refueling instantly, wait 3 seconds until the master turtle has put in both enderchests.

/edit: Giving you a pull request, found a fix after a while now.

/edit2: it is due to another thing, refueling with no slot specified somehow pulls the next available item to the current slot. Fixed that bug now too, uploading to github now.
Vorg #211
Posted 13 May 2013 - 06:57 PM
are the pastebin files updated with github changes? or do we need to copy the github files to a pastebin to use the lastest?
PonyKuu #212
Posted 13 May 2013 - 11:56 PM
Should be easy to fix: just add in a delay that makes the placed turtle wait before it tries to refuel.
So instead of refueling instantly, wait 3 seconds until the master turtle has put in both enderchests.

/edit: Giving you a pull request, found a fix after a while now.

/edit2: it is due to another thing, refueling with no slot specified somehow pulls the next available item to the current slot. Fixed that bug now too, uploading to github now.
Oh, that's the issue. thank you again! Dammit I'm always trying to use turtle.getItemCount (slot) as boolean, while it's integer.
Fixed one more thing - turtle.refuel() gets a quantity as an argument, not a slot number. Unless they change it, of course.
are the pastebin files updated with github changes? or do we need to copy the github files to a pastebin to use the lastest?
I updated the pastebin version. By hands hooves hands There's no automatic sync.
Infiduke #213
Posted 20 May 2013 - 10:46 AM
That fix solved the problem I was having. This program now works great and clears a lot of terrain quickly.

Thank you
PonyKuu #214
Posted 20 May 2013 - 11:39 PM
Yay!
Busi #215
Posted 22 May 2013 - 08:41 AM
could you reupload the picture?
PonyKuu #216
Posted 22 May 2013 - 02:32 PM
Done :3
Coolkrieger3 #217
Posted 24 May 2013 - 08:57 PM
Ok I tried running this, but I must be doing something wrong. Instead of mining the turtles go up in the air and fly away to who knows where. I started the program with mastermine -1197 67 -3521 10 67 10. I'm not sure about the y size parameter. I want it to go down to bedrock.

BTW this was on a test world with creative turned on, so not worried the that I can't find the turtles.
PonyKuu #218
Posted 25 May 2013 - 04:52 AM
Do you have gps?
Vorg #219
Posted 25 May 2013 - 02:20 PM
When I put them down, first thing I do is do gps locate to see if it picks one up. Thought I had moved far enough away first few tries and hadn't.

Something I noticed is when the workers go out, they first go up several blocks before moving out. This is a problem with trying to mine fro the top of the nether. Would be even better if they also mined on the way to start locations. I have a simple inclosed tower/ladder builder that goes as high as it can, comes back down placing ladders on the way and leaves a small ledge at the top. I go up, clear out a small pocket to put down the turtles and let them rip.
Coolkrieger3 #220
Posted 25 May 2013 - 03:26 PM
Do you have gps?

I do not.
psyestorm #221
Posted 26 May 2013 - 09:21 AM
Thanks,

This program is a really cool idea.

Has anyone combined it with the OreQuarry idea for ulta-fast mining?
delaron #222
Posted 28 May 2013 - 10:40 PM
What would your suggestion be for getting around broken chests? It does not pick up the items that fall out. I was thinking if you add a call to turtle.suck() , turtle.suckUp(), or turtle.suckDown() it would resolve the issue. However I am not sure where I would add that. I figure modulemine but looking at the code I am not 100% sure where it would be best served.
Vorg #223
Posted 01 June 2013 - 02:18 AM
I just had a case where there was gps and starting location given was -1137, 70, 288. I was trying for a chunk aligned 16x16 starting SW corner to bedrock. so I entered 16, 68, 16. All the turtles went 17 blocks west and started ending up with a 16x16 to bedrock one chunk off to the west. It needs a check for when a starting location is negative.

Also, all the turtles go several blocks up before heading to the start location. Would be much better if they stayed at the same level for when mining at the top of the nether.
PonyKuu #224
Posted 01 June 2013 - 07:58 AM
I do not.
When you don't have GPS use relative coordinates. Master assumes that it is at 0, 0, 0 facing positive x

Thanks,

This program is a really cool idea.

Has anyone combined it with the OreQuarry idea for ulta-fast mining?
I wanted to make something similar, but not exactly the orequarry (in fact, I don't like that implementation. There was other "selective mining" method I like.) Actually I'm just too lazy for now to code it. I'm sorry.

I just had a case where there was gps and starting location given was -1137, 70, 288. I was trying for a chunk aligned 16x16 starting SW corner to bedrock. so I entered 16, 68, 16. All the turtles went 17 blocks west and started ending up with a 16x16 to bedrock one chunk off to the west. It needs a check for when a starting location is negative.

Also, all the turtles go several blocks up before heading to the start location. Would be much better if they stayed at the same level for when mining at the top of the nether.
There's no difference for negative or positive coordinates. the starting position is the LOWEST coordinates.
They go up because if they don't do that the turtles that already mine might interfere with the turtles heading to their locations. And actually this script is more for overworld mining, when you can set master higher than the mining location. But anyways, do you really want to mine from the very top?
m157 #225
Posted 01 June 2013 - 05:45 PM
I am having a issue, i have it set up correctly, and i use "mastermine 0 0 0 128 85 128" and when the turtle goes to the disk drive i get "master:284 Copy failed"
Vorg #226
Posted 01 June 2013 - 06:45 PM
When I tried it the first time, it was an area without GPS. It mined the chunk in front of the turtle going forward and to the right as expected. When I tried it in an area with gps, It sent the turtles 17 blocks left and did a 16x16 going forward and to the right stopping just short of where it was supposed to have started. I double checked with gps locate and it had it's correct location.

And yes, I want to mine from the top.
PonyKuu #227
Posted 02 June 2013 - 02:57 AM
I'm sorry, but I cannot make them mine from the top in your case. That would cause deadlocks.

About the area. can you explain EXACTLY what area (start coordinates, stop coordinates) you wanted it to mine, what you typed as parameter, and what did it mine.

I am having a issue, i have it set up correctly, and i use "mastermine 0 0 0 128 85 128" and when the turtle goes to the disk drive i get "master:284 Copy failed"
Make sure that you have all the scripts and APIs on the Master.
Vorg #228
Posted 02 June 2013 - 04:25 PM
The start area was to be 2 blocks ahead of the turtle. Turtle was facing S and I expected it to mine forward and to the right from the start point I gave it as it did before in another area where there was no GPS. Location given was -1137 70 288 and size 16 68 16. That put it chunk aligned. The turtles all went to the chunk to the left, just 1 over and did it instead. I repeated the command just using the up arrow to bring up last entry and it got stranger. It did almost the same, but was 1 block short of moving a chunk over so that the area it went back over ended in front of the turtle.

Maybe it was a glitch of some kind that made it start 17 over the first time. I moved the master over to the right edge of the chunk I wanted it to mine and it mined it again working from the left. The bigger problem here is that some times it sends them left and sometimes right. It needs to work out the numbers so that it always mines the same way. Most programs I've tried so far are set up to work forward and to the right. Doesn't matter where in the target area they start as long as the target area is always the same in relation to the start area.
m157 #229
Posted 02 June 2013 - 07:39 PM
Make sure that you have all the scripts and APIs on the Master.

I have all 4 of the scripts/apis on the turtle, and nothing
PonyKuu #230
Posted 03 June 2013 - 12:16 AM
Vorg. Tell me the coordinates, please. I don't understand where is that "to the left" "2 blocks ahead" and stuff. If you don't say it to me, I won't be able to understand what's wrong with " -1137 70 288".

And there should not be any dependency on the number of times you run the script.
And it always mines the same way. It uses coordinates as a base. you don't even have to use GPS. want to mine forward and to the right use relative mode and mine from something like 10, 20 to 26 36, or whatever your locations is it. GPS mode uses coordinates and always sets the area from the lowest coordinates to the highest.
Vorg #231
Posted 03 June 2013 - 04:51 AM
In relation to the master turtle. I found I still had a way point to the first test pit. Start was -848 67 -1088 and end was -864 67 -1073.

The second location was -1136 70 288 to -1122 70 303. I expected the "to" to be -1152 70 303

First pit was forward and to the right. Second was forward and to the left of start corner
SyberSmoke #232
Posted 15 June 2013 - 08:03 PM
I was curious, you have it set up to use Enderchests. But Is it necessary for the dump chest to be an ender chest or could it be an iron chest attached to a Tesseract or other such setup?

Oh never mind now that I have used it I see what is going on. Good program, fast to.
aviusenigma #233
Posted 19 June 2013 - 03:33 PM
Ok cant for the life of me get this running.

setup like this

the command

moves forward once

gives this error

has all 4 programs the disk does as well.
Keridos #234
Posted 30 June 2013 - 06:13 AM
Ok cant for the life of me get this running.

has all 4 programs the disk does as well.

Do you have a disk in that disk drive?
aviusenigma #235
Posted 30 June 2013 - 01:41 PM
Ok cant for the life of me get this running.

has all 4 programs the disk does as well.

Do you have a disk in that disk drive?

yup disk is in it
Dircome #236
Posted 06 July 2013 - 04:58 PM
Try placing the disk drive below the turtle instead of on the left. I had the same problem until i tried that
Levorto #237
Posted 03 September 2013 - 08:42 AM
I have not been able to get this to work for 1.52. Tried all the suggestions in here. Also the one right above here. Could anyone create a simple youtube explanation video?

#Update: Disregard the above, I have gotten the program to work - all I needed to do was deploy a GPS cluster.
Levorto #238
Posted 09 September 2013 - 05:54 AM
I was able to get this to work perfectly, and I will later - when I get home - upload my modified swarm code to Pastebin, and attach it to this post.
With it, the Master pulls mining turtles from a chest above him. This allows you to label your turtles, and still have as many turtles as you have enderchests.

The code is probably mediocre, but I hope to inspire others to update the Git Repo with the functionality I have implemented, just cleaner :)/>.

Also, I am now looking into creating a rednet/modem relay, to pass the message back and forth between Master and Modules.


#Update: As promised, here is the pastebin of my modified code: http://pastebin.com/SKKyFPiS - Important! You will need a chest above the turtle - filled with turtles - to make it function with this modified master code.
lothos #239
Posted 09 September 2013 - 03:30 PM
I've been trying to get this program to work on my SSP map and every time I try and launch it i get a fiel not found nil value response. I thought it might have been invalid file names and tried with and without the version numbers in the names. I'm assuming its trying to launch the modulemine program from the mastermine program and that is where i am getting the hiccup.

http://i.imgur.com/EU69A4I.png
Edited on 09 September 2013 - 01:46 PM
Levorto #240
Posted 10 September 2013 - 05:47 AM
@Lothos: You need the following:
  • Two enderchests for each turtle you want active (One fuel, one dump)
  • The master turtle, placed 20ish blocks above the area you are planning to work on.
  • In front of the turtle, one block below, a disk drive with an empty floppy disk. (Turtle at 0, disk drive at X: +1, Y: -1)
  • No more disk drives than that - don't follow the image on the first post.
lothos #241
Posted 10 September 2013 - 07:16 AM
@Lothos: You need the following:
  • Two enderchests for each turtle you want active (One fuel, one dump)
  • The master turtle, placed 20ish blocks above the area you are planning to work on.
  • In front of the turtle, one block below, a disk drive with an empty floppy disk. (Turtle at 0, disk drive at X: +1, Y: -1)
  • No more disk drives than that - don't follow the image on the first post.


ender chests for each turtle you put in the master or just the master turtle?
Levorto #242
Posted 11 September 2013 - 02:29 AM
At least try before asking new questions. I guess you didn't read my explanation thoroughly enough. You need 20 ender fuel chests, 20 ender dump chests and 20 turtles, if you want 20 active modules (turtles).

I was hoping for a response to my updated code, found above, but I guess nobody is using the script anymore.
kreezxil #243
Posted 11 September 2013 - 10:19 AM
3) Put some Ender Chests with some fuel in the first slot, some Ender chests linked to your sorting system in the second slot, and a bunch of wireless mining turtles into the third slot.
  1. When you say slot are you referring to the slot on the master turtle?
  2. And when you say some do you mean a stack or any number or amount of that item?
  3. Is bunch synonymous with some in this case?
  4. And I assume you mean in the case of the first ender chests that they are linked to a fuel source?
Am I right in these assumptions?
4) Copy all the files on the turtle's drive
By this do you mean that I should've copied all of the files I downloaded from the pastebin to the floppy on the drive and then make sure those same files are on the master turtle too?

Your clarification on this matter will be greatly helpful.
Levorto #244
Posted 11 September 2013 - 11:26 AM
  1. When you say slot are you referring to the slot on the master turtle?
  2. And when you say some do you mean a stack or any number or amount of that item?
  3. Is bunch synonymous with some in this case?
  4. And I assume you mean in the case of the first ender chests that they are linked to a fuel source?
  5. Copy all the files on the turtle's drive. By this do you mean that I should've copied all of the files I downloaded from the pastebin to the floppy on the drive and then make sure those same files are on the master turtle too?
Am I right in these assumptions?

Allow me to reply on PonyKuu´s account.
  1. If you want 5 turtles active, you put 5 enderchests of one color (e.g. orange) in the first slot.
  2. This will from now on be your Fuel chest slot. Add 1 enderchest for each turtle you add.
  3. Then you put 5 enderchests of another color (e.g. green) in the second slot.
  4. This will from now on be your Output / Sorting chest slot. Add 1 enderchest for each turtle you add.
  5. Now you should have 5 enderchests in the first AND second slot of the Main Controller Turtle.
  6. Add 5 unlabeled mining turtles to slot 3 of the Main Controller Turtle.
  7. Fill up the first enderchest - your Fuel chest - with coal/charcoal or another simple fuel source (try to avoid lava buckets).
  8. I recommend automatically filling it with a hopper - e.g. place down a Fuel chest in your base, and place a hopper on top of it. You then place a chest on top of the hopper. In this chest you can add as much coal/charcoal as you want.
  9. Install the four programs listed in the first post only on the Main Controller Turtle, using "pastebin get <program> <name>".
  10. Do NOT install anything on the disk drive - keep it empty.
kreezxil #245
Posted 11 September 2013 - 02:58 PM
  1. When you say slot are you referring to the slot on the master turtle?
  2. And when you say some do you mean a stack or any number or amount of that item?
  3. Is bunch synonymous with some in this case?
  4. And I assume you mean in the case of the first ender chests that they are linked to a fuel source?
  5. Copy all the files on the turtle's drive. By this do you mean that I should've copied all of the files I downloaded from the pastebin to the floppy on the drive and then make sure those same files are on the master turtle too?
Am I right in these assumptions?

Allow me to reply on PonyKuu´s account.
  1. If you want 5 turtles active, you put 5 enderchests of one color (e.g. orange) in the first slot.
  2. This will from now on be your Fuel chest slot. Add 1 enderchest for each turtle you add.
  3. Then you put 5 enderchests of another color (e.g. green) in the second slot.
  4. This will from now on be your Output / Sorting chest slot. Add 1 enderchest for each turtle you add.
  5. Now you should have 5 enderchests in the first AND second slot of the Main Controller Turtle.
  6. Add 5 unlabeled mining turtles to slot 3 of the Main Controller Turtle.
  7. Fill up the first enderchest - your Fuel chest - with coal/charcoal or another simple fuel source (try to avoid lava buckets).
  8. I recommend automatically filling it with a hopper - e.g. place down a Fuel chest in your base, and place a hopper on top of it. You then place a chest on top of the hopper. In this chest you can add as much coal/charcoal as you want.
  9. Install the four programs listed in the first post only on the Main Controller Turtle, using "pastebin get <program> <name>".
  10. Do NOT install anything on the disk drive - keep it empty.

Thank You so much for clarifying his posts.

And btw, I'll be using your version of the master script. I'll let you know how it goes. :D/>
kreezxil #246
Posted 12 September 2013 - 10:38 AM
So whether I use Ponkuu's master script or lortho's the result is the same, when it gets to the line where it tries to copy to the floppy it gives me " Master ###: copy failed" where the ### is the relatively the same fs.copy line in both scripts.

Seems like it is some kind of config issue, but I don't know where to look.

I can make a startup file on disk that will autocopy things to an adjoining turtle, but this is weird probably because it is the turtle trying to do everything.

Any ideas?
PonyKuu #247
Posted 18 September 2013 - 04:27 AM
Nice addition, Levorto and thanks you for the good explanation! I think I should add those in the OP.
However your change seems to assume a certain order of items in master API. Actually I wanted APIs to be more… flexible so that you'll be able to make other programs using those APIs. However, I experienced some issues and it seems like such a quarry is almost the only thing you can do with them :D/>

And… Sorry, guys for being away for so long, I didn't touch this (and CC) for quite a while and currently I have no ideas about future development of these API/scrips.

Regarding that "copy failed" error, I can't exactly say what causes it. can you check what is the name of the disk drive? It somehow becomes not "disk" but "disk2" even if it is the only disk attached to it, AFAIR. Howevere I don't think that that would give the same error.
NosajDraw #248
Posted 06 October 2013 - 08:27 AM
Regarding that "copy failed" error, I can't exactly say what causes it. can you check what is the name of the disk drive? It somehow becomes not "disk" but "disk2" even if it is the only disk attached to it, AFAIR. Howevere I don't think that that would give the same error.

I can tell you what caused it for me.

I ran the program once with parameters that were far too big and the turtles went out of loaded chunks and stalled. So I manually gathered all the turtles back up and loaded them back into the master turtle and tried again.

Now I ALWAYS get the "copy fialed" error, I've crafted new disks, tried different colour disks, tried a "blank disk", doesn't matter, all I can acheive is the error message.
ChaosNicro #249
Posted 29 December 2014 - 01:25 PM
I have some trouble setting up a swarm with relative coordinates.

In my case both the relative starting position and the size relative to the starting position are negative. (Because I want to mine heading away from the platform in the negative x and z direction)
The program does not seem to like negative values for size though. (would y not always be negative when digging down?)
The module also crashed without moving on module API line 552 "Attempt to call index" which seems to be related to master-module communication.
This was the line I tried:

mastermine -7 -4 7 -42 -71 -42

Thanks in advance for any help,
Nicro
gunther222 #250
Posted 31 July 2015 - 08:34 AM
Do to some changes in the way textutils.serialize and textutils.unserialize work in recent versions of ComputerCraft this set of programs no longer functions as published. You'll get the same
The module also crashed without moving on module API line 552 "Attempt to call index" which seems to be related to master-module communication
errors ChaosNicro was seeing.


i made changes to the following routines in the "master" and "module" files to get it working again…

MASTER:

-- This function is used to make all the files required by module to run.
-- Scriptname is the name of the main module script
local function prepareFiles (scriptname)
		-- Copy all the required files on the disk
		if fs.exists ("/disk/module") then
				fs.delete ("/disk/module")
		end
		fs.copy ("module", "/disk/module")
		if fs.exists ("/disk/"..scriptname) then
				fs.delete ("/disk/"..scriptname)
		end
		fs.copy (scriptname, "/disk/"..scriptname)
		-- Make a startup file for modules
		local file = fs.open ("/disk/startup", "w")
		file.writeLine ("shell.run(\"copy\", \"/disk/module\", \"/module\")")
		file.writeLine ("shell.run(\"copy\", \"/disk/"..scriptname.."\", \""..scriptname.."\")")
		file.writeLine ("shell.run(\""..scriptname.."\")")
		file.close()
		local comData = {}
		comData["MasterID"] = MasterID
		comData["channel"] = channel
		comData["modPosition"] = modPosition
		comData["naviData"] = naviData
		-- Now, make a file with all the data modules need
		file = fs.open ("/disk/initdata", "w")
		file.writeLine (textutils.serialize (comData) )
		file.close()
end



MODULE:

-- We need to read all the data we need to move around - turtle's position and navigation zones
-- "initdata" is the file created by Master and containing all the data that's similar for each module placed by that Master
function init ()
		sleep(2)
		local file = fs.open ("/disk/initdata", "r")
		local lbuffer = file.readAll()
		local communicationData = textutils.unserialize(lbuffer)
		Master = communicationData.MasterID
		channel = communicationData.channel
		-- set module's location
		location = communicationData.modPosition
		-- set navigation data
		naviData = communicationData.naviData
		-- Then send a request to Master, to get our ID and to let Master remember us in its state table for modules
		local response = request ("Master", 5)
		ID = response.NewID
end

If you edit the routines in your local copies to read as above it should work again.
The program appears to be working for me as it did in previous versions. I suspect these changes I've suggested will work on older versions as well, but I have not tried it.
Edited on 31 July 2015 - 08:30 PM