ecco7777

CC Gendustry Full Bee Breeding Automation

Dec 6th, 2025 (edited)
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.97 KB | None | 0 0
  1. args={...}
  2. gs=peripheral.wrap("peripheral_1") --genetic sampler
  3. mt=peripheral.wrap("peripheral_2") --advanced mutatron
  4. gt=peripheral.wrap("peripheral_0") --genetic transposer
  5. ac=peripheral.wrap("tile_extrautils_chestfull_name_0") --apiary IO chest
  6. ap_side="east"
  7. ap=peripheral.wrap("tile_for_apiculture_0_name_0") --apiary
  8. apci=peripheral.wrap("tileinterface_1") --apiary chest interface
  9. mtgti=peripheral.wrap("tileinterface_0") --mutatron/genetic transposer interface
  10. mti_side="up"
  11. gti_side="west"
  12. me=apci
  13.  
  14. blank_sample={id="gendustry:GeneSampleBlank",dmg=0}
  15.  
  16. --checking files
  17. if fs.exists("hashlist")~=true then
  18.     shell.run("pastebin get mpSWTsDP hashlist")
  19. end
  20.  
  21. --checking mode
  22. mode=args[1]
  23. if mode==nil then
  24.     print("Welcome to BAM Bredding Automation Machine")
  25.     print("Usage:")
  26.     print("bam check: prints possible Spiecies to breed")
  27. end
  28.  
  29. bp=ap.getBeeBreedingData() --breeding paris
  30. shell.run("hashlist")
  31.  
  32. function getSpeciesinME()
  33.     items=me.getAvailableItems()
  34.     availableSpecies={}
  35.     for i=1,#items do
  36.         if items[i].fingerprint.id=="gendustry:GeneSample" then
  37.             smp=sample[items[i].fingerprint.nbt_hash]
  38.             if smp~=nil then
  39.                 availableSpecies[smp.value]=items[i].fingerprint
  40.             end
  41.         end
  42.     end
  43.     return availableSpecies
  44. end
  45.  
  46. function getPossibleBreedingPairs()
  47.     bp=ap.getBeeBreedingData()
  48.     pbp={} --possible breeding pairs
  49.     for i=1,#bp do
  50.         if availableSpecies[bp[i].allele1]~=nil and availableSpecies[bp[i].allele2]~=nil then
  51.             table.insert(pbp,bp[i])
  52.         end
  53.     end
  54.     return pbp
  55. end
  56.  
  57.  
  58.  
  59. function getPossibleNeededBreedingPairs()
  60.     pnbp={} --possible needed breeding pairs
  61.     for i=1, #pbp do
  62.         if availableSpecies[pbp[i].result]==nil then
  63.             table.insert(pnbp,pbp[i])
  64.         end
  65.     end
  66.     return pnbp
  67. end
  68.  
  69. function getRandomDrone()
  70.     items=me.getAvailableItems()
  71.     drone=nil
  72.     for i=1,#items do
  73.         if string.find(items[i].fingerprint.id,"beeDrone")~=nil then
  74.             drone=items[i]
  75.         end
  76.     end
  77.     if drone==nil then
  78.         print("No Drone Found")
  79.     end
  80.     return drone
  81. end
  82.  
  83. function getRandomPrincess()
  84.     items=me.getAvailableItems()
  85.     princess=nil
  86.     for i=1,#items do
  87.         if string.find(items[i].fingerprint.id,"beePrincess")~=nil then
  88.             princess=items[i]
  89.         end
  90.     end
  91.     if princess==nil then
  92.         print("Your Princess is in another Castle")
  93.     end
  94.     return princess
  95. end
  96.  
  97. function getTemplate()
  98.     items=me.getAvailableItems()
  99.     template=nil
  100.     for i=1,#items do
  101.         if string.find(items[i].fingerprint.id,"GeneTemplate")~=nil then
  102.             template=items[i]
  103.         end
  104.     end
  105.     if template==nil then
  106.         print("No template")
  107.     end
  108.     return template
  109. end
  110.  
  111. if mode=="check" then
  112. getSpeciesinME()
  113. getPossibleBreedingPairs()
  114. getPossibleNeededBreedingPairs()
  115. for i=1,#pnbp do
  116. print(pnbp[i].result)
  117. end
  118. end
Advertisement
Add Comment
Please, Sign In to add comment