Commits

Johan Euphrosine committed a55cc61

add stdout flush, and more loggin to bot

Comments (0)

Files changed (1)

       });
       protocol.events.on('error', function(packet) {
         console.dir({ "ERROR:": packet });
+        while (!process.stdout.flush()) ; 
         process.exit(-1);
       });
       client.once('open', function() {
                     use(action.attack, showel.id, zombie.id);
                     var zombie_updated = waitfor({t: 'C', id: zombie.id, active: true}, function(packet) {
                       zombie_removed.cancel();
+                      log.debug('zombie updated {z}'.supplant({z:zombie.id}));
                     });
                     var zombie_removed = waitfor({t: 'D', id: zombie.id}, function(packet) {
                       zombie_updated.cancel();
-                      zombies.shift();
+                      var z = zombies.shift();
+                      log.debug('zombie removed {z}'.supplant({z:z.id}));
                     });
                     var showel_updated = waitfor({t: 'I', id: showel.id}, function(packet) {
                       showel_removed.cancel();
+                      log.debug('showel updated {s}'.supplant({s:showel.id}));
                       kill_zombie(showel, callback);
                     });
                     var showel_removed = waitfor({t: 'D', id: showel.id}, function(packet) {
                       showel_updated.cancel();
                       var s = showels.shift();
+                      log.debug('showel removed {s}'.supplant({s:s.id}));
                       callback();
                     });
                   });