from otree.api import Currency as c, currency_range from . import pages from ._builtin import Bot from .models import Constants import random class PlayerBot(Bot): def play_round(self): if self.round_number==int((Constants.num_rounds/3)+1): yield (pages.Round11) if self.round_number == int((Constants.num_rounds * 2 / 3) + 1): yield (pages.Round21) choice = random.sample(range(1,11), 5) if self.player.id_in_group in choice: yield (pages.Decision, {'choice': 'active'}) else: yield (pages.Decision, {'choice': 'inactive'}) yield (pages.Results) pass