Package Exports
- lcinterface
- lcinterface/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lcinterface) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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
Importing
npm install lcinterface
const { client, C_Game, C_User, C_Runes } = require("lcinterface")Getting client credentials
// listen for event connect
client.on("connect", (data) => {
// do stuff with our data/client credentials
// after interacting with the client
client.disconnect()
})
// start the client connector
client.connect()All events
- client
connectWhen lcinterface connects to the league clientdisconnectWhen lcinterface disconnects from the league client
Setting up interface
- constructor
canCallUnhookedIf set to true, skips checking hook state when doing a virutal call
const c_interface = new C_InterfaceName(?canCallUnhooked)Interface's
C_User
For interacting with the user
- dest
meGets users dataacceptAccepts or declines match
C_Game
For interacting with the game
- dest
gameflowState of the client (InGame, ReadyCheck, ...)sessionCurrent data of the match you're in
C_Runes
!!Experimental For interacting with your runes
- dest
runesAll runes of the user (in ids, good luck)
Interface functions
Hooking
"Hook" onto the interface aka initialise the interface make sure to only call once per interface, returns false if already hooked
- params
dataAll the credentials
- returns boolean
c_interface.hook(credentials)Unhooking
Unhooks the interface, returns false if you weren't hooked
- returns boolean
c_interface.unhook()State Cheking
Check the state of a interface variable, returns false if state doesn't exists
- params
stateState to checkvalueValue to compare current state to
- returns boolean
c_interface.isCorrectState(state, value)Set State
Set value of a state or create a state
- params
stateState to changedataWhat to set the state to
- returns data
c_interface.setState(state, data)Get State
Gets value of the requested state, returns false if state doesn't exists
- params
stateState to get
- return state data
c_interface.getState(state)All states
All the states currently built into the module
- states
hookedBooleanvirtualCallCountNumber
Interacting with the client
Interact with the client's api endpoints is async
- params
destIs the endpoint in string formdataIs the json obj to send to the client, (optional)methodDefault is post if data is given else it's get, (optional)
- return json obj
c_interface.virtualCall(c_interface.dest.endpointName, ?data, ?method)Adding your own dest/endpoint
Adds a endpoint to the dest list, returns false if dest already exists
- params
nameName of the destendpointActual enpoint string
- return boolean
c_interface.addDest(name, endpoint)