-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Index out of range #46
Comments
Usually this kind on crash happens when agar.io changes protocol. |
Running |
@pulviscriptor It may be that I'm running 50+ bots |
DrTheGoat, how often you see crashes? |
@pulviscriptor Within minutes of running |
@DRTHEGOAT Can you set debug to 5 and show me last 5 packets before crash? |
@DRTHEGOAT You can run script like |
@pulviscriptor Thanks |
I get that every day it crashes all the time |
It happens when i run like 60 bots for a long time(I made bots too) |
@DaAwesomeRazor Please set |
@pulviscriptor 10 05 00 43 3d 02 00 3f 7f 02 00 52 70 02 00 ec 82 02 00 cb 63 02 00 b9 7b 02 00 74 fa 00 00 5d 87 02 00 6a 6a 02 00 17 84 02 00 dc 6f 02 00 a7 08 00 00 46 e8 ff ff 75 00 3d 07 ff 00 00 00 52 70 02 00 23 0c 00 00 19 e7 ff ff ac 01 4e 07 ff 00 00 00 f9 71 02 00 b7 0e 00 00 6e e8 ff ff 38 01 4e 07 ff 00 00 00 00 00 00 00 01 00 00 00 ec 82 02 00 RangeError: index out of range |
@DRTHEGOAT Thank you very much! This is exact packet that i need! @DRTHEGOAT @DaAwesomeRazor somehow your packets got one byte more/less of data. I don't know how that is possible. |
@DRTHEGOAT @DaAwesomeRazor bot.on('packetError', function(packet, err, preventCrash) {
bot.log('Packet error detected for packet: ' + packet.toString());
bot.log('Crash will be prevented, bot will be disconnected');
preventCrash();
bot.disconnect();
}); *My fix is not best solution, but i don't know what else i can do with bytes changes. |
You probably edited agario-client.js in the node modules? bot.on('packetError', function(packet, err, preventCrash) {
bot.log('Packet error detected for packet: ' + packet.toString());
bot.log('Crash will be prevented, bot will be disconnected');
preventCahs();
bot.disconnect();
}); What also could be possible is that you got the number of arguments wrong bot.on('packetError', function(packet, preventCrash) {
bot.log('Packet error detected for packet: ' + packet.toString());
bot.log('Crash will be prevented, bot will be disconnected');
preventCrash();
bot.disconnect();
}); But it should be this: bot.on('packetError', function(packet, err, preventCrash) {
bot.log('Packet error detected for packet: ' + packet.toString());
bot.log('Crash will be prevented, bot will be disconnected');
preventCrash();
bot.disconnect();
}); feel free to join this skype group: |
|
Basicly when I run my bot I get this:
C:\Users\Name\node_modules\agario-client\agario-client.js:415
// If you need that server support, you may create issue https://github.com/pulviscriptor/agario-client/issues
^
RangeError: index out of range
at checkOffset (buffer.js:642:11)
at Buffer.readUInt16LE (buffer.js:688:5)
at Object.Packet.readUInt16LE (C:\Users\Name\node_modules\agario-client\packet.js:51:29)
at Client.processors.49 (C:\Users\Name\node_modules\agario-client\agario-client.js:342:39)
at Object.Client.onMessage (C:\Users\Name\node_modules\agario-client\agario-client.js:140:9)
at WebSocket.onMessage (C:\Users\Name\node_modules\agario-client\node_modules\ws\lib\WebSocket.js:414:14)
at emitTwo (events.js:87:13)
at WebSocket.emit (events.js:172:7)
at Receiver.onbinary (C:\Users\Name\node_modules\agario-client\node_modules\ws\lib\WebSocket.js:804:10)
at C:\Users\Name\node_modules\agario-client\node_modules\ws\lib\Receiver.js:533:18
The text was updated successfully, but these errors were encountered: