from . import * import time import random class PlayerBot(Bot): def play_round(self): # bot_acceptance - Should they accept? try: bot_ack = self.session.config["bot_acceptance"] print("Acceptances are set in session.config") except KeyError: if (self.group.id_in_subsession % 2) == 0: bot_ack = 1 # Even group numbers accept else: bot_ack = 0 # Uneven group numbers reject # Effort task intro if self.session.vars["do_effort_task"]: time.sleep(2) # Sleep for x seconds yield AppIntro # time.sleep(2) # Sleep for x seconds yield Infografiken1 time.sleep(2) # Sleep for x seconds yield Infografiken2 time.sleep(2) # Sleep for x seconds yield Infografiken3 time.sleep(2) # Sleep for x seconds yield Infografiken4_RD time.sleep(2) # Sleep for x seconds yield Infografiken5 time.sleep(2) # Sleep for x seconds yield Rounds6d1 time.sleep(2) # Sleep for x seconds yield Rounds6d2 # # # Arguments Input if self.session.vars["do_arguments_redistribution"]: time.sleep(2) # Sleep for x seconds yield BVote_Arg, { "BVote_YesNo": random.sample(list(range(1, 2)), 1)[0], "YesNoArg_BVote": "Ich bin dagegen, weil ... xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx " "xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx" " xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx xxx" " xxx xxx xxx xxx"} # # Here, no argument gets accepted if self.session.vars['do_acceptance']: field_list = [] for i in range(1, 6): if self.player.GroupRank != i: field_list.append("BVote_ArgAkz_" + str(i)) dict_ = {i: 0 for i in field_list} time.sleep(2) # Sleep for x seconds yield BVote_RateBestArg1, dict_ # # # Here, no argument gets voted the best if self.player.GroupRank != 1: # Everyone except 1 thinks that Player 1 made the best argument dict_ = {"BVote_ArgBest_1": 1, "BVote_ArgBest_2": 0, "BVote_ArgBest_3": 0, "BVote_ArgBest_4": 0, "BVote_ArgBest_5": 0 } else: dict_ = {"BVote_ArgBest_1": 0, "BVote_ArgBest_2": 1, "BVote_ArgBest_3": 0, "BVote_ArgBest_4": 0, "BVote_ArgBest_5": 0 } time.sleep(2) # Sleep for x seconds yield Submission(BVote_RateBestArg2, dict_, check_html=False) # # Overview of best arguments time.sleep(2) # Sleep for x seconds yield BVote_BestUebersicht, # # time.sleep(2) # Sleep for x seconds yield Submission(Ack_Chat_Ack, timeout_happened=True, check_html=False) time.sleep(2) # Sleep for x seconds yield AckVote, {"AckVote": bot_ack} time.sleep(2) # Sleep for x seconds yield AckResult #