Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("tur")
- up = function (hei, front)
- for i=1, hei-1 do
- if front then tur.digSafe() end
- tur.upForce()
- end
- if front then tur.digSafe() end
- tur.downForce(hei-1)
- end
- row = function (len, hei)
- for i=1, len/2 do
- if i ~= 1 then tur.forwardForce(2) end
- up(hei, true)
- end
- if len%2 == 1 then
- tur.forwardForce(2)
- up(hei, false)
- tur.back()
- end
- tur.back(len-2)
- end
- subRoom = function (len, hei, wid, dir)
- for i=1, wid do
- if i~=1 then
- if dir=="right" then
- tur.strafeRightForce()
- else
- tur.strafeLeftForce()
- end
- end
- row(len, hei)
- end
- if dir=="right" then
- tur.strafeLeftForce(wid-1)
- else
- tur.strafeRightForce(wid-1)
- end
- end
- args = {...}
- wid = args[1]+0
- len = args[2]+0
- hei = args[3]+0
- start = args[4]
- if start == "right" then
- subRoom(len,hei,wid,"left")
- elseif start == "middle" then
- subRoom(len,hei,wid/2+1,"right")
- tur.strafeLeftForce()
- subRoom(len,hei,wid/2,"left")
- tur.strafeRightForce()
- else
- subRoom(len,hei,wid,"right")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement