piomar123

Tribal Wars Show Command Units

Feb 8th, 2020
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // updated at 09.02.2020 12:04
  2. (function() {
  3.     if (game_data.screen != 'info_command') {
  4.         alert("Go to a command details first!");
  5.         return;
  6.     }
  7.     $.get(document.location.href + '&ajax=details',
  8.           function(data) {
  9.             var response = JSON.parse(data);
  10.             var text = '';
  11.             for (var unit in response['units']) {
  12.                 var count = response['units'][unit]['count'];
  13.                 if (count !== "0") {
  14.                     text += unit + ': ' + count + '\n';
  15.                 }
  16.             }
  17.             alert(text);
  18.     });
  19. })();
Advertisement
Add Comment
Please, Sign In to add comment