Page 1 of 1

Confirmation Greasemonkey script v0.2

PostPosted: Sat Sep 30, 2006 6:18 am
by Ishiro
I have updated my Confirmation popup script to include the Auto-Attack button in addition to the original End Attacks and End Fortification buttons.

Get the new version here:
http://www.probablynot.com/greasemonkey ... ds.user.js

PostPosted: Wed Jan 17, 2007 7:23 am
by Qwaz
brilliant, i use firefox anyways so :D

PostPosted: Tue Feb 06, 2007 9:10 am
by billval3
Ishiro,

Thanks for this. Is there a way I can take off the confirm for auto attack? I like the other options, just not that one.

Maybe you could republish the older one as well? Thanks!

PostPosted: Tue Mar 06, 2007 8:33 am
by Ishiro
billval3 wrote:Ishiro,

Thanks for this. Is there a way I can take off the confirm for auto attack? I like the other options, just not that one.

Maybe you could republish the older one as well? Thanks!

Just edit the script...

The whole of the script is:
Code: Select all
(function() {

    var inputs = document.getElementsByTagName("input");
    for(var a = 0; a < inputs.length; a++) {
      if (inputs[a].value == "End Attacks")
      {
         inputs[a].setAttribute("onclick", "javascript:return confirm('Are you sure?');" );
      }
      if (inputs[a].value == "End Fortification")
      {
         inputs[a].setAttribute("onclick", "javascript:return confirm('Are you sure?');" );
      }
      if (inputs[a].value == "Auto-Attack")
      {
         inputs[a].setAttribute("onclick", "javascript:return confirm('Are you sure?');" );
      }
    }

})();

The "inputs[a].value" is the Text on the button, just add or remove any button you wish.

missing crucial part

PostPosted: Thu Mar 22, 2007 10:46 am
by alkemann
I downloaded this script based on a reply to a support ticket i posted about the need for an undo button on army placement, as I experienced some unfortunate mishaps that i believe was part me and part system fault. Anyways the reply said I should install this script, but it doesnt do what I need it most to. To show a confirmation dialog when I place armies, telling me what country I am placing on and how many. If it could show on the actual map as well, that would rock.

anyways, if this is possible, it would appreciate it

alek

Re: missing crucial part

PostPosted: Thu Mar 22, 2007 11:22 am
by tahitiwahini
alkemann wrote:I downloaded this script based on a reply to a support ticket i posted about the need for an undo button on army placement, as I experienced some unfortunate mishaps that i believe was part me and part system fault. Anyways the reply said I should install this script, but it doesnt do what I need it most to. To show a confirmation dialog when I place armies, telling me what country I am placing on and how many. If it could show on the actual map as well, that would rock.

anyways, if this is possible, it would appreciate it

alek


I believe the following code will do for the Deploy button what the confirmation script already does for End Fortification, End Attacks, and Auto-Attack. That it, it will make you confirm the action whenever you press any of these buttons.

This would not be an "undo" button however, just a confirmation dialog (OK or Cancel) when you press the Deploy button. It would effectively tell you how many armies you were placing on a particular country (that's basically what it does now, isn't it?), but it would not show it on the actual map. It would appear on the map when you clicked OK in the confirmation dialog. If you really want an "undo" button, this fix isn't it. But if you want something that will allow you to reject a bad button press when deploying this will do the trick. I've tried it and it works.

Code: Select all
(function() {

    var inputs = document.getElementsByTagName("input");
    for(var a = 0; a < inputs.length; a++) {
      if (inputs[a].value == "End Attacks")
      {
         inputs[a].setAttribute("onclick", "javascript:return confirm('Are you sure?');" );
      }
      if (inputs[a].value == "End Fortification")
      {
         inputs[a].setAttribute("onclick", "javascript:return confirm('Are you sure?');" );
      }
      if (inputs[a].value == "Auto-Attack")
      {
         inputs[a].setAttribute("onclick", "javascript:return confirm('Are you sure?');" );
      }
      if (inputs[a].value == "Deploy")
      {
         inputs[a].setAttribute("onclick", "javascript:return confirm('Are you sure?');" );
      }
    }

})();


How to edit the confirmation script:

Right-click the red greasemonkey icon, and then right-click CC Phase End Confirm script.

Either this will open an editor or it will prompt you to pick an editor to use.

If it opens an editor, fine use that editor.

If it wants you to pick an editor to use, Notepad that comes with Windows works fine.

In the editor replace the entire contents with the code except from above.

When you're done save the file in the editor.

That's all there is to it.

Good luck.

