Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Platform
- -- by Fenthis
- args = { ... }
- forward = tonumber(args[1])
- right = tonumber(args[2])
- if not (forward and right) then
- print("Usage: platform forward right")
- exit()
- end
- if not act then
- os.loadAPI("act")
- if not act then
- print("act api required.")
- exit()
- end
- end
- function do_left_or_right(dir)
- if dir then
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- end
- function is_odd(n)
- return ((n % 2) == 1)
- end
- for r = 1,right do
- for x = 1,forward do
- act.select(1)
- act.placeDown()
- if x ~= forward then
- act.try()
- end
- end
- if r ~= right then
- do_left_or_right(not is_odd(r))
- act.try()
- do_left_or_right(not is_odd(r))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement