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

[CC1.64+] Wool Image Printer

Started by Bomb Bloke, 20 June 2017 - 02:31 PM
Bomb Bloke #1
Posted 20 June 2017 - 04:31 PM
pastebin get c3wpz9LA wiprint


I spent over an hour looking for the original art source but I can't find it


So um yeah, give a turtle some wool blocks and an image, and it'll build it.

wiprint <imageName>

Works on NFPs (from paint) or GIFs. Can also build using clay or glass, if you like. You'll be advised of the block requirements before it begins, and the turtle will return to the start point whenever it runs out of a given colour (or if it runs low on fuel). Construction starts from the lower left corner of the image, and the result should be viewed from the turtle's right side.

If the turtle gets interrupted for whatever reason (eg its chunk unloaded), you can just re-run the script and it'll offer to resume. If it doesn't have a modem or you don't have a GPS set up, you'll need to first place it back at the starting point before setting it off again - I recommend you stick a block of wood or something under that location so's you can be sure to find it later.

When movement is obstructed, the turtle will simply wait patiently for manual clearance. When block placement is obstructed, it'll skip that position and move on.

If you want to build a GIF, then I recommend rendering it to a monitor first so that you've got some idea as to how the colours will convert. This basic script simply renders whatever image to the first found monitor:

pastebin get EPegdExd drawgif

drawgif <someGif>

Version History2017/06/21
1.0.0
Initial release.
Exerro #2
Posted 21 June 2017 - 07:45 PM
Neat. Why not get it working with more block types? I'm mainly thinking of hardened clay (and concrete for when CC updates), but even stone would be decent as it's fairly evenly coloured, like a few other blocks. Maybe add an option to limit the blocks it uses too, like –blockset-wool or something?
Bomb Bloke #3
Posted 23 June 2017 - 02:32 PM
It'll already accept clay / glass as an alternative to wool, though it'd be simple enough to get it to differentiate between the different materials for greater colour depth (assuming not too many textures have changed since 1.7.10, when I mapped out the hues). But then previewing the results becomes trickier - a ComputerCraft monitor would no longer cut the mustard.

I suppose that's my cue to update skyTerm. That plus a throw-away creative world would make it pretty easy to test things out.
MineRobber___T #4
Posted 05 July 2017 - 02:46 AM
When I gave my turtle an image ( http://i.imgur.com/p1Y3HyT.png ) and told it to run, it gave me block totals. I gave it the required blocks, typed "y" at the Proceed prompt, and pressed Enter.

The turtle then just sat there. It didn't move, nothing appeared on the screen.

What have I done wrong? Using latest snapshot of CC.
Anavrins #5
Posted 05 July 2017 - 03:23 AM
Never forget to fuel your turtles beforehand.
MineRobber___T #6
Posted 05 July 2017 - 03:30 AM
Never forget to fuel your turtles beforehand.
I turned fuel off (so it doesn't need fuel)
Bomb Bloke #7
Posted 05 July 2017 - 12:43 PM
If the turtle sits stationary without erroring, then either its path is blocked (are there blocks in front of the turtle…?), it's in a protected area (are you trying to get a turtle to move around spawn…?), or it's indeed out of fuel (have you double checked your config…?).

In any case, if you simply enter the Lua console and enter turtle.forward(), you'll very likely be advised as to the problem.