League-of-Legends-Bot
League-of-Legends-Bot copied to clipboard
if some one helped me with that i can reward him pls help the bot isn't maxing abilites
bot isn't maxing up abilites
Could you send your Coop.cs file. It should be in Binaries/Patterns.
Could you send your Coop.cs file. It should be in Binaries/Patterns. here it's https://www112.zippyshare.com/v/cn9DS5OA/file.html
Could you send your Coop.cs file. It should be in Binaries/Patterns.
using System; using System.Collections.Generic; using System.Drawing; using LeagueBot; using LeagueBot.Patterns; using LeagueBot.Game.Enums; using LeagueBot.Game.Misc; namespace LeagueBot { public class Coop : PatternScript {
private Point CastTargetPoint
{
get;
set;
}
private int AllyIndex
{
get;
set;
}
private Item[] Items = new Item[]
{
new Item("Doran Ring",400),
new Item("Sorcere",1100),
new Item("Lost Chapter",1300),
new Item("Luden Tempest",2100), // <--- Cost when Lost Chapter & Blasting Wand were bought
new Item("Needlessly Large Rod",1250),
new Item("Needlessly Large Rod",1250),
new Item("Rabadon Deathcap",1100),
};
public override bool ThrowException
{
get
{
return false;
}
}
public override void Execute()
{
bot.log("Waiting for league of legends process...");
bot.waitProcessOpen(Constants.GameProcessName);
bot.waitUntilProcessBounds(Constants.GameProcessName, 1040, 800);
bot.wait(200);
bot.log("Waiting for game to load.");
bot.bringProcessToFront(Constants.GameProcessName);
bot.centerProcess(Constants.GameProcessName);
game.waitUntilGameStart();
bot.log("Game Started");
bot.bringProcessToFront(Constants.GameProcessName);
bot.centerProcess(Constants.GameProcessName);
bot.wait(3000);
game.player.upgradeSpellOnLevelUp();
if (game.getSide() == SideEnum.Blue)
{
CastTargetPoint = new Point(1084, 398);
bot.log("We are blue side !");
}
else
{
CastTargetPoint = new Point(644, 761);
bot.log("We are red side !");
}
OnSpawnJoin();
bot.log("Playing...");
GameLoop();
this.End();
}
private void BuyItems()
{
int golds = game.player.getGolds();
game.shop.toogle();
bot.wait(5000);
foreach (Item item in Items)
{
if (item.Cost > golds)
{
break;
}
if (!item.Buyed)
{
game.shop.searchItem(item.Name);
game.shop.buySearchedItem();
item.Buyed = true;
golds -= item.Cost;
}
}
game.shop.toogle();
}
private void CheckBuyItems()
{
int golds = game.player.getGolds();
foreach (Item item in Items)
{
if (item.Cost > golds)
{
break;
}
if (!item.Buyed)
{
game.player.recall();
bot.wait(10000);
if (game.player.getManaPercent() == 1)
{
OnSpawnJoin();
}
}
}
}
private void GameLoop()
{
int level = game.player.getLevel();
bool dead = false;
bool isRecalling = false;
while (bot.isProcessOpen(Constants.GameProcessName))
{
bot.bringProcessToFront(Constants.GameProcessName);
bot.centerProcess(Constants.GameProcessName);
int newLevel = game.player.getLevel();
if (newLevel != level)
{
level = newLevel;
game.player.upgradeSpellOnLevelUp();
}
if (game.player.dead())
{
if (!dead)
{
dead = true;
isRecalling = false;
OnDie();
}
bot.wait(4000);
continue;
}
if (dead)
{
dead = false;
OnRevive();
continue;
}
if (isRecalling)
{
game.player.recall();
bot.wait(8500);
if (game.player.getManaPercent() == 1)
{
OnSpawnJoin();
isRecalling = false;
}
continue;
}
if (game.player.getManaPercent() <= 0.10d)
{
isRecalling = true;
continue;
}
if (game.player.getHealthPercent() <= 0.07d)
{
isRecalling = true;
continue;
}
CastAndMove();
}
}
private void OnDie()
{
BuyItems();
}
private void OnSpawnJoin()
{
BuyItems();
AllyIndex = game.getAllyIdToFollow();
game.camera.lockAlly(AllyIndex);
}
private void OnRevive()
{
AllyIndex = game.getAllyIdToFollow();
game.camera.lockAlly(AllyIndex);
}
private void CastAndMove() // Replace this by Champion pattern script.
{
/*
Random rnd = new Random();
int Numero = rnd.Next(0, 6);
game.moveCenterScreen();
if (Numero = 0)
{
game.player.tryCastSpellOnTarget(3); // veigar cage
game.moveCenterScreen();
bot.wait(2000);
int Numero = rnd.Next(0, 6);
}
else if (Numero = 1)
{
game.player.tryCastSpellOnTarget(2); // Z
game.moveCenterScreen();
bot.wait(2000);
int Numero = rnd.Next(0, 6);
}
else if (Numero = 2)
{
game.player.tryCastSpellOnTarget(1); // Q
game.moveCenterScreen();
bot.wait(2000);
int Numero = rnd.Next(0, 6);
}
else if (Numero = 3)
{
game.player.tryCastSpellOnTarget(4); // ult
game.moveCenterScreen();
bot.wait(2000);
int Numero = rnd.Next(0, 6);
}
else if (Numero = 4)
{
game.player.tryCastSpellOnTarget(D); // Flash
game.moveCenterScreen();
bot.wait(2000);
int Numero = rnd.Next(0, 6);
}
else if (Numero = 5)
{
game.player.tryCastSpellOnTarget(F); // Ghost
game.moveCenterScreen();
bot.wait(2000);
int Numero = rnd.Next(0, 6);
}
else if (Numero = 6)
{
CheckBuyItems();
game.moveCenterScreen();
bot.wait(2000);
int Numero = rnd.Next(0, 6);
}
*/
int Ripeti = 0;
while (Ripeti < 3)
{
Ripeti = Ripeti + 1;
game.moveCenterScreen();
game.player.tryCastSpellOnTarget(3); // veigar cage
game.moveCenterScreen();
game.player.tryCastSpellOnTarget(2); // Z
game.moveCenterScreen();
game.player.tryCastSpellOnTarget(1); // Q
game.moveCenterScreen();
game.player.tryCastSpellOnTarget(4); // ult
game.moveCenterScreen();
game.player.tryCastSpellOnTarget(5); // Flash
game.moveCenterScreen();
game.player.tryCastSpellOnTarget(6); // Ghost
}
Ripeti = 0;
CheckBuyItems();
}
public override void End()
{
bot.executePattern("EndCoop");
base.End();
}
}
}
Hi, sorry for the long wait.
You should try to change the numbers that are inserted into this function and test the bot.
bot.waitUntilProcessBounds(Constants.GameProcessName, 1040, 800);
If the value is too low "Waiting for game to load." won't appear in the console and you should change the values again and restart the bot. If the value is too high the bot will miss all of its mouse clicks.
Try to change the value to "1050, 810" or "1030, 790" and continue to increase or lower it.
Sadly it didn't work when i change this value to any other value the console stuck on waiting for league of legends process..... and the bot never starts doing anything thnx for trying to help me though :(
if u can help me can i add a line in coop.cs to automatically press ctrl+ q/e/w after every level up ?
We don't need to add a line like that because it is already in there. I noticed that your Coop.cs is different from the one in this repo.
Yours:
bot.wait(3000);
game.player.upgradeSpellOnLevelUp();
if (game.getSide() == SideEnum.Blue)
{
CastTargetPoint = new Point(1084, 398);
bot.log("We are blue side !");
}
else
{
CastTargetPoint = new Point(644, 761);
bot.log("We are red side !");
}
Repo:
bot.wait(3000);
if (game.getSide() == SideEnum.Blue)
{
CastTargetPoint = new Point(1084, 398);
bot.log("We are blue side !");
}
else
{
CastTargetPoint = new Point(644, 761);
bot.log("We are red side !");
}
game.player.upgradeSpellOnLevelUp();
Try to redownload the repo and see if it works.
yea i did that i was trying to fix it i redownloaded it and the same problem still exist :(
What is your PC's resolution?
1680x1050 i got the problem when i looked in the source code but i don't know how to edit it in the main program it's in Sources\LeagueBot\LeagueBot\Game\Entities\Activeplayer.cd public void upgradeSpell(int indice) // <---- replace this by keybinding + league settings { Point coords = new Point();
switch (indice)
{
case 1:
coords = new Point(826, 833);
break;
case 2:
coords = new Point(875, 833);
break;
case 3:
coords = new Point(917, 833);
break;
case 4:
coords = new Point(967, 833);
break;
default:
Logger.Write("Unknown spell indice :" + indice, MessageState.WARNING);
return;
}
this is the problem this coordinates is wrong and i know the right coordinates do u have an idea how can i edit it ??
or do u know how can i replace it by keybinding as the programmer said ??
Could you send me the right right coordinates?
switch (indice) { case 1: coords = new Point(694, 782); break; case 2: coords = new Point(742, 782); break; case 3: coords = new Point(790, 782); break; case 4: coords = new Point(836, 782); break; default: Logger.Write("Unknown spell indice :" + indice, MessageState.WARNING); return; }
can u please change it with the keybind if u can i have been waiting along time trying the whole day but i couldn't do anything sadly cuz i am very bad at coding -_- the key bind is ctrl +q / ctrl + w /ctrl +e/ctrl +r i will be much appreciated if u did that or fix the problem for me :( @TheUmbralPyre
Sorry for making you wait, will try to send you a modified version later today.
Thank you so much
Could you help me with abilities cause boy don't cast them ;/
Sorry, I wasn't able to send you the edited version yesterday. Here it is.
Could you help me with abilities cause boy don't cast them ;/
You should open a new issue.
Sadly it didn't work thnx for trying to help me though 😢
Can you yell me how did u transfer the source file to exe ? So i can try edit it by my self till it work ?
I tried visual studio 2019 but i had many errors wheb i. Trying to build i will be very thankful if u told me tho
and if u can't can u please edit it again the y coordinates is the problem it needs to be higher can u edit it one last time please switch (indice) { case 1: coords = new Point(694, 795); break; case 2: coords = new Point(742, 795); break; case 3: coords = new Point(790, 795); break; case 4: coords = new Point(836, 795); break; default: Logger.Write("Unknown spell indice :" + indice, MessageState.WARNING); return; }
If you Build the LeagueBot Project in Visual Studio the .exe file will be automatically updated.
Sry for wasting ur time but every time i try to build it i receive those errors and all the references has this yellow triangle can u please tell me your visual studio and netframework version and thank you for answering me again
Try to Rebuild the Solution. The file, which contains LeagueBot and the ColorPicker Projects.
Sry i tried this but i had the same problem can u please edit the cordinatesfor the last time and it will work the y coordinates were weong it needs to be 795
case 1: coords = new Point(694, 795); break; case 2: coords = new Point(742, 795); break; case 3: coords = new Point(790, 795); break; case 4: coords = new Point(836, 795); break; default: Logger.Write("Unknown spell indice :" + indice, MessageState.WARNING); return;
Here.
Finally it worked thak you so much ♥️