AceZephyr

flapbeats.py

Nov 6th, 2021 (edited)
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.57 KB | None | 0 0
  1. """github.com/AceZephyr/wmsim
  2. Put these files in the same folder as this script
  3. これらのファイルを、このスクリプトと同じフォルダに入れてください。
  4.  
  5. run this command (コマンドプロンプト): python flapbeats.py
  6.  
  7. change START and END below"""
  8.  
  9. from pprint import pprint
  10.  
  11. from state import State, Battle
  12.  
  13.  
  14. def run(igt: int, lr: bool, start_hold: bool, menus: int):
  15.     s = State(igt)
  16.     # previous battle (前戦):
  17.     # 106 = harpy (キマイラ)
  18.     # 107 = flapbeats (フラップビイト)
  19.     s.lastenc = 106
  20.  
  21.     if start_hold:
  22.         for _ in range(13):
  23.             s.walk(4, 24, lr, movement=False)
  24.  
  25.     for _ in range(menus):
  26.         s.walk(4, 24, lr, movement=False)
  27.  
  28.     try:
  29.  
  30.         # desert
  31.         for _ in range(10000):
  32.             s.walk(4, 24, lr)
  33.  
  34.         print("wtf")
  35.     except Battle as b:
  36.         return b, s
  37.  
  38.  
  39. arr = []
  40.  
  41. # 開始
  42. START = 2 * 60 * 60 + 20 * 60
  43. # エンド
  44. END = 2 * 60 * 60 + 30 * 60
  45. # max number of menus (最高のメニュー数)
  46. MAX_MENUS = 3
  47.  
  48.  
  49. def tryall(igt: int):
  50.     b, s = run(igt, False, True, 0)
  51.     if b.battle_id == 107 and b.preempt:
  52.         arr.append((igt, "up/down", "hold", 0))
  53.         return
  54.     for menus in range(0, MAX_MENUS):
  55.         for hold in [True, False]:
  56.             b, s = run(igt, True, hold, menus)
  57.             if b.battle_id == 107 and b.preempt:
  58.                 arr.append((igt, "left/right", "hold" if hold else "delay", menus))
  59.                 return
  60.  
  61.  
  62. for x in range(START, END + 1):
  63.     tryall(x)
  64.  
  65. print(len(arr))
  66. pprint(arr)
  67.  
Add Comment
Please, Sign In to add comment