Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --file:ladder
- --pastebin:wc6RNHeV
- targs = {...}
- os.loadAPI("movement")
- local m = movement
- local ladderSlot = 1
- local wallSlot = 2
- m.reservedslots = 2
- if ( #targs ~= 2 ) then
- print("Usage : ladder <up|down> <count>")
- print("Slot 1 : Ladders.")
- print("Slot 2 : Walls")
- return
- end
- local direction = targs[1]
- local count = tonumber(targs[2])
- if (turtle.getItemCount(ladderSlot)< count) then
- print("not enough ladders in slot 1.")
- return
- end
- if (turtle.getItemCount(wallSlot)< count) then
- print("not enough walls in slot 2.")
- return
- end
- for i=1,count do
- m.turtleForward()
- m.paintForward(wallSlot)
- turtle.back()
- m.selectMaterial(ladderSlot)
- turtle.place()
- if direction == "up" then
- m.turtleUp()
- else
- m.turtleDown()
- end
- end
- -- return
- for i=1,count do
- if direction == "up" then
- m.turtleDown()
- else
- m.turtleUp()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement