def delete_pre_end_of_game(connection: LeagueConnection): ''' Deletes pre end of game sequence event ''' res = connection.get('/lol-pre-end-of-game/v1/currentSequenceEvent') res_json = res.json() name = res_json['name'] connection.post('/lol-pre-end-of-game/v1/complete/%s' % name) connection.delete('/lol-pre-end-of-game/v1/registration/%s' % name)
def create_lobby(connection: LeagueConnection, queue_id): ''' Creates a lobby with the queue id given ''' data = {"queueId": queue_id} if queue_id in [2000, 2010, 2020]: connection.post('/lol-lobby/v2/matchmaking/quick-search', json=data) return None res = connection.post('/lol-lobby/v2/lobby', json=data) res = res.json() if 'errorCode' in res: return res['message'] return None
def buy(connection: LeagueConnection, item_id, val): ''' Buys a specific item from the store ''' data = { 'items': [{ 'itemKey': { 'inventoryType': 'CHAMPION', 'itemId': item_id }, 'purchaseCurrencyInfo': { 'currencyType': 'IP', 'price': val, 'purchasable': True, }, 'quantity': 1 }] } connection.post('/lol-purchase-widget/v1/purchaseItems', json=data)
def honor(connection: LeagueConnection, data): ''' Honors a player account of the given player data ''' connection.post('/lol-honor-v2/v1/honor-player', json=data)
def skip_stats(connection: LeagueConnection): ''' Skips waiting for stats ''' connection.post('/lol-end-of-game/v1/state/dismiss-stats')
def reconnect(connection: LeagueConnection): ''' Reconnects to the game ''' connection.post('/lol-gameflow/v1/reconnect')
def send_invitations(connection: LeagueConnection, data): '''Send an game invite to given id''' connection.post('/lol-lobby/v2/lobby/invitations', json=data)
def accept_invitation(connection: LeagueConnection, invitation_id): '''Accepts the incoming invitation''' connection.post( f'/lol-lobby/v2/received-invitations/{invitation_id}/accept')
def accept_queue(connection: LeagueConnection): ''' Accepts the ready check ''' connection.post("/lol-matchmaking/v1/ready-check/accept")
def start_matchmaking(connection: LeagueConnection): ''' Starts the matchmaking process ''' connection.post("/lol-lobby/v2/lobby/matchmaking/search")
def process_control_quit(connection: LeagueConnection): ''' Quits league using proceses contrl ''' connection.post('/process-control/v1/process/quit')