Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a=peripheral.wrap("front")
- me=peripheral.wrap("bottom")
- bees=a.getBeeBreedingData()
- allSpecies={}
- allSpString=""
- function addSp(str)
- if string.find(allSpString,str)==nil then
- allSpString=allSpString..str
- allSpecies[#allSpecies+1]=str
- end
- end
- for i=1, #bees do
- addSp(bees[i].allele1)
- addSp(bees[i].allele2)
- addSp(bees[i].result)
- end
- function addNBT(var,nbt)
- fp=fs.open("species","a")
- fp.writeLine("geneByNbt['"..nbt.."']="..var)
- fp.close()
- end
- geneByNbt={}
- shell.run("species")
- items=me.getAvailableItems()
- for i=1, #items do
- if geneByNbt[items[i].fingerprint]==nil then
- me.exportItem(items[i].fingerprint,"up")
- key=0
- spec=""
- while key~=28 do
- event, key = os.pullEvent("key")
- if key~=28 and key~=14 and key>11 then
- spec=spec..keys.getName(key)
- end
- term.clear()
- term.setCursorPos(1,1)
- term.write(spec)
- option={}
- for i2=1, #allSpecies do
- if string.find(allSpecies[i2])~=nil then
- option[#option+1]=allSpecies[i2]
- end
- end
- for i2=1, #options do
- term.setCursorPos(1,i2+2)
- term.write(i2.." "..options[i2])
- end
- if key>1 and key<11 then
- spec=option[key-1]
- end
- if key==14 then
- spec=string.sub(spec,1,#spec-1)
- end
- end
- addNBT(spec,items[i].fingerprint.nbt_hash)
- me.pullItem("up")
- end
- end
Add Comment
Please, Sign In to add comment