PostPosted: Sun Apr 01, 2007 10:16 am
by Ishiro
A nice little warning for today (being April Fool's Day), the confirmation script will cease to function as it depends on the text of the buttons, which has been changed today.

Or, as I should say....

A neece-a leettle-a verneeng fur tudey (beeeng Epreel Fuul's Dey), zee cunffurmeshun screept veell ceese-a tu fooncshun es it depends oon zee text ooff zee boottuns, vheech hes beee chunged tudey. Bork bork bork!

PostPosted: Fri Apr 27, 2007 4:05 pm
by johnzam
Is it possible to add a script/line for confirming troop deployment!!

PostPosted: Fri Apr 27, 2007 5:14 pm
by tahitiwahini
johnzam wrote:Is it possible to add a script/line for confirming troop deployment!!


If you really want to do this, instructions for how to do so are in a previous post in this thread (about 4 back).

However, there's a better way:

<puts stocksr's greasemonkey script salesman hat on>

Go to the first topic in this forum (Utilities and Plug-ins for Conquer Club) and look for stocksr's greasemonkey script. Start using Mozilla Firefox as your browser if you aren't already. Download and install greasemonkey. Download and install stocksr's greasemonkey script. Once installed you will notice a Greasemonkey Menu on left of the screen (along with the existing Game, Interaction, and Personal Menus). You will only see this when you have a game window open. Make sure Confirm Options: On, if it's not just click it and it will be. One of the things that will be confirmed once you do this is the Deploy button.

In my opinion, upon the integration of the confirmation script into stocksr's greasemonky script there's really no reason to use the confirmation script when you can get the same functionality (but with greater configurability) with stocksr's script.

<takes stocksr's greasemonkey script salesman hat off>

Hope this helps.

PostPosted: Fri Oct 19, 2007 8:41 am
by redtide
I'm trying to load the confirmation script at the top, but am getting an error message saying something like "error loading. 404. Ok"

Any idea what's up?

PostPosted: Fri Oct 19, 2007 8:59 am
by yeti_c
redtide wrote:I'm trying to load the confirmation script at the top, but am getting an error message saying something like "error loading. 404. Ok"

Any idea what's up?


I suspect that it doesn't work with AJAX turned on...

C.

PostPosted: Wed Oct 24, 2007 11:19 am
by redtide
But I can't even download and install it - it seems like that's a bad link, although I've used it in the past. Any ideas?

PostPosted: Wed Oct 24, 2007 11:51 am
by Ishiro
redtide wrote:But I can't even download and install it - it seems like that's a bad link, although I've used it in the past. Any ideas?


This script does not exist anymore. I stopped updating it when it got incorporated into BOB. After a few months I removed the file from my website.

PostPosted: Thu Oct 25, 2007 11:55 am
by redtide
Bummer! I love BOB, but for some reason it screws my keyboard all up. After every few turns I have to unplug my keyboard from my KVM switch to get it to work. When I disabled BOB, the problem stopped.

PostPosted: Thu Oct 25, 2007 6:19 pm
by Tyrion81
That's extremely odd, I can't see how that would happen.

What operating system, version of firefox and greasemonkey are you running?

PostPosted: Sat Dec 01, 2007 2:22 am
by Shooter_Jay
So if I read this thread right, if I download and install firefox then greasemonky and adjust/set it up right, I will be able to cancel a fortify AFTER seeing the numbers change on the map?

PostPosted: Sat Dec 01, 2007 9:15 am
by Ishiro
Shooter_Jay wrote:So if I read this thread right, if I download and install firefox then greasemonky and adjust/set it up right, I will be able to cancel a fortify AFTER seeing the numbers change on the map?


No.

First, this particular script does not work any more with this website.

Second, once the numbers change on the map, you can't go back. All confirmation scripts do is give you a pop-up window that asks "Are you sure?" with OK and CANCEL buttons. If you cancel, it stops the process, if you hit OK, it places the armies on the board.

The functionality of this script is built into AJAX BOB now.

PostPosted: Sat Dec 01, 2007 10:44 am
by Shooter_Jay
ok thanks

Re:

PostPosted: Tue Aug 16, 2011 12:59 pm
by Calidrmr
Ishiro wrote:
redtide wrote:But I can't even download and install it - it seems like that's a bad link, although I've used it in the past. Any ideas?


This script does not exist anymore. I stopped updating it when it got incorporated into BOB. After a few months I removed the file from my website.

moved to archives by Calidrmr 8/16/11
reason: per OP, script not available, incorporated into BOB
no shadow topic left in place