Closed andrewda closed 9 years ago
hltv-scorebot is a event driven node module.
First you have to get the module by using
var scorebot = require('hltv-scorebot');
After this you have to connect to the hltv-scorebot-server by using
scorebot.connect('http://scorebot.hltv.org:10022', matchid, socketEvent);
To register a EventListener use
scorebot.on(eventName, function(data) {
console.log(data);
});
Get the eventName-List and eventData from ReadMe.md e.g
scorebot.on('kill', function(data) {
console.log(data.agressor, 'killed', data.victim, 'with', data.weapon, data.headshot ? "(headshot)" : "");
});
I dont tested, but it should work.
I'll add examples as soon as possible.
Incredible explanation -- thanks a ton!
I'm a bit confused with how to use it, but I'm sure I'll get it if you could please make a simple example program! Thanks!