Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open( "right" )
- function refuel()
- r=turtle.refuel()
- end
- function sobe(n)
- for i= 1,n,1 do
- a=peripheral.call("left","move",1,false,false)
- if a then
- b=turtle.up()
- if b==false then
- tomove=1
- refuel()
- end
- end
- sleep(0.96)
- end
- end
- function desce(z)
- for i= 1,z,1 do
- a=peripheral.call("left","move",0,false,false)
- if a then
- b=turtle.down()
- if b==false then
- tomove=-1
- refuel()
- end
- end
- sleep(0.96)
- end
- end
- function irpara(an)
- if tonumber(an)>tonumber(andar) then
- local paradescer= tonumber(an)-tonumber(andar)
- desce(paradescer*5)
- irp=false
- andar= an
- elseif tonumber(an)<tonumber(andar) then
- local parasubir= tonumber(andar)-tonumber(an)
- sobe(parasubir*5)
- irp=false
- andar= an
- end
- end
- while true do
- term.clear()
- if andar then
- print("==========================================")
- print("== ~>> PRO ELEVATOR 2.0 BY JOE <<~ ===")
- print("==== =[Deseja ir para qual andar?]= ====")
- print("==========================================")
- irp=read()
- irpara(irp)
- else
- print("==========================================")
- print("== ~>> PRO ELEVATOR 2.0 BY JOE <<~ ===")
- print("==== =[Em que andar estamos?]= ====")
- print("==========================================")
- andar=read()
- term.clear()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement