Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- local command = tArgs[1]
- local p1 = tArgs[2]
- local p2 = tArgs[3]
- local p3 = tArgs[4]
- local p4 = tArgs[5]
- -- Move in a direction --
- if (command == "up") then
- orion.up(p1)
- elseif (command == "down") then
- orion.down(p1)
- elseif (command == "turnleft") then
- orion.turnLeft()
- elseif (command == "turnright") then
- orion.turnRight()
- elseif (command == "forward") then
- orion.forward(p1)
- elseif (command == "back") then
- orion.back(p1)
- elseif (command == "left") then
- orion.goLeft(p1)
- elseif (command == "right") then
- orion.goRight(p1)
- --Go in a cardinal direction --
- elseif (command == "go") then
- if (p1 == "north") then
- orion.goNorth()
- elseif (p1 == "south") then
- orion.goSouth()
- elseif (p1 == "west") then
- orion.goWest()
- elseif (p1 == "east") then
- orion.goEast()
- elseif (p1 == "up") then
- orion.goUp()
- elseif (p1 == "down") then
- orion.goDown()
- end
- -- face a cardinal direction --
- elseif (command == "face") then
- if (p1 == "west") then
- orion.faceWest()
- elseif (p1 == "east") then
- orion.faceEast()
- elseif (p1 == "south") then
- orion.faceSouth()
- elseif (p1 == "north") then
- orion.faceNorth()
- elseif (p1 == "back") then
- orion.faceBack()
- end
- -- Set current facing as north --
- elseif (command == "setnorth") then
- orion.setNorth()
- -- Set current position as x, y, z, facing in number south being 0 west being 3 --
- elseif (command == "setpos") then
- if (p1 and p2 and p3 and not p4) then
- orion.setPos(p1,p2,p3)
- orion.setNorth()
- elseif (p1 and p2 and p3 and p4) then
- orion.setPos(p1,p2,p3,p4)
- else
- print("Need to give all three coordinates, and make sure the computer is facing North or give facing too.")
- end
- -- Set the desired drop location as x, y, z
- elseif (command == "setdrop") then
- if (p1 and p2 and p3 and not p4) then
- orion.setDrop(p1,p2,p3)
- else
- print("Need to give all three coordinates.")
- end
- -- Print the current drop location --
- elseif (command == "getdrop") then
- local theDrop = orion.getDrop()
- if (theDrop) then
- theDrop = orion.seperate(theDrop,",")
- print("x: "..theDrop[1]..", y: "..theDrop[2]..", z: "..theDrop[3])
- end
- -- Print the current location --
- elseif (command == "getpos") then
- local thePos = { orion.getPos() }
- thePos[4] = orion.getFacing()
- print("x: "..thePos[1]..", y: "..thePos[2]..", z: "..thePos[3])
- print("Facing: "..thePos[4])
- elseif (command == "getfilepos") then
- local theX,theY,theZ,theFace = orion.getFilePos()
- if (theX) then
- orion.setPos(theX,theY,theZ,theFace)
- end
- elseif (command == "showpos") then
- orion.showPos()
- elseif (command == "savepos") then
- orion.savePos()
- -- Tell turtle to go to a location using collision detection --
- elseif (command == "newgoto") then
- if (p1 and p2 and p3) then
- orion.newGoto(p1,p2,p3)
- else
- print("Need to give all three coordinates.")
- end
- -- Tell turtle to go to a location digging its way there --
- elseif (command == "diggoto") then
- if (p1 and p2 and p3) then
- orion.goToPos(p1,p2,p3,true)
- else
- print("Need to give all three coordinates, and have current coordinates & direction set beforehand.")
- end
- elseif (command == "goto") then
- if (p1 and p2 and p3) then
- orion.goToPos(p1,p2,p3)
- else
- print("Need to give all three coordinates, and have current coordinates & direction set beforehand.")
- end
- elseif (command == "dirmgoto") then
- -- Do something
- elseif (command == "dirgoto") then
- -- Do something
- -- Dig a room from top left corner down in format depth/height, length, width --
- elseif (command == "smartdig") then
- if (p1 and not p4) then
- orion.smartDig(p1,p2,p3)
- elseif (p1 and p4) then
- orion.smartDig(p1,p2,p3,p4)
- else
- print("Need to give at least one value.")
- end
- -- Build a house using automated refilling station --
- elseif (command == "build") then
- orion.readBuild()
- else
- print("Enter a command.")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement