# from otree.api import expect, Bot # from . import * # class PlayerBot(Bot): # # cases = [ # # 'asshole1', # repeats the same number many times # # 'asshole2', # types many numbers # # # 'safe', # in each period, she types the previous number # # # 'one_per_period', # one guess per period # # # 'idle', #does nothing # # ] # def play_round(self): # if self.player.round_number == 1: # yield Submission(StartingPage, dict(), timeout_happened=True, check_html=False) # if self.player.subsession.is_played: # yield Submission(Guess, dict(), timeout_happened=False, check_html=False) # def call_live_method(method, **kwargs): # if kwargs['page_class'].__name__ == 'Guess': # num_periods = kwargs['group'].subsession.num_periods # for i in range(num_periods): # method(1, {'type': 'guess', 'guess': 80, 'period': i+1}) # method(1, {'type': 'guess', 'guess': 40, 'period': i+1}) # method(3, {'type': 'guess', 'guess': 50, 'period': i+1}) # method(3, {'type': 'guess', 'guess': 60, 'period': i+1}) # method(2, {'type': 'guess', 'guess': 60, 'period': i+1})