Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args={...}
- gs=peripheral.wrap("peripheral_1") --genetic sampler
- mt=peripheral.wrap("peripheral_2") --advanced mutatron
- gt=peripheral.wrap("peripheral_0") --genetic transposer
- ac=peripheral.wrap("tile_extrautils_chestfull_name_0") --apiary IO chest
- ap_side="east"
- ap=peripheral.wrap("tile_for_apiculture_0_name_0") --apiary
- apci=peripheral.wrap("tileinterface_1") --apiary chest interface
- mtgti=peripheral.wrap("tileinterface_0") --mutatron/genetic transposer interface
- mti_side="up"
- gti_side="west"
- me=apci
- blank_sample={id="gendustry:GeneSampleBlank",dmg=0}
- --checking files
- if fs.exists("hashlist")~=true then
- shell.run("pastebin get mpSWTsDP hashlist")
- end
- --checking mode
- mode=args[1]
- if mode==nil then
- print("Welcome to BAM Bredding Automation Machine")
- print("Usage:")
- print("bam check: prints possible Spiecies to breed")
- end
- bp=ap.getBeeBreedingData() --breeding paris
- shell.run("hashlist")
- function getSpeciesinME()
- items=me.getAvailableItems()
- availableSpecies={}
- for i=1,#items do
- if items[i].fingerprint.id=="gendustry:GeneSample" then
- smp=sample[items[i].fingerprint.nbt_hash]
- if smp~=nil then
- availableSpecies[smp.value]=items[i].fingerprint
- end
- end
- end
- return availableSpecies
- end
- function getPossibleBreedingPairs()
- bp=ap.getBeeBreedingData()
- pbp={} --possible breeding pairs
- for i=1,#bp do
- if availableSpecies[bp[i].allele1]~=nil and availableSpecies[bp[i].allele2]~=nil then
- table.insert(pbp,bp[i])
- end
- end
- return pbp
- end
- function getPossibleNeededBreedingPairs()
- pnbp={} --possible needed breeding pairs
- for i=1, #pbp do
- if availableSpecies[pbp[i].result]==nil then
- table.insert(pnbp,pbp[i])
- end
- end
- return pnbp
- end
- function getRandomDrone()
- items=me.getAvailableItems()
- drone=nil
- for i=1,#items do
- if string.find(items[i].fingerprint.id,"beeDrone")~=nil then
- drone=items[i]
- end
- end
- if drone==nil then
- print("No Drone Found")
- end
- return drone
- end
- function getRandomPrincess()
- items=me.getAvailableItems()
- princess=nil
- for i=1,#items do
- if string.find(items[i].fingerprint.id,"beePrincess")~=nil then
- princess=items[i]
- end
- end
- if princess==nil then
- print("Your Princess is in another Castle")
- end
- return princess
- end
- function getTemplate()
- items=me.getAvailableItems()
- template=nil
- for i=1,#items do
- if string.find(items[i].fingerprint.id,"GeneTemplate")~=nil then
- template=items[i]
- end
- end
- if template==nil then
- print("No template")
- end
- return template
- end
- if mode=="check" then
- getSpeciesinME()
- getPossibleBreedingPairs()
- getPossibleNeededBreedingPairs()
- for i=1,#pnbp do
- print(pnbp[i].result)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment