Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function moveTo(x,y)
- --X CNT/ItemNumber--
- print("Our X Is: "..x)
- if x > 6 and x <= 12 then y = 1 x = x -6
- elseif x > 12 and x <= 18 then y = 2 x = x -12
- elseif x > 18 and x <= 24 then y = 3 x = x -18
- elseif x > 24 and x <= 30 then y = 4 x = x -24
- elseif x > 30 and x <= 36 then y = 5 x = x -30
- elseif x == 36 then print("Out Of Space.")
- else y = 0
- end
- for i=1,y do
- turtle.up()
- end
- for i=1,x do
- turtle.back()
- end
- turtle.turnLeft()
- turtle.drop()
- print(x.." "..y)
- return
- end
- -----------------------
- function returnHome()
- turtle.select(1)
- turtle.turnRight()
- for i=1,8 do
- turtle.forward()
- end
- for i=1,13 do
- turtle.down()
- end
- end
- ---------------------
- --returnHome()
- if turtle.suckDown() == false and turtle.getItemCount() == 0 then
- print("Empty.")
- return
- end
- -----------
- if turtle.getItemCount() == 0 then
- turtle.select(1)
- turtle.suckDown()
- name = turtle.getItemDetail()["name"]
- meta = turtle.getItemDetail()["damage"]
- item = name..meta
- else
- turtle.select(1)
- name = turtle.getItemDetail()["name"]
- meta = turtle.getItemDetail()["damage"]
- item = name..meta
- end
- local cnt = 0
- if fs.exists("items") then
- term.setTextColor(colors.orange)print("Checking System...")
- local file = fs.open("items","r")
- local contet = {}
- for line in file.readLine do
- cnt = cnt +1
- if line:find(item) then
- term.setTextColor(colors.red) print("Item Here. Line: "..cnt) cntt = cnt
- itemHere = "1"
- end
- end
- file.close()
- end
- if itemHere == "1" then
- term.setTextColor(colors.blue) print("Routing To Storage")
- term.setTextColor(colors.yellow) print(cntt)
- moveTo(cntt,0)
- returnHome()
- os.reboot()
- --elseif cnt > 36 then print("No Space.")
- else
- term.setTextColor(colors.green)
- print("Item Not Here! Logging it!")
- local file = fs.open("items","a")
- file.writeLine(item)
- file.close()
- os.reboot()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement