private void ProcessMatch() { bot.log("Searching match..."); bot.wait(3000); SearchMatchResult result = client.searchMatch(); while (result != SearchMatchResult.Ok) { switch (result) { case SearchMatchResult.GatekeeperRestricted: bot.warn("Cannot search match. Queue dodge timer. Retrying in 20 seconds."); bot.wait(1000 * 20); break; case SearchMatchResult.QueueNotEnabled: client.createLobby(QueueType); bot.warn("Cannot search match. Creating lobby..."); bot.wait(1000 * 10); break; case SearchMatchResult.InvalidLobby: bot.warn("Cannot search match. Client not ready. Retrying in 10 seconds."); bot.wait(1000 * 10); break; } result = client.searchMatch(); } bool isMatchFound = false; while (!isMatchFound) { isMatchFound = client.isMatchFound(); bot.wait(1000); } while (client.getGameflowPhase() != GameflowPhaseEnum.ChampSelect) { client.acceptMatch(); bot.wait(1000); } bot.log("Match found."); //bot.wait(30000); //client.Ban(); GameflowPhaseEnum currentPhase = client.getGameflowPhase(); int i = 0; int mslimit = 40; while (currentPhase != GameflowPhaseEnum.InProgress && i < mslimit) { if (currentPhase != GameflowPhaseEnum.ChampSelect) { bot.log("Game was dodged, finding match...."); ProcessMatch(); return; } bot.wait(100); client.LockIn(); bot.wait(100); currentPhase = client.getGameflowPhase(); i++; } bot.log("Matchmaking finished"); bot.wait(2000); bot.executePattern("GameOn"); bot.wait(2000); bot.log("\n"); bot.wait(2000); bot.log("\n"); bot.wait(2000); bot.log("\n"); bot.wait(2000); bot.log("\n"); }
private void ProcessMatch() { bot.log("Searching match..."); bot.wait(3000); SearchMatchResult result = client.searchMatch(); while (result != SearchMatchResult.Ok) { switch (result) { case SearchMatchResult.GatekeeperRestricted: bot.warn("Cannot search match. Queue dodge timer. Retrying in 20 seconds."); bot.wait(1000 * 20); break; case SearchMatchResult.QueueNotEnabled: client.createLobby(QueueType); bot.warn("Cannot search match. Creating lobby..."); bot.wait(1000 * 10); break; case SearchMatchResult.InvalidLobby: bot.warn("Cannot search match. Client not ready. Retrying in 10 seconds."); bot.wait(1000 * 10); break; } result = client.searchMatch(); } bool isMatchFound = false; while (!isMatchFound) { isMatchFound = client.isMatchFound(); bot.wait(1000); } while (client.getGameflowPhase() != GameflowPhaseEnum.ChampSelect) { client.acceptMatch(); bot.wait(1000); } bot.log("Match founded."); bot.wait(1500); // bool picked = false; int championIndex = 0; while (!picked) { if (championIndex > Champions.Length - 1) { bot.warn("Unable to continue. No more champions to pick"); return; } ChampionPickResult pickResult = client.pickChampion(Champions[championIndex]); switch (pickResult) { case ChampionPickResult.Ok: bot.log(Champions[championIndex] + " picked successfully"); picked = true; break; case ChampionPickResult.ChampionNotOwned: bot.warn("Error the request champion is not owned."); break; case ChampionPickResult.ChampionPicked: bot.warn("Someone already pick your champion"); break; default: break; } championIndex++; bot.wait(1000); } bot.log("Waiting...."); GameflowPhaseEnum currentPhase = client.getGameflowPhase(); while (currentPhase != GameflowPhaseEnum.InProgress) { if (currentPhase != GameflowPhaseEnum.ChampSelect) { bot.log("Game was dodged, finding match...."); ProcessMatch(); return; } bot.wait(1000); currentPhase = client.getGameflowPhase(); } bot.executePattern("Coop"); }