pmariglia / showdown

A Pokemon Showdown Battle Bot written in Python
GNU General Public License v3.0
256 stars 175 forks source link

Auto End Scrip when used charged moves #141

Closed aditridwan17 closed 1 year ago

aditridwan17 commented 1 year ago

When bot used move hyper beam/Meteor Assault bot notive [Warning] recharge is not a know move

[WARNING] recharge is not a known move Traceback (most recent call last): File "run.py", line 93, in asyncio.get_event_loop().run_until_complete(showdown()) File "C:\Users\Asus\AppData\Local\Programs\Python\Python37-32\lib\asyncio\base_events.py", line 584, in run_until_complete return future.result() File "run.py", line 78, in showdown winner = await pokemon_battle(ps_websocket_client, ShowdownConfig.pokemon_mode) File "C:\Users\Asus\Downloads\showdown-master\showdown-master 2\showdown\run_battle.py", line 215, in pokemon_battle action_required = await async_update_battle(battle, msg) File "C:\Users\Asus\Downloads\showdown-master\showdown-master 2\showdown\battle_modifier.py", line 1235, in async_update_battle return update_battle(battle, msg) File "C:\Users\Asus\Downloads\showdown-master\showdown-master 2\showdown\battle_modifier.py", line 1159, in update_battle check_speed_ranges(battle, msg_lines) File "C:\Users\Asus\Downloads\showdown-master\showdown-master 2\showdown\battle_modifier.py", line 834, in check_speed_ranges battle_copy.user.from_json(battle_copy.request_json) File "C:\Users\Asus\Downloads\showdown-master\showdown-master 2\showdown\battle.py", line 411, in from_json self.active.moves[-1].disabled = move.get(constants.DISABLED, False) IndexError: list index out of range

pmariglia commented 1 year ago

Thanks for the report. I accidentally deleted the "recharge" move when refactoring.

Fixed in 241073c2bb45359d0089e7432095df4d5818bc09.