Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Arguements
- tArgs = {...}
- type = tArgs[1]
- action = tArgs[2]
- nTimes = tArgs[3]
- if not tArgs[1] or not tArgs[2] then
- print("Usage: quarry move/dig amount")
- return(0)
- end
- if not tArgs[3] then
- nTimes = 1
- end
- colors = {"colors.white", "colors.orange", "colors.magenta", "colors.lightBlue", "colors.yellow", "colors.lime", "colors.pink", "colors.grey", "colors.lightGrey", "colors.cyan", "colors.purple", "colors.blue", "colors.brown", "colors.green", "colors.red", "colors.black"}
- -- Functions
- function redstonePulse(color,amount)
- for i = 1, amount do
- redstone.setBundledOutput("left",color)
- sleep(2)
- redstone.setBundledOutput("left",0)
- sleep(2)
- end
- end
- function dig()
- end
- function move(direction,distance)
- if direction == "forward" then
- redstonePulse(colors[1],distance)
- elseif direction == "back" then
- redstonePulse(colors[3],distance)
- elseif direction == "left" then
- redstonePulse(colors[2],distance)
- elseif direction == "right" then
- redstonePulse(colors[15],distance)
- elseif direction == "up" then
- redstonePulse(colors[5],distance)
- elseif direction == "down" then
- redstonePulse(colors[12],distance)
- else print("Error. Incorrect direction.")
- return(0)
- end
- end
- -- Main
- if type == "move" then
- move(action,nTimes)
- elseif type == "dig" then
- dig()
- else print("Error. Incorrect action.")
- return(0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement