Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Template for 2 commands l.lua and r.lua
- Use: r 3 turn right 2x
- Use: l 3 turn left 3x
- ]]
- args = {...}
- function main()
- local numTurns = 0
- if args[1] ~= nil then
- for i = 1, args[1], 1 do
- -- if turtle.turnRight() then --r.lua
- if turtle.turnLeft() then -- l.lua
- numTurns = numTurns + 1
- end
- end
- else
- -- if turtle.turnRight() then -- r.lua
- if turtle.turnLeft() then -- l.lua
- numTurns = 1
- end
- end
- -- print("Turned Right "..numTurns.." times") -- r.lua
- print("Turned Left "..numTurns.." times") -- l.lua
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement