Confirmation Greasemonkey script v0.2

Archival storage to keep things organized and uncluttered. Can't find what you need? Search for old topics here.

Moderator: Tech Team

Forum rules
Please read the Community Guidelines before posting.
Post Reply
User avatar
Ishiro
Posts: 324
Joined: Mon Jul 17, 2006 6:53 pm
Gender: Male
Location: Under the Rainbow
Contact:

Confirmation Greasemonkey script v0.2

Post 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
Qwaz
Posts: 9
Joined: Wed Dec 27, 2006 12:07 pm

Post by Qwaz »

brilliant, i use firefox anyways so :D
billval3
Posts: 85
Joined: Fri Dec 22, 2006 4:23 pm
Location: NY Metro
Contact:

Post 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!
User avatar
Ishiro
Posts: 324
Joined: Mon Jul 17, 2006 6:53 pm
Gender: Male
Location: Under the Rainbow
Contact:

Post 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.
alkemann
Posts: 1
Joined: Fri Mar 02, 2007 11:03 am

missing crucial part

Post 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
User avatar
tahitiwahini
Posts: 964
Joined: Fri Jan 19, 2007 5:26 pm

Re: missing crucial part

Post 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.
Cheers,
Tahitiwahini
User avatar
Ishiro
Posts: 324
Joined: Mon Jul 17, 2006 6:53 pm
Gender: Male
Location: Under the Rainbow
Contact:

Post 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!
Image
johnzam
Posts: 3
Joined: Wed Apr 25, 2007 5:21 pm

Post by johnzam »

Is it possible to add a script/line for confirming troop deployment!!
User avatar
tahitiwahini
Posts: 964
Joined: Fri Jan 19, 2007 5:26 pm

Post 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.
Cheers,
Tahitiwahini
redtide
Posts: 176
Joined: Mon Jan 08, 2007 2:49 pm

Post 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?
User avatar
yeti_c
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am
Gender: Male

Post 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.
Image
Highest score : 2297
redtide
Posts: 176
Joined: Mon Jan 08, 2007 2:49 pm

Post 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?
User avatar
Ishiro
Posts: 324
Joined: Mon Jul 17, 2006 6:53 pm
Gender: Male
Location: Under the Rainbow
Contact:

Post 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.
Image
redtide
Posts: 176
Joined: Mon Jan 08, 2007 2:49 pm

Post 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.
Tyrion81
Posts: 14
Joined: Thu Mar 22, 2007 9:29 pm
Location: Sydney, Australia

Post 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?
User avatar
Shooter_Jay
Posts: 64
Joined: Sat Nov 17, 2007 5:53 pm

Post 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?
This is my sig...
User avatar
Ishiro
Posts: 324
Joined: Mon Jul 17, 2006 6:53 pm
Gender: Male
Location: Under the Rainbow
Contact:

Post 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.
Image
User avatar
Shooter_Jay
Posts: 64
Joined: Sat Nov 17, 2007 5:53 pm

Post by Shooter_Jay »

ok thanks
This is my sig...
User avatar
Calidrmr
Posts: 641
Joined: Wed Sep 12, 2007 6:00 pm
Location: the corner bar...
Contact:

Re:

Post 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
Image
<Juan_Bottom>You're like the Barry Bonds of drinking. You don't need the practice you just do it because you like it.
Post Reply

Return to “Tool Archives”