Page 1 of 1

BOB - autosnap at fort phase

PostPosted: Fri Nov 15, 2013 2:15 pm
by agentcom
Anyone ever thought of modding BOB, so that the "End Reinforcement" button also takes a snap? I'd love it.

Re: BOB - autosnap at fort phase

PostPosted: Fri Nov 15, 2013 10:12 pm
by Woltato
yeah, I've hacked the code on mine to make it do this. It's much better as I often used to forget to take a snap.

Re: BOB - autosnap at fort phase

PostPosted: Fri Nov 15, 2013 10:27 pm
by Woltato
just edit the bob script and search on "Confirmation Popups" and change the code there to this.

Code: Select all
/* --- Confirmation Popups --- */
      if (((command == 'End Assaults' || command == 'End Reinforcement' || (command == 'Reinforce' && gameSettings.fortifications != eFortifications.UNLIMITED)) && myOptions.confirmEnds) || (command == 'Auto-Assault' && myOptions.confirmAutoAttack) || (command == 'Deploy' && myOptions.confirmDeploy)) {
         var message = "Are you sure you wish to " + command + "?";
         if (command == "Reinforce") {
            message = "Only one reinforcement possible, are you sure?";
         }
         if (confirm(message)) {
            if (command == 'Reinforce' || command == 'End Reinforcement' )
             {
                  document.getElementById('snapToChat').click();
                  alert('Snapshot taken');
             }
            return newsendRequest(command);
         } else {
            return false;
         }
      } else {
         return newsendRequest(command);
      }


It's not quite perfect.
When it takes a snapshot an alert pops up. you need to wait until it's finished loading in the background before clicking ok on the alert or it won't end your turn properly. It doesn't work without the alert for some reason that proved beyond my javascripting abilties to figure out. Maybe someone cleverer than me can work out how to do this properly.

Re: BOB - autosnap at fort phase

PostPosted: Sat Nov 30, 2013 12:22 pm
by agentcom
Well that's pretty cool. Like you said, it would be nice if someone integrated into BOB proper and got the kinks worked out.