Don't like ads? PRO users don't see any ads ;-)
Guest

robsminer

By: a guest on Sep 16th, 2012  |  syntax: None  |  size: 2.46 KB  |  hits: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. function gotoy()
  2.         repeat
  3.         if p2y > p1y then
  4.                 term.clear()
  5.                 term.setCursorPos(1, 1)
  6.                 write ("Current Y Coords ")
  7.                 print(p1y)
  8.                 rs.setBundledOutput("right", colors.lime)
  9.                 sleep(1)
  10.                 rs.setBundledOutput("right", 0)
  11.                 sleep(2)
  12.                 p1y = p1y+1
  13.         elseif p2y < p1y then
  14.                 term.clear()
  15.                 term.setCursorPos(1, 1)
  16.                 write ("Current Y Coords ")
  17.                 print(p1y)
  18.                 sleep(1)
  19.                 rs.setBundledOutput("right", colors.orange)
  20.                 sleep(1)
  21.                 rs.setBundledOutput("right", 0)
  22.                 sleep(1)
  23.                 p1y = p1y-1
  24.         end
  25.         until p2y == p1y
  26. end
  27.        
  28. function gotox()
  29.         repeat
  30.         if p2x > p1x then
  31.                 term.clear()
  32.                 term.setCursorPos(1, 1)
  33.                 write ("Current X Coords ")
  34.                 print(p1x)
  35.                 rs.setBundledOutput("right", colors.white)
  36.                 sleep(1)
  37.                 rs.setBundledOutput("right", 0)
  38.                 sleep(2)
  39.                 p1x = p1x+1
  40.         elseif p2x < p1x then
  41.                 term.clear()
  42.                 term.setCursorPos(1, 1)
  43.                 write ("Current X Coords ")
  44.                 print(p1x)
  45.                 rs.setBundledOutput("right", colors.magenta)
  46.                 sleep(1)
  47.                 rs.setBundledOutput("right", 0)
  48.                 sleep(2)
  49.                 p1x = p1x-1
  50.         end
  51.         until p2x == p1x
  52. end
  53.        
  54. function gotoz()
  55.         repeat
  56.         if p2z > p1z then
  57.                 term.clear()
  58.                 term.setCursorPos(1, 1)
  59.                 write ("Current Z Coords ")
  60.                 print(p1z)
  61.                 rs.setBundledOutput("right", colors.lightBlue)
  62.                 sleep(1)
  63.                 rs.setBundledOutput("right", 0)
  64.                 sleep(2)
  65.                 p1z = p1z+1
  66.         elseif p2z < p1z then
  67.                 term.clear()
  68.                 term.setCursorPos(1, 1)
  69.                 write ("Current Z Coords ")
  70.                 print(p1z)
  71.                 rs.setBundledOutput("right", colors.pink)
  72.                 sleep(1)
  73.                 rs.setBundledOutput("right", 0)
  74.                 sleep(2)
  75.                 p1z = p1z-1
  76.         end
  77.         until p2z == p1z
  78. end
  79.  
  80. term.clear()
  81. term.setCursorPos(1, 1)
  82. print ("enter current x")
  83. p1x = tonumber(io.read())
  84. term.clear()
  85. term.setCursorPos(1, 1)
  86. print ("enter current z")
  87. p1z = tonumber(io.read())
  88. term.clear()
  89. term.setCursorPos(1, 1)
  90. print ("enter current y")
  91. p1y = tonumber(io.read())
  92. term.clear()
  93. term.setCursorPos(1, 1)
  94.  
  95. print ("enter destination x")
  96. p2x = tonumber(io.read())
  97. term.clear()
  98. term.setCursorPos(1, 1)
  99. print ("enter destination z")
  100. p2z = tonumber(io.read())
  101. term.clear()
  102. term.setCursorPos(1, 1)
  103. print ("enter destination y")
  104. p2y = tonumber(io.read())
  105. term.clear()
  106. term.setCursorPos(1, 1)
  107.  
  108. print ("Please check your course. You will be moving the following amount of blocks:")
  109. print ("")
  110. write ("X ")
  111.         print (p2x-p1x)
  112. write ("Z ")
  113.         print (p2z-p1z)
  114. write ("Y ")
  115.         print (p2y-p1y)
  116. print ("Is this ok?")
  117.  
  118. input = io.read()
  119.         if input == "yes" then
  120.         gotoy()
  121.         gotox()
  122.         gotoz()
  123.         else
  124.         print(sucks)
  125. end
  126. print(done)