def __getitem__(self, key): cs = minqlbot.get_configstring(0, self.cached) if not cs: self.__valid = False raise NonexistentGameError("Invalid game. Did the bot disconnect?") cvars = minqlbot.parse_variables(cs) return cvars[key]
def __contains__(self, key): if not self.__valid: self.__invalidate() cs = self.configstring(529 + self.__id, self.cached) if not cs: self.__invalidate() cvars = minqlbot.parse_variables(cs) return key in cvars
def __getitem__(self, key): if not self.__valid: self.__invalidate() cs = self.configstring(529 + self.__id, self.cached) if not cs: self.__invalidate() cvars = minqlbot.parse_variables(cs) # Could still be invalid, so we need to check the name. if self.__name and self.__name.lower() != re.sub(r"\^[0-9]", "", cvars["n"]).lower(): self.__invalidate() return cvars[key]
def __getitem__(self, key): if not self.__valid: self.__invalidate() cs = self.configstring(529 + self.__id, self.cached) if not cs: self.__invalidate() cvars = minqlbot.parse_variables(cs) # Could still be invalid, so we need to check the name. if self.__name and self.__name.lower() != re.sub( r"\^[0-9]", "", cvars["n"]).lower(): self.__invalidate() return cvars[key]