Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function majnuj()
- for j=1,100 do
- turtle.select(14)
- turtle.refuel(2)
- for i=1,100 do
- print(i)
- turtle.dig()
- local blok=turtle.detect()
- if(blok==true) then
- turtle.dig()
- end
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- if(i%10==0)and (j%10==1) and (i<92) then
- turtle.select(16)
- turtle.placeDown()
- end
- if(i==99) then
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- turtle.select(15)
- turtle.placeDown()
- for r=1,13 do
- turtle.select(r)
- turtle.dropDown()
- end
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- turtle.forward()
- end
- if((j%2==0)and (i==100))then
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnLeft()
- elseif ((j%2~=0) and (i==100)) then
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnRight()
- end
- end
- end
- return j;
- end
- local function vratise(PrethodnoMajnovano, level)
- turtle.turnRight()
- for i=0,(100+PrethodnoMajnovano) do
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.forward()
- for i=level,60 do
- turtle.up()
- end
- end
- local function idinalevel(level)
- print(level)
- local l=60-level
- for i=1,l do
- turtle.down()
- end
- turtle.turnRight()
- turtle.turnRight()
- end
- local function IdiNaPRethodno(PrethodnoMajnovano)
- turtle.forward()
- turtle.turnRight()
- for i=0,PrethodnoMajnovano do
- local blok=turtle.detect()
- if(blok==true) then
- turtle.dig()
- end
- turtle.forward()
- end
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.turnLeft()
- end
- rednet.open("right")
- local level
- local PrethodnoMajnovano=0
- while true do
- id,poruka=rednet.receive()
- if (poruka=="start")or (poruka=="estart")then
- rednet.send(32, "Majner ukljucen...")
- print("KRECEM")
- rednet.send(32,"Unesite Visinu pocetka majnovanja...")
- id, level=rednet.receive()
- if(poruka=="estart")then
- rednet.send(32, "Unesite Prethodnu kolonu majnovanja...")
- id, PrethodnoMajnovano=rednet.receive()
- end
- idinalevel(level)
- if(PrethodnoMajnovano>0) then
- IdiNaPRethodno(PrethodnoMajnovano)
- end
- PrethodnoMajnovano=PrethodnoMajnovano+majnuj()
- vratise(PrethodnoMajnovano,level)
- rednet.send(32,"Masina na pocetnom poloziaju... Ukupno izmajnovanih kolona blokova:")
- rednet.send(32, PrethodnoMajnovano)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement