ComputerCraft Archive

Turtle Architect v2.0, the ULTIMATE turtle planning/construc

computer utility unknown forum

Description

Turtle Architect 2.0VTZ6CqWYGitHub-By CometWolf[attachment=2033:Skjermbilde.JPG]Turtle Architect allows you to easily plan and draw your Minecraft construction using a CC computer. Then have turtles b...

Installation

Copy one of these commands into your ComputerCraft terminal:

Pastebin:pastebin get Kw0tbAhm turtle_architect_v2.0,_the_ultimate_turtle_planning/construc
wget:wget https://pastebin.com/raw/Kw0tbAhm turtle_architect_v2.0,_the_ultimate_turtle_planning/construc
Archive:wget https://cc.shobie.xyz/cc/get/pb-Kw0tbAhm turtle_architect_v2.0,_the_ultimate_turtle_planning/construc
Quick Install: wget https://cc.shobie.xyz/cc/get/pb-Kw0tbAhm Turtle Architect v2.0, the ULTIMATE turtle planning/construc

Usage

Run the program after downloading

Tags

forumturtle-programs

Source

View Original Source

Code Preview

local program = shell.getRunningProgram()
local tArg = {...}
if not tArg[1] then
  print("Usage: "..program.." fileName")
  return
end
if fs.exists(tArg[1]) then
  local file = fs.open(tArg[1],"r")
  local tBlueprint = {}
  local tColorSlots = {}
  local tOrigin = {}
  if file.readLine() == "Blueprint file for CometWolf's Turtle Architect. Pastebin: Kt4D8uyE" then
    tBlueprint = textutils.unserialize(file.readLine())
    local colors = file.readLine()
    if colors then
      tColorSlots = textutils.unserialize(colors)
    end
  end
  file.close()
  if tBlueprint and #tBlueprint > 0 then
    local file = fs.open(tArg[1],"w")
    file.writeLine("Blueprint file for CometWolf's Turtle Architect. Pastebin: Kt4D8uyE")
    for layer=1,#tBlueprint do
      file.writeLine("Layer "..layer.." :")
      tBlueprint[layer] = tBlueprint[layer] or {}
      for x=1,#tBlueprint[layer] do
        local line = "X"..x..string.rep(" ",#string.format(#tBlueprint[layer])-#string.format(x))..": "
        for z=1,#tBlueprint[layer][x] do
          local block = tBlueprint[layer][x][z] or "0"
          line = line..block..string.rep(" ",3-#string.format(block))
        end
        file.writeLine(line)
      end
    end
    file.writeLine"Color slots table:"
    file.writeLine(textutils.serialize(tColorSlots))
    file.writeLine"Build origin data:"
    file.writeLine(textutils.serialize(tOrigin))
    file.close()
    print("Sucessfully converted :"..tArg[1])
    return
  end
end
error("Invalid file: "..tArg[1])