from otree.api import Currency as c, currency_range, expect, Bot, Submission from . import * from random import randint class PlayerBot(Bot): dice = Constants.dice def play_round(self): participant = self.participant if not (participant.no_consent or participant.unmatched or participant.dropout): for page in page_sequence: if page != WaitingSessionStart: if page in [P1, P2, P3]: if self.round_number == 1: yield page elif page == P4: yield page, dict(report=randint(self.dice[0], self.dice[1])) elif self.round_number == Constants.num_rounds: yield page