junlarsen / league-connect

:electric_plug: Node.js HTTP/1.1, HTTP/2.0 and WebSocket interface to the League of Legends Client APIs
https://www.npmjs.com/package/league-connect
MIT License
156 stars 24 forks source link

Endpoint to make the PickIntent in the planning phase. #72

Closed RenzoBeux closed 2 years ago

RenzoBeux commented 2 years ago

Hey guys, im writing here cause i tghink is a place where other people may achived this. I want to be able to pre pick, in the messages i have been sniffing on the websocket i think they call pickIntent. Does anybody have any idea of this?

junlarsen commented 2 years ago

I've not worked with the Champion Select APIs in a while myself, but I'll keep this open for anyone else who might know something :)

cactoes commented 2 years ago
  1. GET all championSelect data "/lol-champ-select/v1/session"

  2. loop through all the actions, then loop through all the pairs in the actions

  3. when you have an action it hold this data: championId, completed, id, isAllyAction, isInProgress, pickTurn, type, actorCellId. (im not explaining that)

  4. when you have confirm that the action is you, the action is not completed and the type is "pick" just send a PATCH request to "/lol-champ-select/v1/session/actions/${actionID}" where action id is the id of the action we just got. make sure to send a body wich contains:

    {
    "championId": ID_OF_THE_CHAMPION_YOU_WANT_TO_PICK
    }
  5. it doesn't return anything so dont try anyting with the response

cactoes commented 2 years ago

Hey guys, im writing here cause i tghink is a place where other people may achived this. I want to be able to pre pick, in the messages i have been sniffing on the websocket i think they call pickIntent. Does anybody have any idea of this?

ps if you still cant figure it out, i have a repo with the solution in it ;) @RenzoBeux

RenzoBeux commented 2 years ago

Hi! Thank you very much! Not needed, I understood perfectly what you explained.