Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function line(x)
- for i=1,x do
- while turtle.detect() do
- turtle.dig()
- end
- turtle.forward()
- turtle.digDown()
- if turtle.getItemCount(13)>0 then
- turtle.select(13)
- elseif turtle.getItemCount(14)>0 then
- turtle.select(14)
- elseif turtle.getItemCount(15)>0 then
- turtle.select(15)
- elseif turtle.getItemCount(16)>0 then
- turtle.select(16)
- end
- turtle.placeDown()
- end
- end
- function check(x,y)
- while true do
- total = 0
- for i=13, 16 do
- total = total + turtle.getItemCount(i)
- end
- if x+x+y+y>=total then
- print "Ograde: OK."
- break
- else
- print ("Nedovoljno ograda! Stavi još ", x+x+y+y-total, " ograda u slotove 13-16.")
- end
- end
- end
- --GLAVNI PROGRAM
- local tArgs = {...}
- local a = 0
- local b = 0
- a = tonumber(tArgs[1])
- b = tonumber(tArgs[2])
- check(a,b)
- turtle.up()
- line(a)
- turtle.turnRight()
- line(b)
- turtle.turnRight()
- line(a)
- turtle.turnRight()
- line(b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement