Reconnect bot if error occurs

This commit is contained in:
Henry Wang 2017-11-14 12:54:11 -06:00
parent 64d9c5e6bc
commit 73bf9f86f2

View File

@ -46,6 +46,9 @@ function foundProto(func) {
function connect() { function connect() {
client.connectGame(process.argv[2], process.argv[3] || '[BOT]', function(success, msg) { client.connectGame(process.argv[2], process.argv[3] || '[BOT]', function(success, msg) {
if (!success) {
setTimeout(connect, 1000);
}
}); });
} }