• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • 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
    14
    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?
     
    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