diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-10-12 16:41:50 -0500 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-10-12 16:41:50 -0500 |
commit | 5fdd27030e0268b6fa494b9219d3a1ac8c2a35cb (patch) | |
tree | 13ed2cc8bbe21e2f7469ef9d14cd48205080336c /pokemontools/vba/vba.py | |
parent | e13cdeab1104260e2dcfd04aa9dbaa5688f357d0 (diff) |
move() can now take a list of movements to make
Diffstat (limited to 'pokemontools/vba/vba.py')
-rw-r--r-- | pokemontools/vba/vba.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/pokemontools/vba/vba.py b/pokemontools/vba/vba.py index 81b27a3..81ffe4e 100644 --- a/pokemontools/vba/vba.py +++ b/pokemontools/vba/vba.py @@ -557,15 +557,19 @@ class crystal(object): """ Attempt to move the player. """ - self.vba.press(cmd, hold=10, after=0) - self.vba.press([]) + if isinstance(cmd, list): + for command in cmd: + self.move(cmd) + else: + self.vba.press(cmd, hold=10, after=0) + self.vba.press([]) - memory = self.vba.memory - #while memory[0xd4e1] == 2 and memory[0xd042] != 0x3e: - while memory[0xd043] in [0, 1, 2, 3]: - #while memory[0xd043] in [0, 1, 2, 3] or memory[0xd042] != 0x3e: - self.vba.step(count=10) memory = self.vba.memory + #while memory[0xd4e1] == 2 and memory[0xd042] != 0x3e: + while memory[0xd043] in [0, 1, 2, 3]: + #while memory[0xd043] in [0, 1, 2, 3] or memory[0xd042] != 0x3e: + self.vba.step(count=10) + memory = self.vba.memory def get_enemy_hp(self): """ |