Advertisement
IHATEMICROWAVEOVEN

spreadsheet code pa

Jul 24th, 2023 (edited)
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.95 KB | None | 0 0
  1. local monsAndData = {}
  2. local bigStringToPrint = ""
  3. local pokemons = game.StarterGui.GameGui.LocalScript.Pokemon
  4. local types = {"None", "Normal", "Fire", "Water", "Electric", "Grass", "Ice", "Fighting", "Poison", "Ground", "Flying", "Psychic", "Bug", "Rock", "Ghost", "Dragon", "Dark", "Steel", "Fairy"}
  5.  
  6. local function recordMonData(target)
  7. bigStringToPrint = bigStringToPrint..target.Name.."\t"..(target.Health.Value+200).."\t"..target.Speed.Value.."\t"..target.JumpPower.Value.."\t"
  8.  
  9. local weaponsFolder = target:FindFirstChild("Weapons")
  10. if weaponsFolder.Parent == target then
  11. local weapons = weaponsFolder:GetChildren()
  12. for i = 1, 4 do
  13. if i<=#weapons then
  14. bigStringToPrint = bigStringToPrint..weapons[i].Value.."\t"
  15. else
  16. bigStringToPrint = bigStringToPrint.."\t"
  17. end
  18. end
  19. end
  20.  
  21. --[[ types; place the double bracket around this part to avoid it ]]
  22. if target.SetStatsOnSpawn:FindFirstChild("Type") then
  23. bigStringToPrint = bigStringToPrint.."\t"..types[target.SetStatsOnSpawn.Type.Value+1].."\t"
  24. else
  25. bigStringToPrint = bigStringToPrint.."\tNone\t"
  26. end
  27. if target.SetStatsOnSpawn:FindFirstChild("Type2") then
  28. bigStringToPrint = bigStringToPrint..types[target.SetStatsOnSpawn.Type2.Value+1]
  29. else
  30. bigStringToPrint = bigStringToPrint.."None"
  31. end
  32.  
  33. if target:FindFirstChild("MegaEvolution") and target:FindFirstChild("MegaEvolution").Parent == target then
  34. bigStringToPrint = bigStringToPrint.."\tMEGAEVO"
  35. end
  36.  
  37. bigStringToPrint = bigStringToPrint.."\n"
  38. end
  39.  
  40. local function iterateThroughMons(target)
  41. local verification = target:FindFirstChild("Health")
  42. if verification and verification.Parent == target then
  43. recordMonData(target)
  44. for i, Child in ipairs(target:GetChildren()) do
  45. if Child:IsA("Folder") and Child.Name ~= "SetStatsOnSpawn" and Child.Name ~= "Weapons" then
  46. if Child.Name == "Evolves" then
  47. for j, Evolution in ipairs(Child:GetChildren()) do
  48. iterateThroughMons(Evolution)
  49. end
  50. else
  51. iterateThroughMons(Child)
  52. end
  53. end
  54. end
  55. end
  56. end
  57.  
  58. local AllTheWorldsCreatures = require(pokemons.Sorter) --[[ add www stage 5 ]]
  59. local UnlistedRegions = {}
  60. for i, RegionRef in ipairs(pokemons:GetChildren()) do
  61. if RegionRef.Name ~= "Sorter" and not AllTheWorldsCreatures[RegionRef.Name] then
  62. table.insert(UnlistedRegions, RegionRef)
  63. end
  64. end
  65.  
  66. for i, RegionRef in ipairs(pokemons:GetChildren()) do
  67. if RegionRef.Name ~= "Sorter" then
  68. local MonsTable = AllTheWorldsCreatures[RegionRef.Name]
  69. if MonsTable then
  70. local seenSpecies = {}
  71. local hasSeenUnlisted = false
  72. for j, EvoLine in ipairs(MonsTable) do
  73. seenSpecies[EvoLine] = true
  74. iterateThroughMons(RegionRef[EvoLine])
  75. end
  76. for j, UnlistedEvoLine in ipairs(RegionRef:GetChildren()) do
  77. if not seenSpecies[UnlistedEvoLine.Name] then
  78. if not hasSeenUnlisted then
  79. hasSeenUnlisted = true
  80. bigStringToPrint = bigStringToPrint.."UNLISTED (excluded from Sorter):\n"
  81. end
  82. iterateThroughMons(UnlistedEvoLine)
  83. end
  84. end
  85. bigStringToPrint = bigStringToPrint.."\n"
  86. end
  87. end
  88. end
  89.  
  90. if #UnlistedRegions>0 then
  91. bigStringToPrint = bigStringToPrint.."\n\n\nUNLISTED REGIONS\n\n"
  92. for i, RegionRef in ipairs(UnlistedRegions) do
  93. for j, EvoLine in ipairs(RegionRef:GetChildren()) do
  94. iterateThroughMons(EvoLine)
  95. end
  96. bigStringToPrint = bigStringToPrint.."\n"
  97. end
  98. end
  99.  
  100. print(bigStringToPrint)
  101. print("All done!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement