Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local movesAndMons = {}
- --[[ dictionary: {move, mon, mon, mon, …} ]]
- local movesToIndex = {}
- --[[ table: move = isAtThisIndex ]]
- local movesPathway = game.StarterGui.SkillsGui.WeaponsController
- local function registerWeapons(monName, weaponsFolder)
- for i, Weapon in ipairs(weaponsFolder:GetChildren()) do
- local name = Weapon.Value
- if movesToIndex[name] then
- table.insert(movesAndMons[movesToIndex[name]], monName)
- else
- print("Unknown move: "..name.." found on "..monName)
- end
- end
- end
- local function iterateThroughMons(target)
- for i, Child in ipairs(target:GetChildren()) do
- if Child.Name == "Weapons" then
- registerWeapons(target.Name, Child)
- elseif Child:IsA("Folder") and Child.Name~="SetStatsOnSpawn" then
- iterateThroughMons(Child)
- end
- end
- end
- for i, Move in ipairs(movesPathway.ClientModules:GetChildren()) do
- local name = Move.Name
- table.insert(movesAndMons, {name})
- movesToIndex[name] = #movesAndMons
- print("Indexed "..name.." to "..#movesAndMons)
- end
- for i, Move in ipairs(movesPathway.ServerModules:GetChildren()) do
- local name = Move.Name
- if not movesToIndex[name] then
- table.insert(movesAndMons, {name.." (Server Only?)"})
- movesToIndex[name] = #movesAndMons
- end
- end
- for i, Region in ipairs(game.StarterGui.GameGui.LocalScript.Pokemon:GetChildren()) do
- for j, EvoLine in ipairs(Region:GetChildren()) do
- iterateThroughMons(EvoLine)
- end
- end
- table.sort(movesAndMons, function(a,b) if #a==#b then return a[1]<b[1] else return #a>#b end end)
- local bigStringToPrint = ""
- local lastMoveAmount = math.huge
- for i, Table in ipairs(movesAndMons) do
- if lastMoveAmount ~= #Table-1 then
- lastMoveAmount = #Table-1
- bigStringToPrint = bigStringToPrint.."\nMOVES ON "..lastMoveAmount.." MONS\n"
- end
- local listString = Table[1].." ("
- table.remove(Table, 1)
- for i, Mon in ipairs(Table) do listString = listString..Mon..", " end
- bigStringToPrint = bigStringToPrint..string.sub(listString, 1, string.len(listString)-2)..")\n"
- end
- print(bigStringToPrint)
- print("All done!!!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement