SHARE
TWEET
ComputerCraft AutoPilot by likilike1234
a guest
Jan 29th, 2018
52
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- --[DIRECTIONS[ +X EAST, -X WEST, +Z SOUTH, -Z NORTH]]
- --SOURCE COORDINATES and DIRECTION COORDINATES
- SX = 0
- SZ = 0
- DX = 0
- DZ = 0
- --SOURCE COORDINATES and DIRECTION COORDINATES
- --MEMORY
- MX = 0
- MZ = 0
- --MEMORY
- --DIRECTION NUMBER OF BLOCKS
- X = 0
- Z = 0
- --DIRECTION NUMBER OF BLOCKS
- --DIRECTION
- EAST = 0
- WEST = 0
- SOUTH = 0
- NORTH = 0
- --DIRECTION
- --QUESTIONS
- print("Zadej ODKUD X: ")
- SX = tonumber(read())
- print("Zadej ODKUD Z: ")
- SZ = tonumber(read())
- print("Zadej KAM X: ")
- DX = tonumber(read())
- MX = DX
- print("Zadej KAM Z: ")
- DZ = tonumber(read())
- MZ = DZ
- --QUESTIONS
- --PLUS
- if SX > 0 then
- if DX > 0 then
- X = SX - DX
- X = math.abs(X)
- EAST = 1
- end
- end
- if SZ > 0 then
- if DZ > 0 then
- Z = SZ - DZ
- Z = math.abs(Z)
- SOUTH = 1
- end
- end
- --PLUS
- --MINUS
- if SX < 0 then
- if DX < 0 then
- X = math.abs(SX) - math.abs(DX)
- X = math.abs(X)
- WEST = 1
- end
- end
- if SZ < 0 then
- if DZ < 0 then
- Z = math.abs(SZ) - math.abs(DZ)
- Z = math.abs(Z)
- NORTH = 1
- end
- end
- --MINUS
- --PLUS/MINUS
- if SX > 0 then
- if DX < 0 then
- X = math.abs(SX) + math.abs(DX)
- X = math.abs(X)
- WEST = 1
- end
- end
- if SZ > 0 then
- if DZ < 0 then
- Z = math.abs(SZ) + math.abs(DZ)
- Z = math.abs(Z)
- NORTH = 1
- end
- end
- --PLUS/MINUS
- --MINUS/PLUS
- if SX < 0 then
- if DX > 0 then
- X = math.abs(SX) + math.abs(DX)
- X = math.abs(X)
- EAST = 1
- end
- end
- if SZ < 0 then
- if DZ > 0 then
- Z = math.abs(SZ) + math.abs(DZ)
- Z = math.abs(Z)
- SOUTH = 1
- end
- end
- --MINUS/PLUS
- --DEBUG PRINT
- print("X:")
- print(X)
- print(" ")
- print("Z:")
- print(Z)
- print(" ")
- print("Directions:")
- print(" ")
- print("EAST:")
- print(EAST)
- print(" ")
- print("WEST:")
- print(WEST)
- print(" ")
- print("SOUTH:")
- print(SOUTH)
- print(" ")
- print("NORTH:")
- print(NORTH)
- --DEBUG PRINT
RAW Paste Data

