/** TECH BUILD FUNCTIONS **/ function ResearchTechs() { global $resource, $RESEARCH; if (!$this->CheckLabSettingsInQueue()) { return false; } $ActualCount = $this->GetTechQueueInfo(); $Try = 1; do { if ($ActualCount >= self::BOTS_MAX_ELEMENTS_TECH || $Try >= self::BOTS_MAX_TRY_TECH) { break; } $Try++; $List = $this->getMultiplyRandomList(array(self::CHANCE_TECH_BASIC, self::CHANCE_TECH_ECO, self::CHANCE_TECH_SPEED, self::CHANCE_TECH_SPECIAL), array(self::$TechBasicIDs, self::$TechEcoIDs, self::$TechSpeedIDs, self::$TechSpecialIDs)); $Element = $this->getRandomList($List); if ($this->getChance($List[$Element]) || !BuildFunctions::IsTechnologieAccessible($this->USER, $this->PLANET, $Element) || !BuildFunctions::IsElementBuyable($this->USER, $this->PLANET, $Element)) { continue; } $this->ResearchBuild($Element); $ActualCount++; } while ($this->getChance(self::CHANCE_BUILD_NEXT)); }