Some code that helps you pick and lock Yasuo or any champion as quick as lightning!
You can read the Vietnamese post here 😀
/ yasuoit
- Written in AutoIt
- Help you how to use LCU API
/ yasharp
- Written in C#
- Using websocket for event listener
- Talk to the system via League's chatbox
- Please make sure League Client is opened
- A modern web browser, Chromium-based web browser is suggested
Open your terminal and type:
-
On Windows (use cmd, run as admin)
WMIC PROCESS WHERE name='LeagueClientUx.exe' GET commandline
-
On MacOS
ps x -o args | grep 'LeagueClientUx'
Look for the following line:
"--remoting-auth-token=abcdef123456ABCDEF123456" "--app-port=56789"
abcdef123456ABCDEF123456
is the auth token (PASS)56789
is the address port (PORT)
Open your web browser and enter this URL:
https://127.0.0.1:PORT/lol-champions/v1/owned-champions-minimal
- Replace PORT by your port, press enter
- The login dialog will be shown, enter "riot" as username and your auth token as password
The browser will show all your owned and free champions (as JSON), please find ID of your favorite champions. Use Ctrl F with keyword:
"name":"champion_name_here
On this tab, open console (on Windows, press Ctrl Shift J on Chrome)
Copy the code below (or from script.js) and paste to the console:
var start=function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[157],a=async function(t,n,a){return await fetch(n,{method:t,body:a,headers:{"Content-type":"application/json; charset=UTF-8"}}).then(function(t){return t.text()}).then(function(t){return JSON.parse(t.length?t:"{}")})},e=async function(t,n){return 0===Object.keys(await a("PATCH","/lol-champ-select/v1/session/actions/".concat(t),JSON.stringify({championId:n}))).length},c=setInterval(async function(){if(await async function(){return"InProgress"===(await a("GET","/lol-matchmaking/v1/ready-check")).state}())await async function(){return await a("POST","/lol-matchmaking/v1/ready-check/accept")}();else if((t=await async function(){var t=await a("GET","/lol-champ-select/v1/session"),n=t.localPlayerCellId,e=t.actions;return e?e[0].filter(function(t){return t.actorCellId===n})[0].id:-1}())>-1){for(var i=0;i<n.length&&!await e(t,n[i]);i );await async function(t){return await a("POST","/lol-champ-select/v1/session/actions/".concat(t,"/complete"))}(t),clearInterval(c)}},250)};
Press enter to run the script.
Next, execute the code below:
start([157, 10, 1])
- 157 is Yasuo's ID, 10 is Kayle and 1 is Annine
- If someone picks Yasuo faster than you or Yasuo is not picakble, then Kayle is the next one
- Setup the ID array by yours and enter
Make a Custom/Normal game (Summoner's Rift - blind pick only), and enjoy!
// This script will accept you match found, and pick-lock your champ automatically. You should repeat the Step 3's start for the next match.