def main():
    config.tau = config.eval_tau
    nn = NN(config)
    nn.setup()
    bot = MctsBot(nn)
    game = Game()
    game.run(bot)
    def _run_bot(self):
        """Starts the main bot process on this Thread.

        Returns:
            None
        """
        # Initialize the Game class and start Farming Mode.
        self._game = Game()
        self._game.start_farming_mode()
        return None
Ejemplo n.º 3
0
    def setUp(self):
        self.game = Game()
        self.bot = BotMinimax()
        self.game.silent = True
        initial_message = 'settings your_botid 0\n' \
                          'settings field_width 16\n' \
                          'settings field_height 16\n' \
                          'update game round 0\n' \
                          'update game field .,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,0,.,.,.,.,.,.,.,.,1,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.\n' \
                          'action move 10000'

        self.game.update(initial_message)
        self.bot.setup(self.game)
    def __init__(self, player1, player2, field=None):
        if field:
            self.game = Game()
            player1.game = self.game
            player2.game = self.game
            self.game.field = field.copy()
        else:
            self.game = Game()
            player1.game = self.game
            player2.game = self.game
            self.game.field.width = 16
            self.game.field.height = 16
            self.game.field.round = 0

            coord1 = (random.randint(0, 15), random.randint(0, 15))

            self.game.field.create_board(coord1)

        self.game.silent = True
        self.player1 = player1
        self.player2 = player2
        self.players = [self.player1, self.player2]
Ejemplo n.º 5
0
    def __init__(self, debug):
        self.app = Flask(__name__)
        self.app.debug = debug
        CORS(self.app)

        # backend interfaces
        self.game = Game()
        self.guard = Guard()
        self.logger = logging.getLogger(__name__)

        # add routes to flask App
        self.app.add_url_rule('/init',
                              view_func=self.bot_init,
                              methods=['POST'])
        self.app.add_url_rule('/next',
                              view_func=self.bot_next,
                              methods=['POST'])
        self.app.register_error_handler(InvalidUsage,
                                        self.handle_invalid_usage)
Ejemplo n.º 6
0
def main():
    bot = KillBot()
    game = Game()
    game.run(bot)
def main():
    bot = RandomBot()
    game = Game()
    game.run(bot)
            arg: str = sys.argv[1]

            option: int = -1
            try:
                option: int = int(arg)
            except ValueError:
                print("Invalid argument passed in for a option number.",
                      flush=True)

            if option not in range(1, 11):
                raise (ValueError(
                    "Argument passed in was for a option number that does not exist."
                ))

            try:
                game = Game()
                test = Test(game)

                if option == 1:
                    test.test_quest()
                elif option == 2:
                    test.test_special()
                elif option == 3:
                    test.test_raid()
                elif option == 4:
                    test.test_coop()
                elif option == 5:
                    input(
                        "Please have the Quest Results screen visible for loot detection to work. Press any button to proceed..."
                    )
                    test.test_item_detection1()
Ejemplo n.º 9
0
# starter.py
import os
import random
import discord
from discord.ext import commands
from bot.adder import Adder
from bot.game import Game
from bot.starter import StarterHelper
from dotenv import load_dotenv

intents = discord.Intents.default()
intents.members = True
intents.messages = True
intents.guilds = True

load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
GUILD = os.getenv('DISCORD_GUILD')

bot = commands.Bot(command_prefix='!', intents=intents)
gameHelper = StarterHelper()

bot.add_cog(Game(bot, gameHelper))
bot.add_cog(Adder(bot))

bot.run(TOKEN)