Posted 26 October 2016 - 05:06 PM
So, I can't Build a torus without making mistakes so I get a handy dandy turtle to help and I am getting a error. It is quite complex because I could not find a way to redefine the function t later on in the code.
So, the code works in sections
1A, 1B, 2A, 2B and 1AA
The order it goes in now is 1A > 1B > 2A > 2B (Should go to 1AA then 1B) but it goes to 2B again… And I don't know why…
please halp also any improvements or tips would be greatly appreciated.
INSTALLER
1A
1B
2A
2B
1AA
Here is a pastebin if you need it: http://pastebin.com/sN8ebhvb
And this is what I am trying to automate…
Diameter : 75
Thickness: 11
Precision :1
http://www.plotz.co.uk/plotz-model.php?model=Torus
Thanks
- Ian
So, the code works in sections
1A, 1B, 2A, 2B and 1AA
The order it goes in now is 1A > 1B > 2A > 2B (Should go to 1AA then 1B) but it goes to 2B again… And I don't know why…
please halp also any improvements or tips would be greatly appreciated.
INSTALLER
term.clear()
term.setCursorPos(1,1)
print("Installing Very Complex Base Structure")
term.clear()
term.setCursorPos(1,1)
shell.run("pastebin get 07Z3mV6z 1A")
term.clear()
term.setTextColor(colors.green)
term.setCursorPos(1,1)
print("Done (1A)")
term.setCursorPos(1,5)
print("20%")
sleep(1)
shell.run("pastebin get m23gNpWJ 1B")
term.clear()
term.setCursorPos(1,1)
term.setTextColor(colors.green)
print("Done (1B)")
term.setCursorPos(1,5)
term.clearLine()
print("40%")
sleep(1)
shell.run("pastebin get mCqfNDNp 2A")
term.clear()
term.setCursorPos(1,1)
term.setTextColor(colors.green)
print("Done (2A)")
term.setCursorPos(1,5)
term.clearLine()
print("60%")
sleep(1)
shell.run("pastebin get HS8pPMam 2B")
term.clear()
term.setCursorPos(1,1)
term.setTextColor(colors.green)
print("Done (2B)")
term.setCursorPos(1,5)
term.clearLine()
print("80%")
sleep(1)
shell.run("pastebin get HS8pPMam 1AA")
term.clear()
term.setCursorPos(1,1)
term.setTextColor(colors.green)
print("Done (1A (Modified))")
term.setCursorPos(1,5)
term.clearLine()
print("100%")
sleep(1)
-- Refuel
term.setCursorPos(1,1)
term.clear()
term.setTextColor(colors.white)
print("Please Insert Fuel Into My First Slot")
sleep(5)
turtle.refuel()
term.clear()
term.setCursorPos(1,1)
print("Please Insert Building Material Into My Slots")
sleep(15)
-- Run
shell.run("1A")
1A
term.clear()
term.setCursorPos(1,1)
print("Building of Torus starting...")
turtle.place()
turtle.turnLeft()
turtle.forward()
turtle.turnRight()
turtle.forward()
turtle.turnRight()
-- Functions
local function t()
turtle.turnLeft()
turtle.back()
turtle.turnRight()
end
local function five()
local n = 5
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function four()
local n = 4
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function three()
local n = 3
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function two()
local n = 2
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function one()
local n = 1
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
-- 1A
five()
four()
three()
three()
one()
two()
one()
two()
one()
one()
one()
one()
one()
shell.run("1B")
1B
term.clear()
term.setCursorPos(1,1)
print("1B")
-- Functions
local function t()
turtle.turnRight()
turtle.back()
turtle.turnLeft()
end
local function five()
local n = 5
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function four()
local n = 4
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function three()
local n = 3
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function two()
local n = 2
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function one()
local n = 1
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
-- 1B
turtle.turnLeft()
two()
one()
two()
one()
three()
three()
four()
five()
turtle.turnRight()
turtle.place()
turtle.turnRight()
turtle.forward()
turtle.turnLeft()
turtle.forward()
turtle.turnLeft()
turtle.select(2)
shell.run("2A")
2A
term.clear()
term.setCursorPos(1,1)
print("Second Quarter 2A")
-- Functions
local function t()
turtle.turnLeft()
turtle.back()
turtle.turnRight()
end
local function five()
local n = 5
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function four()
local n = 4
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function three()
local n = 3
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function two()
local n = 2
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function one()
local n = 1
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
-- 2A
five()
four()
three()
three()
one()
two()
one()
two()
one()
one()
one()
one()
one()
shell.run("2B")
2B
term.clear()
term.setCursorPos(1,1)
print("Second Quarter 2B")
-- Functions
local function t()
turtle.turnRight()
turtle.back()
turtle.turnLeft()
end
local function five()
local n = 5
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function four()
local n = 4
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function three()
local n = 3
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function two()
local n = 2
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function one()
local n = 1
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
-- 2B
turtle.turnLeft()
two()
one()
two()
one()
three()
three()
four()
five()
turtle.back()
turtle.place()
turtle.select(3)
shell.run("1AA")
1AA
term.clear()
term.setCursorPos(1,1)
-- Functions
local function t()
turtle.turnLeft()
turtle.back()
turtle.turnRight()
end
local function five()
local n = 5
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function four()
local n = 4
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function three()
local n = 3
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function two()
local n = 2
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
local function one()
local n = 1
for x = 1,n do
turtle.back()
turtle.place()
end
t()
end
-- 1A
five()
four()
three()
three()
one()
two()
one()
two()
one()
one()
one()
one()
one()
shell.run("1B")
Here is a pastebin if you need it: http://pastebin.com/sN8ebhvb
And this is what I am trying to automate…
Diameter : 75
Thickness: 11
Precision :1
http://www.plotz.co.uk/plotz-model.php?model=Torus
Thanks
- Ian