https://github.com/balthazar/csgo-float
:gem: Retrieve CS:GO float values in JavaScript
https://github.com/balthazar/csgo-float
counter-strike csgo games node-steam
Last synced: 7 months ago
JSON representation
:gem: Retrieve CS:GO float values in JavaScript
- Host: GitHub
- URL: https://github.com/balthazar/csgo-float
- Owner: balthazar
- Created: 2015-12-30T17:37:48.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-07T16:15:52.000Z (over 8 years ago)
- Last Synced: 2025-03-11T23:16:34.204Z (7 months ago)
- Topics: counter-strike, csgo, games, node-steam
- Language: JavaScript
- Homepage:
- Size: 40 KB
- Stars: 58
- Watchers: 4
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# csgo-float
> Retrieve CS:GO float values in JavaScript
npm i -S csgo-float
#### Usage
Only one request can be done at a time by each client. You'll have to wait for the first request to be processed before sending another one.
###### Client
```javascript
new FloatClient(clientAuth, debug)
````clientAuth` {Object} SteamUser credentials to login / SteamClient
`debug` {Boolean} Print some useful informations
```javascript
// Init a client using a credentials object
const client = new FloatClient({
account_name: 'yeah',
password: 'this-is',
auth_code: 'definitely',
sha_sentryfile: 'right'
}, true)// Or by passing an existing SteamClient instance
// that should be connected and logged.
const steamClient = new SteamClient()
const client = new FloatClient(steamClient)
```###### Methods
```javascript
client.requestFloat(url)
```Returns a Promise.
Where url is a string formatted like `S76561198190349706A4757476613D16467978012840927110`.
```javascript
client.requestFloat('S76561198190349706A4757476613D16467978012840927110')
.then(floatValue => console.log(floatValue))
.catch(err => console.log(err))
```###### Events
`ready` Emitted once the client is ready to receive float requests
`sentry` The user is authenticated and the account sentry is sent, should be saved somewhere
`error` Once an error is triggered
#### Thanks
This would not exists without the help of [@Twewki](https://github.com/Tewki).