Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pasteID = "http://pastebin.com/raw.php?i=7CKzmErC"
- debug = true
- pasteContent = http.get(pasteID)
- Paste = pasteContent.readAll()
- pasteContent.close()
- function update()
- file = fs.open("startup","r")
- contents = file.readAll()
- file.close()
- if (Paste ~= contents) then
- print("Updating program...")
- shell.run("delete","startup")
- wFile = fs.open("startup","w")
- wFile.write(Paste)
- wFile.close()
- sleep(1)
- os.reboot()
- end
- end
- function checkItem(slot)
- local data = turtle.getItemDetail(slot)
- print("checking slot ", slot)
- turtle.select(slot)
- if (data) then
- print(data.name)
- if (string.find(data.name,"ore")) then
- if (string.find(data.name,"toolbox") == false) then
- turtle.select(slot)
- turtle.turnRight()
- turtle.drop()
- turtle.turnLeft()
- else
- turtle.select(slot)
- turtle.turnLeft()
- turtle.drop()
- turtle.turnRight()
- end
- else
- turtle.select(slot)
- turtle.turnLeft()
- turtle.drop()
- turtle.turnRight()
- end
- end
- end
- update()
- while true do
- for i = 1,16 do
- checkItem(i)
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement