lcinterface v4.1.3
League client interface
An easy way to interact with the league client. This module is basically a middle layer between your app and the league client
Documentation
Dependencies
- node-fetch@2.6.1
Importing
$ npm install lcinterface
const { LCIConnector, LCIClient } = require("lcinterface")
const connector = new LCIConnector()
Getting client credentials
// optional
// the interval a wich lcinterface checks if the league of legends process is running (default is 1 sec/1000 ms)
connector.setCheckProcessInterval(1000)
// listen for event connect
connector.on("connect", (credentials) => {
// do stuff with our client credentials
// when you are done
connector.disconnect()
})
// start the client connector
connector.connect()
All events
- LCIConnector
connect
When lcinterface connects to the league clientdisconnect
When lcinterface disconnects from the league client
Using LCIClient
LCIClient is an object with functions and data
Endpoints
All the built in endpoints in lcinterface
Usage
How to use the endpoints
await LCIclient.virtualCall(LCIClient.endpoints.user.me, "get")
All endpoints
The built-in endpoints, you cannot make add a new group (ex. user), only new endpoints
- user
- me get/post Gets local user data
- game
- runes
- lobby
For all endpoints
LCIClient data
All the built in data in lcinterface
Usage
console.log(LCIClient.game.lanes.UTILITY)
All data
- gameflows
- NONE
- LOBBY
- MATCHMAKING
- READYCHECK
- CHAMPSELECT
- INPROGRESS
- WAITINGFORSTATS
- ENDOFGAME
- lanes
- UNSELECTED
- TOP
- JUNGLE
- MIDDLE
- BOTTOM
- UTILITY
- spells
- queueId
- normal
- blind
- draft
- ranked
- solo_duo
- flex
- extra
- aram
- normal
- partytype
- open
- closed
States
LCInterface has some built-in "states" that can giv you some information, how to get states / how to set/create states
- hooked If LCInterfaces is hooked or not (boolean)
- vcc Virtual call count, ammount of times a virtual call is made (number)
- unsafe Can LCInterface make unsafe virtual calls (boolean), default is true
- any you add
Interface functions
Hooking
"Hook" onto the interface aka initialise the interface, returns false if already hooked
- params
- credentials All the credentials
- returns boolean
LCIClient.hook(credentials: object): boolean
Unhooking
"Unhook" for the league client, returns false if not yet hooked
- return boolean
LCIClient.unhook(): boolean
Unsafe virual calls
You can make virutal calls if you aren't hooked yet, enabled by default
- params
- value Enable or disable the allowing of unsafe call (boolean)
- returns boolean
LCIClient.allowUnsafeCalls(value: boolean): boolean
Interacting with the client
Interact with the league client's endpoints is async
- params
- returns json obj \<T> | a boolean
await LCIClient.virtualCall<T>(endpoint: string, method: methods, data: object | string = {}): Promise<T | boolean>
Getting a state
LCInterface has some built in states (wich you can add to), that you can check
- params
- state What state to check (string)
- returns state data \<T> | false if state doesn't exist
LCIClient.getState<T>(state: string): T | boolean
Setting / Creating a state
LCInterface has some built in states, wich you can set or add to
LCIClient.setState<T>(state: string, value: T): T
Checking a state's value
Here you can check the value of a state
- params
- state The state to check (string)
- returns boolean
LCIClient.isCorrectValue<T>(state: string, value: T): boolean
Fast interface functions
LCInterface also has a few faster (unsafer) versions of methods
Fast hook
Same as the default hook but skips any checks, assumes you are unhooked (will overide data) and is still async
- params
- credentials Only port and password are required
- returns always true
await LCIClient.__fasthook(credentials: base_credentials): boolean
Fast unhook
Same as the default unhook but skips any checks, assumes you are hooked and is still async
- returns always false
await LCIClient.__fastunhook(): boolean
Fast virtual call
Same as the default virtual call but skips increasing vcc count, assumes you are hooked and is still async
- returns json obj \<T>
await LCIClient.__fastvirtualCall<T>(endpoint: string, method: methods, data: object | string = {}): Promise<T>
License
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago