Advertisement
blurose

mojo script progress

Jul 31st, 2024
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.24 KB | None | 0 0
  1. #N/A / N/A / Evo. - Petal Blizzard
  2. #N/A / N/A / 1 - Power Whip
  3. #1 - Tackle
  4. #1 - Growl
  5. #5 - Vine Whip
  6. #8 - Leech Seed
  7. #11 - Poison Powder
  8. #11 - Sleep Powder
  9. #14 - Take Down
  10. #17 / 19 - Razor Leaf
  11. #20 / 22 - Sweet Scent
  12. #23 / 25 - Double-Edge
  13. #26 / 28 - Worry Seed
  14. #29 / 31 - Seed Bomb
  15. #32 / 34 - Synthesis
  16. #35 / 37 / 42 - Petal Dance
  17. #38 / 40 / 48 - Solar Beam
  18.  
  19.  
  20. import pprint
  21. import sys
  22.  
  23. highestEvo = 1
  24. file = open(sys.argv[1], "r")
  25. for line in file:
  26.     line = line.replace("N/A", "NA")
  27.     arr = line.split("/")
  28.     if (len(arr) > highestEvo):
  29.         highestEvo = len(arr)
  30. file.seek(0, 0)
  31.  
  32. moves = {}
  33. moveIndex = {}
  34. for i in range(0, highestEvo):
  35.     moves[i] = {}
  36.     moveIndex[i] = 0
  37.  
  38. for line in file:
  39.     print(line)
  40.     line = line.replace("N/A", "NA")
  41.     arr = line.split("/")
  42.     arrBkp = arr
  43.     if len(arr) != highestEvo:
  44.         for i in range(len(arr), highestEvo):
  45.             arr[i] = arrBkp[-1]
  46.     #for i in range(0, len(arr)):
  47.     for j in range(0, highestEvo):
  48.         if ("NA" not in arr[j]):
  49.             moves[j][moveIndex[j]] = "MOVE_" + line.strip().split(" - ")[1].upper().replace(" ", "_").replace("-", "_")
  50.             moveIndex[j] = moveIndex[j] + 1
  51.  
  52. print(highestEvo)
  53. pprint.pp(moves)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement