• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Is AutoBattle Possible?

20
Posts
13
Years
    • Seen Apr 23, 2020
    I just want to know..

    I want to make a feature whereby when you encounter a pokemon, you press a key and it autobattles for you till the end.
    The result? Failure... BUT it is possibly done by other scripters, cause I tried this under one day of getting essentials.

    I looked through the PokeBattle_AI. but it just confused me too much..
    I tried using pbAutoChooseMove but it kept crashing the game..
    I thought of moves like Assists... but I can't seem to get the script for that since .dat files are not "open" friendly...


    Anyone can help me with this?
     
    119
    Posts
    10
    Years
    • Seen Sep 1, 2023
    To do this you need to use "@scene.pbChooseEnemyCommand(i)";
    In PokeBattle_Battle find "@scene.pbChooseEnemyCommand(i)" and add is in an elsif before the else command, with the elsif checking if a button is pressed (i.e. elsif Input.press?(Input::ALT) ). This makes the game choose the players input if the have the alt button pressed while the command screen shows up.

    pbCommandMenuEx in PokeBattle_ActualScene contains the loop which runs when the command window is active, however you can't exactly the same code as @scene is undefined there. Yet if you want to turn it into a switch (player presses button and battle goes autopilot until the end) it'd probably be easiest to do it in there.

    Also note that $INTERNAL should be false when doing these, there's a function in the AI script which prevents this from functioning if $INTERNAL is true (though this might only be for v14)
     
    Back
    Top