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

A project I did yesterday after work, opinions?

Started by KaoS, 05 September 2012 - 06:10 AM
KaoS #1
Posted 05 September 2012 - 08:10 AM
Hey all, I have recently developed a most amazing system (personal opinion I guess) just wanted to tell you about it.

I made a very small turtle factory that uses EE as well as RP2 and Buildcraft to make turtles out of anything, there is also a nearby GPS cluster



then I made a deployer place the turtle out, where it is detected by another turtle which uses the peripheral api to boot the placed turtle up, the HIVE MIND saves a startup file on the AUTO LOADER which is then executed on the new turtle, this checks that the starting up PC/turtle doesn't have an existing startup file, if it does then it launches that startup, if it doesn't then it creates a new one based on a file provided by the HIVE MIND. this file makes it send a serialized table to the RECEIVER when it starts up. the first value in the table is the word 'register' so the RECEIVER knows it is a new entry and the second value is its GPS co-ordinates, the receiver then adds this ID to its database (a table) and includes all known details (the turtle is not currently doing anything, it has not had remote commands loaded and its co-ordinates) and saves that table to a file on the DATABASE STORAGE disk every time the table is modified. the newly loaded startup file also includes a loop, the turtle opens its modem and checks for input, if the input is a table it checks the first value, if that is its ID then it executes the second value as a program. the HIVE MIND loops through the database checking if turtles are loaded, if not it sends them a file containing useful functions (co-ordinate based navigation, move functions that update position and find a way around obstacles etc) which is then executed, adding these functions to the turtle. if a turtle is loaded and its status is 'done' then the HIVE MIND sends it mining instructions (you can program it to do anything really, including make it send the output of whatever it is doing back to the database for processing)

I think people have most likely made similar systems before, what appeals to me about this system is that it is all managed by a central PC and that PC can tell the turtles to do absolutely anything, you can have multiple 'stances' that you can set from the main PC and you can set up a display by linking another PC to the DATABASE STORAGE and making it write the database to a screen (after formatting of course)

I would like to clean up my code and improve the mapping abilities of the HIVE MIND so it can more efficiently record what has been done and assign orders faster (if you cut out all of the debugging sleep() commands I use it runs really fast but I don't think it is efficient enough) and make an interface where you can tell it what to make the turtles do (it makes them mine by default at the moment)

If you have any suggestions or even random comments post them up, I would love to know what you think

PS: I love the disk sharing method, it allows me to have one PC send messages and one receive and still correlate them perfectly, that's most likely the only reason I got this right
Leo Verto #2
Posted 05 September 2012 - 01:00 PM
This is just amazing!
I'm looking forward to trying it out, it would also be perfect for my plan of an AI based turtle empire using semi-self-evolving code.
KaoS #3
Posted 05 September 2012 - 01:26 PM
haha, thanks. my code is still very messy though and I could not bring it as I have lost my flash :D/>/> but I will post it soon. I actually took the screenshot from a separate world as I do not have access to that world here
Sebra #4
Posted 15 September 2012 - 08:55 AM
I think you can use turtle.craft() and turtle.place() instead of BuildCraft and RP2.
I hopeEE is not essential too.
KaoS #5
Posted 15 September 2012 - 09:22 AM
yeah but I'm on tekkit, CC 1.33 so I lack crafty turtles :)/>/>
Steelsouls #6
Posted 16 September 2012 - 08:33 AM
This is a great project! I too love the two comps sharing a disk drive. I was wondering the other day how I could have a system send rednet messages yet still always be listening for incoming. I think your solution is the best. Yeah I think the next thing you could add is an interface so you can have varied turtles with different jobs.
KaoS #7
Posted 16 September 2012 - 08:50 AM
Thanks :)/>/> I kinda got over it though and started working on other projects before I could get it running perfectly, This system doesn't have much point so now I would rather develop a turtle squad type thing where the main turtle commands another 10-20 turtles to get various tasks done really quick
Cloudy #8
Posted 16 September 2012 - 09:29 AM
You can remove the deployer step and just use turtle.place() even in 1.33. Turtles can place other turtles properly.

Also, you can listen for rednet and send from the same computer easily - at the very least using coroutines (though I don't think that is necessary).
KaoS #9
Posted 16 September 2012 - 10:12 AM
You can remove the deployer step and just use turtle.place() even in 1.33. Turtles can place other turtles properly.

Also, you can listen for rednet and send from the same computer easily - at the very least using coroutines (though I don't think that is necessary).
Both are very true, I was adapting an existing factory which used a deployerso I just left it but I should really fix that some time

at that stage I was still having difficulty using coroutines, I will implement them in my turtle squad idea, thanks