Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Program TURRLE: WARE TURTLE
- Program složí ke skladu itemů v bednách.
- Jedná se o automatický sklad.
- Sklad obsluhuje TURTLE s GMS navigací.
- --]]
- --start new
- function Start()
- item = 0
- turtle.select(1)
- turtle.suckDown()
- --zjistime detaly itemu
- local data = turtle.getItemDetail()
- if data then
- print("Item name: ", data.name)
- name_data = data.name
- print("Item damage value: ", data.damage)
- damage_data = data.damage
- print("Item count: ", data.count)
- count_data = data.count
- item = 1
- else
- print("Ve slotu nejsou itemy.")
- item = 0
- end
- --konec detail itemu
- if item == 1 then
- --pokracuj, pokud jsou ve slotu itemy
- --Projdi databazi a zjisti, jestli je item (name_data) jiz v databazi
- -- zjisti pocet radku v DB
- ctr = 0
- for radek in io.lines"aaa" do
- ctr = ctr + 1
- --kontrola zda je v DB item - projdeme databazi
- result = {};
- for match in string.gmatch(radek, "([^,]+),?") do
- table.insert(result, match);
- end
- print(result[1]) -- souradnice X
- print(result[2]) -- souradnice Y
- print(result[3]) -- souradnice Z
- print(result[4]) -- item
- end
- print("Zpracovavany item v DB:")
- item_db = (result[4])
- if item_db == name_data then
- print("Item nalezen v DB. Radek:")
- print(radek)
- else
- print("Item nenalezen v databazi.")
- print(item_db)
- print(radek)
- end
- end
- end
- --konec new
- --"[^%s]+")
- Start()
- print("Konec")
Add Comment
Please, Sign In to add comment