コード例 #1
0
ファイル: pyfred.py プロジェクト: cathyjf/PokemonLabBot
 def handle_incoming_challenge(self, user, generation, n, team_length):
     #too lazy to handle n > 1 or non 6 challenges
     if n > 1 or team_length != 6:
         self.reject_challenge(user)
     else:
         file = TEAM_DIR + TEAMS[random.randint(0, len(TEAMS) - 1)]
         file = os.path.normpath(file)
         team = parsers.parse_team_file(file)
         self.challenges[user] = file
         self.accept_challenge(user, team)
コード例 #2
0
ファイル: pyfred.py プロジェクト: cathyjf/PokemonLabBot
 def __init__(self, fid, handler, party, opponent, team):
     self.fid = fid
     self.handler = handler
     self.party = party
     self.opponent = opponent
     self.teams = [[], []]
     self.teams[party] = parsers.parse_team_file(team)
     for i in range(6):
         self.teams[party - 1].append(Pokemon(moves=[]))
     self.active = [0, 0]
コード例 #3
0
ファイル: mybot.py プロジェクト: Valyxe/Senior-Research
 def handle_finalise_challenge(self, user, accepted):
     if accepted == 1:
         self.client.isInBattle = 1
         msg = OutMessage(8)
         msg.write_string(user)
         file = TEAM_DIR + TEAMS[random.randint(0, len(TEAMS) - 1)]
         file = os.path.normpath(file)
         team = parsers.parse_team_file(file)
         self.challenges[user] = file
         self.write_team(msg, team)
         self.client.send(msg)
コード例 #4
0
ファイル: mybot.py プロジェクト: Valyxe/Senior-Research
 def __init__(self, fid, handler, party, opponent, team):
     self.fid = fid
     self.handler = handler
     self.party = party
     self.opponent = opponent
     self.teams = [[], []]
     self.teams[party] = parsers.parse_team_file(team)
     for i in range(6):
         self.teams[party - 1].append(Pokemon(moves=[]))
     self.active = [0, 0]
     
     #For use with the Expert System AI.
     self.moves_used = [0, 0, [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]]
コード例 #5
0
ファイル: idlebot.py プロジェクト: cathyjf/PokemonLabBot
 def handle_incoming_challenge(self, user, generation, n, team_length):
     file = TEAM_DIR + TEAMS[random.randint(0, len(TEAMS) - 1)]
     file = os.path.normpath(file)
     team = parsers.parse_team_file(file)
     self.challenges[user] = file
     self.accept_challenge(user, team)