Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- pastebin get 4WJAYH7n farm
- -- -------------------------------------------
- -- NagaStoneFarm -Sinkir-
- -- Version 0.1 (2014/10/21)
- -- SCANER FUNCTION :
- -- slot 16 ender chest Fuel +-+-+-+-+
- -- slot 15 ender chest dump Resources | | | | |
- -- | | | | |
- -- | | | | |
- -- | | |R|F|
- -- +-+-+-+-+
- -- -------------------------------------------
- -- _____
- -- | ___| _ _ __ ___
- -- | |_ | | | | '_ \ / __|
- -- | _|| |_| | | | | (__
- -- |_| \__,_|_| |_|\___|
- --
- function testFuel()
- if(fuel() < 1)then
- select(16)
- turtle.refuel()
- end
- if(count(16) == 0)then
- return false
- end
- return true
- end
- left = function()
- if(turtle.turnLeft()==false)then
- sleep(1)
- left()
- else
- return true
- end
- end
- right = function()
- if(turtle.turnRight()==false)then
- sleep(1)
- right()
- else
- return true
- end
- end
- count = function(id)
- return turtle.getItemCount(id)
- end
- back = function()
- return turtle.back()
- end
- go = function()
- return turtle.forward()
- end
- select = function(id)
- return turtle.select(id)
- end
- fuel = function()
- return turtle.getFuelLevel()
- end
- move = function(id, nb)
- return turtle.transferTo(id, nb)
- end
- --
- --
- --
- --
- function checkSlotVideScaner()
- if(count(6) == 0 and count(7) == 0)then
- return true
- end
- return false
- end
- function videInv()
- if(count(12) == 0 and count(13) == 0 and count(14) == 0)then
- return true
- end
- local i = 0
- select(15)
- turtle.digUp()
- turtle.placeUp()
- for i=1,14 do
- if(count(i)>0)then
- select(i)
- turtle.dropUp()
- end
- end
- select(15)
- turtle.digUp()
- return true
- end
- function initScan()
- if(count(16) == 0)then
- print("No ender chest for fuel in slot 16.., exit")
- return false
- end
- if(count(15) == 0)then
- print("No ender chest for dump resources in slot 15, exit")
- return false
- end
- return true
- end
- function gps()
- select(1)
- if(turtle.detect() == false and turtle.detectUp() == false and turtle.detectDown() == false)then
- back()
- right()
- if(turtle.detect() == false and turtle.detectUp() == false and turtle.detectDown() == false)then
- print('exit')
- stop=true
- end
- end
- if(turtle.detect())then
- turtle.dig()
- end
- if(turtle.detectUp())then
- turtle.digUp()
- end
- if(turtle.detectDown())then
- turtle.digDown()
- end
- go()
- end
- -- __ __ _ ____
- -- | \/ | __ _(_)_ __ / /\ \
- -- | |\/| |/ _` | | '_ \| | | |
- -- | | | | (_| | | | | | | | |
- -- |_| |_|\__,_|_|_| |_| | | |
- -- \_\/_/
- stop=false
- i = 0
- stopCounter = 1
- while(stop==false)do
- testFuel()
- gps()
- videInv()
- sleep(0.2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement