floh22 / native-farsight-module

MIT License
34 stars 15 forks source link

Add install instructions #18

Open FeldrinH opened 1 year ago

FeldrinH commented 1 year ago

It would be nice to have explicit install instruction. (If I understand it correctly then the intended way to install this package is to do npm install https://github.com/floh22/native-farsight-module, but it would be nice if this was explicitly stated somewhere.)

Sylicium commented 1 year ago

Unfortunatly, npm install https://github.com/floh22/native-farsight-module is not working on my end, so here's how worked around.

How to use

  1. Download zip of project (i personally used main branch)
  2. Start a League Of Legends match
  3. From the <root>/index.js call the connectToLeague() function. When its connected, you should be able to use makeSnapshot() to retrieve datas from the game. Make it in a loop so you have constant updated datas and enjoy !

Warning

If you're restarting too much the program, you could have an error when setting offsets, it is caused by a ratelimit of the offsetRepository url (/index.js:10). To prevent that you can fetch that url one time and save the response for callback when ratelimited when debugging only not in production, since as written in README.md, this url MUST be called to maintain up to date the offsets. So be careful not to only use a prefetched version.