from otree.api import Currency as c, currency_range, expect, Bot from . import * class PlayerBot(Bot): def play_round(self): p = self.player r = p.subsession.round_number if r in bet_rounds_normal(): yield BetStart if r == bet_rounds_normal()[0]: yield BetInstructions yield BetComp1, dict(bet_comp1='True') yield BetComp2, dict(bet_comp2='True') yield BetInstructionsChoice yield BetChoice, dict(bet_cutoff_choice=3) yield BetFinish if p.subsession.part > 1: yield Voting, dict(vote=True) yield VoteResults1 yield VoteResults2 if (p.subsession.part == 3) & (p.my_role == 'passive'): yield DecisionBalls, dict(picked_ball='ball1', picked_ball_color='red') yield DecisionBallsResult, dict(action=1) yield Results elif ((p.subsession.part < 3) & (p.my_role != 'solo')) | ((p.subsession.part == 3) & (p.my_role == 'active')): yield Decision, dict(action=1) yield Results