### Install Scripts of Tribute Python Library Source: https://github.com/scriptsoftribute/scriptsoftribute-python/blob/main/README.md Install the library using pip. This is the first step to begin creating AI bots for the game. ```bash pip install scripts-of-tribute ``` -------------------------------- ### Complete Example: Creating and Running Two Bots Source: https://github.com/scriptsoftribute/scriptsoftribute-python/blob/main/README.md A full example demonstrating the creation and execution of two bots within the Scripts of Tribute game environment. This code is also available in the examples directory. ```python from Bots.RandomBot import RandomBot from Bots.MaxPrestigeBot import MaxPrestigeBot from ScriptsOfTribute.game import Game def main(): bot1 = RandomBot(bot_name="RandomBot") bot2 = MaxPrestigeBot(bot_name="MaxPrestigeBot") game = Game() game.register_bot(bot1) game.register_bot(bot2) game.run( "RandomBot", "MaxPrestigeBot", start_game_runner=True, runs=10, threads=1, ) if __name__ == "__main__": main() ``` -------------------------------- ### Run Games with Registered Bots Source: https://github.com/scriptsoftribute/scriptsoftribute-python/blob/main/README.md Use the Game class to register bots and run simulations. Configure game parameters like number of runs and threads. ```python from ScriptsOfTribute.game import Game from Bots.RandomBot import RandomBot from Bots.MaxPrestigeBot import MaxPrestigeBot def main(): bot1 = RandomBot(bot_name="RandomBot") bot2 = MaxPrestigeBot(bot_name="MaxPrestigeBot") game = Game() game.register_bot(bot1) game.register_bot(bot2) game.run( "RandomBot", "MaxPrestigeBot", start_game_runner=True, runs=10, threads=1, ) if __name__ == "__main__": main() ``` -------------------------------- ### Generate Protobuf Files Source: https://github.com/scriptsoftribute/scriptsoftribute-python/blob/main/README.md Run this command to regenerate gRPC Python files from .proto definitions. Ensure you are in the project root directory. ```bash python -m grpc_tools.protoc -Iprotos --python_out=./protos/ --grpc_python_out=protos/. protos/enums.proto protos/basics.proto protos/main.proto ``` -------------------------------- ### Implement BaseAI Methods for Custom Bots Source: https://github.com/scriptsoftribute/scriptsoftribute-python/blob/main/README.md Inherit from BaseAI and implement required methods to define bot behavior. The 'play' method must return a BasicMove object. ```python def pregame_prepare(self): """Optional: Prepare your bot before the game starts.""" pass def select_patron(self, available_patrons: List[PatronId]) -> PatronId: """Choose a patron from the available list.""" raise NotImplementedError def play(self, game_state: GameState, possible_moves: List[BasicMove], remaining_time: int) -> BasicMove: """Choose a move based on the current game state.""" raise NotImplementedError def game_end(self, final_state): """Optional: Handle end-of-game logic.""" pass ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.