native-farsight-module
native-farsight-module copied to clipboard
🔭 Farsight 🔭
A simple passive memory reader which aims to retrieve information about League of Legends spectator games which the API does not provide. This a nodejs native module which utilizes native memory reading with a js interface.
Farsight uses Memory Reading to get information that the Riot API does not expose. Riot's policy in the past has been to allow passive memory reading, which is exactly what this program does, but this may change at any time. Farsight currently provides little use during live games and is tailored to be used during spectate games. During live games, objects the player does not see will not be read properly, leading to incorrect or outdated data
Features
Each memory snapshot produces game state information the moment the snapshot was taken. Each snapshot includes the following:
- Game time
- Next dragon type to spawn
- List of Champions
- List of Turrets
- List of inhibitors
- Misc game objects
Each game object currently has the following data. If you need any extra unit information, create an [Issue][issues-url] in the form of a feature request.
!Not possible: Aggregate player stats: (Kills, Deaths, Assists, CS, Vision Score)!
- Health/Max Health
- Mana/Max Mana
- Position
- Team
- Unit Id
- Display Name
- Current Gold / Total Gold
- Level / Experience
(7 and 8 player only)
Offsets
Roughly every two weeks League of Legends updates and its memory layout changes slightly, so offsets must be updated.
Offsets will be updated within roughly 24-48 hours, though this may not always be the case. Keep in mind, this is an open source project maintained in free time, please do not harass me or others for offsets in the issues or anywhere else. You are welcome to assist and contribute to this project by updating the offsets yourselves and creating a pull request so others can use them.
There is a Text tutorial avaible which outlines the process.
Methods
connectToLeague
-
[out] success: bool
Operation sucess
init library connection with the league process.
disconnectFromLeague
-
[out] success: bool
Operation sucess
close library connection with the league process.
setOffsets
var result = setOffsets({
gameTime: 0x316FDE4,
objIndex: 0x8,
objTeam: 0x34,
objNetworkID: 0xB4,
objPosition: 0x1DC,
objHealth: 0xE7C,
objMaxHealth: 0xE8C,
objMana: 0x029C,
objMaxMana: 0x2AC,
objName: 0x2DB4,
objLvl: 0x35A4,
objExperience: 0x3594,
objCurrentGold: 0x1BB4,
objTotalGold: 0x1BC4,
objDisplayName: 0x54,
objDisplayNameLength: 0x64,
objectManager: 0x18D9ACC,
objectMapCount: 0x2C,
objectMapRoot: 0x28,
objectMapNodeNetId: 0x10,
objectMapNodeObject: 0x14,
heroList: 0x18D9B6C,
minionList: 0x252729C,
turretList: 0X316EAC4,
inhibitorList: 0x0
});
-
[in] offsets: Object
An object containing the needed offsets. Object format can be seen in code example -
[out] success: bool
Operation sucess
Sets the offsets used for memory reading. Must be done before any snapshot is requested, otherwise snapshot creation fails. Currently cannot be reset once set.
setChampionNames
-
[in] champions: string[]
A lowercase list of all champion names/ids -
[out] success: bool
Operation sucess
Sets the list of champions to scan for. Most common usage will be to use a full list of all champions currently in League of Legends. List must be lower case! Currently cannot be reset once set.
isReady
-
[out] ready state: bool
Library readiness state.
Wether or not the library is ready to create Snapshots
makeSnapshot
-
[out] snapshot: Object
Snapshot object containing current game state information
Creates a snapshot of all game objects currently in game. Farsight must be connected, as well as champion list and offsets provided.
Members
autoImportChampions
-
boolean
: Wether or not Farsight should automatically fetch the current list of all champions from Community Dragon. This takes place onconnectToLeague
.
True by default. If set to false, you must provide the list before requesting a snapshot.
autoImportOffsets
-
boolean
: Wether or not Farsight should automatically fetch the current offsets from this repository. Repository currently not configurable! This takes place onconnectToLeague
.
True by default. If set to false, you must provide offsets before requesting a snapshot.
Example
Example usage is provided in the example folder of this repo. It currently contains a very basic console logger which conntects and prints the snapshot to the console. In case you write a simple use case using this library, please feel free to create a PR to add your example to this folder.
License
Distributed under the MIT License. See LICENSE
for more information.
This is a standalone project from Lars Eble. Riot Games does not endorse or sponsor this project.