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

Replicator

Started by vici, 01 November 2015 - 08:43 PM
vici #1
Posted 01 November 2015 - 09:43 PM
Might mess up your world, use with caution. It just takes one ;)

[media]http://www.youtube.com/watch?v=4vkifAtaino[/media]
https://youtu.be/4vkifAtaino

Install with pastebin run 3fnFhwvd it or copy the files from the Github repository.
elopus001 #2
Posted 02 November 2015 - 03:45 AM
This is ridiculously cool. The idea is great. Suggestion: use this to create a farm script where instead of replicating the turtle simply farms the items.
Bomb Bloke #3
Posted 02 November 2015 - 06:24 AM
Indeed, bravo! :D/>

Though I do find myself thinking it'd be cool to have the turtles further terraform the land underneath them - creating a smooth, all-stone surface (perhaps adding in artefacts to get something like a Death Star look).

I'm also curious about the matter of sand. In the case of your video you've started over a desert, but can sand be found in all regions?
vici #4
Posted 02 November 2015 - 09:04 AM
Thanks!

It looks for sand in a 100 block radius, so yeah some biomes won't work. Beach/forest/desert works good but as long there is sand and the water does not freeze they should replicate.

Terraforming would be cool, they kinda already do it but in a very blighted way :)/>
elopus001 #5
Posted 02 November 2015 - 01:39 PM
Though I do find myself thinking it'd be cool to have the turtles further terraform the land underneath them - creating a smooth, all-stone surface (perhaps adding in artefacts to get something like a Death Star look).

That would be awesome! Maybe create a giant hole in the ground at the first one's location as well.
Creator #6
Posted 02 November 2015 - 05:05 PM
Skynet is on its way!
wood #7
Posted 13 January 2016 - 07:31 PM
How are you making more turtles ? I don't see the turtle going mining, where are you getting the redstone and diamond ?
H4X0RZ #8
Posted 13 January 2016 - 10:06 PM
How are you making more turtles ? I don't see the turtle going mining, where are you getting the redstone and diamond ?
The video is a timelaps. You can't see each turtle doing stuff. Just look at the ground and you'll see cobblestone appear. That's where the turtle went mining.
Bomb Bloke #9
Posted 14 January 2016 - 12:23 AM
The mining spoils aren't entirely obvious, as each turtle doesn't waste time digging up everything between it and the redstone / diamond layers.
sEi #10
Posted 01 February 2016 - 12:54 AM
Pretty nifty turtle.

I have studied the turtle now for long. He have made a new turtle and filled its inventory ready to go. But the new turtle is not launching somehow. He is just idling next to the diskdrive.

I am running: CC 1.75 & MC 1.7.1

Have not dared yet even to look at the code, but will do so at some point and see how you have nitted it together. Very impressive so far even if the new turtle not is launching and replicate further!

Thanks for sharing.

/sEi
Meit #11
Posted 03 March 2017 - 05:38 PM
dope, If you do it once on a server, it will create thousands which will create hundreds of thousands which will create millions which will create billions which will create trillions which will create explosion in the host server :D/>
jk, but too much can cause the whole server to overload and lag badly, good job man

EDIT: There is a problem at replicator:206, after it went collecting sand (for the first time when it went after cutting trees 2nd time) and got the sand and came up again, it went between the 2 chests (in the middle block between them two) and then stopped there and error 206:storage inconsistency
Edited on 03 March 2017 - 07:02 PM
buzzawak #12
Posted 30 June 2017 - 12:18 PM
I haven't had any luck getting this working either. I had a quick chat with Johan Nordberg the author but unfortunately he does not have the time available to help.
Edited on 30 June 2017 - 10:20 AM
Lupus590 #13
Posted 30 June 2017 - 12:48 PM
What happens when you try to get it to work? Do any errors pop up?
buzzawak #14
Posted 30 June 2017 - 01:21 PM
What happens when you try to get it to work? Do any errors pop up?

These are the two errors, I know zero about classes to figure what is happenng.

Edited on 30 June 2017 - 11:25 AM
Bomb Bloke #15
Posted 30 June 2017 - 01:44 PM
Which version of ComputerCraft are we talking about?
buzzawak #16
Posted 30 June 2017 - 01:55 PM
Which version of ComputerCraft are we talking about?

1.80pr0
Lupus590 #17
Posted 30 June 2017 - 03:10 PM
What do the errors look like when you run it through this? http://www.computercraft.info/forums2/index.php?/topic/27844-trace-simple-stack-traces-for-errors/
buzzawak #18
Posted 01 July 2017 - 02:02 AM
What do the errors look like when you run it through this? http://www.computerc...ces-for-errors/




The level of coding in the replicator program is way above my pay grade. I think I need to play with simpler stuff for a while and build up to here.
Edited on 01 July 2017 - 12:12 AM
KingofGamesYami #19
Posted 01 July 2017 - 02:24 AM
My guess is that class isn't being loaded. I don't know why. What happens if you run 'lib/class'? Does it error? If not, will replicator work after running it?
Bomb Bloke #20
Posted 01 July 2017 - 06:34 AM
Here's the problem: Dan has changed shell.run() to start new scripts in a new environment every time, instead of just using the shell's own environment table as it does in older builds. This means that if a script dumps a bunch of stuff into its global environment then it'll all be cleared when that script ends. More specifically, it means that vici's version of "require" is now broken.

Fortunately the same change to ComputerCraft also brought with it a version of "require" which will work here, so the fix is a simple tweak to line 16 in the "replicator" file:

if redstone and not require then
Edited on 01 July 2017 - 04:44 AM
buzzawak #21
Posted 01 July 2017 - 11:33 AM
Thank Bomb Bloke, that has done the trick. The turtle headed skyward and started building its replication station.

After a about 30mins stopped with a self generated error message
"replicator:1280 unable to access disk"

The turtle has the red-stone and cobblestone but didn't make the needed stone to create a disk drive.
It did make a floppy disc for it.

I ran the code 3 time with it stopping at the same point and same error.

will have a bit more of a play with it and try to sus out the problem

Thanks again
Bomb Bloke
Bomb Bloke #22
Posted 01 July 2017 - 11:54 AM
Without testing it, or reviewing the code too thoroughly, I would guess that changing line 1480 might fix that:

 if not self.state.have_floppy and self.state.have_disk_drive then

Basically the turtle seems to want to place its floppy into a drive immediately after crafting the former, but potentially before crafting the latter.
buzzawak #23
Posted 02 July 2017 - 08:19 AM
I spent a bit of time following the turtle around and it does actually makes a disk drive and floppy but drops the drive which ends up on the ground instead of on its floating station.
If you manually get the drive and place it on the station the turtle keeps going but when it makes the computer this then gets dropped to the ground.
Bomb Bloke #24
Posted 02 July 2017 - 12:59 PM
Lines 1250 / 1368 refer to disk drives as "ComputerCraft:CC-Peripheral", but in current CC builds they're called "computercraft:peripheral".

If other objects appear to be causing similar issues, placing them into a turtle's inventory and calling turtle.getItemDetail() will show you their names.
jakejakey #25
Posted 13 February 2018 - 12:11 AM
This is, simply put, a work of art.

Many have dreamed of creating a program that would do this,
but you have taken a step further and have actually done it.

I have only a few suggestions,
  1. Program in an option to stop replication after a certain generation of turtle. (to avoid colonizing the entire planet)
  2. Turtles with islands that are surrounded with other island should continue to farm, and bring down their farmed resources in shipments.
  3. Bomb bloke's idea to create artifacts would be difficult, but very interesting.