-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6cd0895
Showing
4 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
out/ | ||
icon.ico | ||
__pycache__/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# PoroLobby | ||
|
||
PoroLobby creates 5v5 Practice Tool with bots in League of Legends. | ||
|
||
## How to use (Windows) | ||
|
||
Video guide: | ||
(WILL BE ADDED) | ||
|
||
1. Download `PoroLobby.zip` file from Releases section. Or just click this link. | ||
2. Extract the archive and go to the extracted `PoroLobby` folder | ||
2. Start League of Legends and log in | ||
3. Run the `porolobby.exe` - the lobby will be created and filled with easy bots | ||
4. Start the game and ENJOY! | ||
|
||
### Advanced users (Win/Mac/Linux) | ||
|
||
If you know Python, there's no need to run the exe file. Clone this repo, install requirements with `pip` and run `porolobby.py`. | ||
This method should work for all platforms. | ||
|
||
## Disclaimer | ||
|
||
Use of this tool should not be bannable by Riot Games. That said, League of Poro provides no guarantee whatsoever. Use at your own risk! | ||
|
||
## License | ||
|
||
This tool is distributed under [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) | ||
|
||
## Endorsement | ||
|
||
PoroLobby isn’t endorsed by Riot Games and doesn’t reflect the views or opinions of Riot Games or anyone officially involved in producing or managing League of Legends. League of Legends and Riot Games are trademarks or registered trademarks of Riot Games, Inc. League of Legends © Riot Games, Inc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#! python3 | ||
|
||
from lcu_driver import Connector | ||
|
||
connector = Connector() | ||
|
||
# Creates 5v5 Practice Tool | ||
async def createLobby(connection): | ||
data = { | ||
"customGameLobby": { | ||
"configuration": { | ||
"gameMode": "PRACTICETOOL", | ||
"gameMutator": "", | ||
"gameServerRegion": "", | ||
"mapId": 11, | ||
"mutators": { | ||
"id": 1 | ||
}, | ||
"spectatorPolicy": "AllAllowed", | ||
"teamSize": 5, | ||
}, | ||
"lobbyName": "League of Poro's Practice Tool", | ||
"lobbyPassword": "" | ||
}, | ||
"isCustom": True, | ||
} | ||
# make the request to switch the lobby | ||
lobby = await connection.request('post', '/lol-lobby/v2/lobby', data=data) | ||
|
||
# if HTTP status code is 200 the lobby was created successfully | ||
if lobby.status == 200: | ||
print('The lobby was created correctly') | ||
else: | ||
print('Whops, Yasuo died again.') | ||
|
||
|
||
# Contacts LCU API to add bots | ||
async def executeAddBot(connection, data): | ||
res = await connection.request('post', '/lol-lobby/v1/lobby/custom/bots', data=data) | ||
if res.status == 204: | ||
print('Bot added') | ||
else: | ||
print('Whops, Yasuo died again.') | ||
|
||
# Selects which bots to add and adds them to an existing lobby | ||
async def addBots(connection): | ||
ids = [1, 3, 8, 10, 11] | ||
|
||
# add bots to the player's team | ||
for id in ids[:4]: | ||
data = { | ||
"botDifficulty": "EASY", | ||
"championId": id, | ||
"teamId": "100" | ||
} | ||
await executeAddBot(connection, data) | ||
|
||
# add bots to the opposite team | ||
for id in ids: | ||
data = { | ||
"botDifficulty": "EASY", | ||
"championId": id, | ||
"teamId": "200" | ||
} | ||
await executeAddBot(connection, data) | ||
|
||
|
||
# fired when LCU API is ready to be used | ||
@connector.ready | ||
async def connect(connection): | ||
print('LCU API is ready to be used.') | ||
|
||
# check if the user is already logged into his account | ||
summoner = await connection.request('get', '/lol-summoner/v1/current-summoner') | ||
if summoner.status != 200: | ||
print('Please login into your account.') | ||
else: | ||
print('Switching the lobby type.') | ||
await createLobby(connection) | ||
await addBots(connection) | ||
|
||
|
||
# fired when League Client is closed (or disconnected from websocket) | ||
@connector.close | ||
async def disconnect(_): | ||
print('The client have been closed!') | ||
|
||
# starts the connector | ||
connector.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lcu-driver |