
robsminer
By: a guest on
Sep 16th, 2012 | syntax:
None | size: 2.46 KB | hits: 22 | expires: Never
function gotoy()
repeat
if p2y > p1y then
term.clear()
term.setCursorPos(1, 1)
write ("Current Y Coords ")
print(p1y)
rs.setBundledOutput("right", colors.lime)
sleep(1)
rs.setBundledOutput("right", 0)
sleep(2)
p1y = p1y+1
elseif p2y < p1y then
term.clear()
term.setCursorPos(1, 1)
write ("Current Y Coords ")
print(p1y)
sleep(1)
rs.setBundledOutput("right", colors.orange)
sleep(1)
rs.setBundledOutput("right", 0)
sleep(1)
p1y = p1y-1
end
until p2y == p1y
end
function gotox()
repeat
if p2x > p1x then
term.clear()
term.setCursorPos(1, 1)
write ("Current X Coords ")
print(p1x)
rs.setBundledOutput("right", colors.white)
sleep(1)
rs.setBundledOutput("right", 0)
sleep(2)
p1x = p1x+1
elseif p2x < p1x then
term.clear()
term.setCursorPos(1, 1)
write ("Current X Coords ")
print(p1x)
rs.setBundledOutput("right", colors.magenta)
sleep(1)
rs.setBundledOutput("right", 0)
sleep(2)
p1x = p1x-1
end
until p2x == p1x
end
function gotoz()
repeat
if p2z > p1z then
term.clear()
term.setCursorPos(1, 1)
write ("Current Z Coords ")
print(p1z)
rs.setBundledOutput("right", colors.lightBlue)
sleep(1)
rs.setBundledOutput("right", 0)
sleep(2)
p1z = p1z+1
elseif p2z < p1z then
term.clear()
term.setCursorPos(1, 1)
write ("Current Z Coords ")
print(p1z)
rs.setBundledOutput("right", colors.pink)
sleep(1)
rs.setBundledOutput("right", 0)
sleep(2)
p1z = p1z-1
end
until p2z == p1z
end
term.clear()
term.setCursorPos(1, 1)
print ("enter current x")
p1x = tonumber(io.read())
term.clear()
term.setCursorPos(1, 1)
print ("enter current z")
p1z = tonumber(io.read())
term.clear()
term.setCursorPos(1, 1)
print ("enter current y")
p1y = tonumber(io.read())
term.clear()
term.setCursorPos(1, 1)
print ("enter destination x")
p2x = tonumber(io.read())
term.clear()
term.setCursorPos(1, 1)
print ("enter destination z")
p2z = tonumber(io.read())
term.clear()
term.setCursorPos(1, 1)
print ("enter destination y")
p2y = tonumber(io.read())
term.clear()
term.setCursorPos(1, 1)
print ("Please check your course. You will be moving the following amount of blocks:")
print ("")
write ("X ")
print (p2x-p1x)
write ("Z ")
print (p2z-p1z)
write ("Y ")
print (p2y-p1y)
print ("Is this ok?")
input = io.read()
if input == "yes" then
gotoy()
gotox()
gotoz()
else
print(sucks)
end
print(done)