Greasemonkey Script Assault Odds

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

Moderators: Global Moderators, Tech Team

Forum rules
Please read the Community Guidelines before posting.

Greasemonkey Script Assault Odds

Postby chipv on Fri Apr 10, 2009 4:52 pm

Conquer Club Assault Odds

From a great idea from Foxglove - full credit for thinking out of the box.

Note There is a quick link to this post next to the Assault Odds text in the left menu.
(It's the current version number but will jump to this page when you click on it.)


User Guide
Assault Odds User Guide

Requirements
You must be running Firefox with Greasemonkey installed.
Full instructions for Firefox and Greasemonkey from scratch: viewtopic.php?f=527&t=139337

No facility for autologin is yet implemented so you do need to be logged in or you can use the
Auto-login script

Installation
Click on this link (with Firefox and Greasemonkey installed)
Conquer Club Assault Odds
Click on Install and that's it.
Google Chrome users can now use this script - click on viewtopic.php?f=59&t=73696#p2137958 to see how to install.
Once installed you will see this on your active games pages.

Image

What does it do

Assault odds is a tool that quickly calculates precise odds for attacking a sequence of territories on any map.
It has been deliberately designed to be faster than other similar calculators and it will also handle larger numbers of armies.
It consists of a Quick calculator and a Pathfinder
You can show/hide these windows on your games page by using the options in the left menu.

Quick Calculator

Image

Type in attacking army number and a sequence of defending army numbers to get the odds of the attacker winning.
Separate defending army numbers with commas.
e.g. Attacking 10 and Defending 3,2 will calculate odds of a 10 army attacking first a 3 then a 2
The results are saved for future use on the page.
This means that if you have very large numbers to calculate and even Assault Odds can't handle it in one go,
then do a calc for roughly half all the armies. Assault Odds re-uses old calcs making subsequent calcs very fast
and allows for bigger numbers to be calculated.
Currently if you refresh the page this data is lost, but the calcs are very quick for most numbers anyway.
Click on the Add Calc button to add more quick calcs for different routes.
The total will show the product of all quick calcs (so the overall odds of succeeding in all attacks).

Multiple Attackers

Image

You can add attacking territories with commas if you want to attack the first defending territory from more than one place.

Tips

  • Do the biggest calculation first. This saves the calcs and will make subsequent calcs practically instantaneous.
  • Do a big calc just before you take your turn. Then you can calc as you go at speed without waiting for calcs.

Pathfinder

Image
This is a sequence of dropdowns allowing you to plot a path on the map and work out odds at each step.
The dropdowns only show valid bordering territories and bombard spots. (A player cannot attack themselves for example).
You can add deployed armies to the first attacking territory selected.
Enter the number of armies to deploy and click anywhere away from the deploy box.
The first territory number will change accordingly.
Note you can choose any player to work out odds for, not just yourself.

Pathfinder During A Turn
Use the refresh button to recalculate path odds during a turn.
If the path is now invalid, the path will be cleared.

Statistics

Image

Further odds on each number of attacking armies surviving can be found by switching the Statistics option on.
In the above example,
There is a 12% chance that exactly 4 attacking armies will survive an 8v4 assault.
There is a 48.2% chance that at least 6 attackers survive.
There is always a 100% chance that at least 1 army survives (since one has to be reserved for advancing).

Statistics are displayed for multiple attackers also.

For multiple quick calcs, at present, only the last calc statistics is shown.

Display Options

Image
You can choose format of odds - decimal or percentage
You can also choose which windows to show on the page.
Statistics enables the display and calculation of odds of surviving attackers.
Last edited by Dako on Tue Jul 17, 2012 2:35 am, edited 3 times in total.
Reason: Added user guide to post
User avatar
Colonel chipv
 
Posts: 2758
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (2) Terminator Achievement (2)
Manual Troops Achievement (1) Freestyle Achievement (1) Nuclear Spoils Achievement (2) Fog of War Achievement (2) Cross-Map Achievement (3)
Ratings Achievement (2) Tournament Achievement (5) General Achievement (2) Clan Achievement (5) Map Contribution (1)
General Contribution (10)

Re: NEW: Assault Odds

Postby chipv on Fri Apr 10, 2009 5:29 pm

Thread unlocked, welcoming comments now please.
User avatar
Colonel chipv
 
Posts: 2758
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (2) Terminator Achievement (2)
Manual Troops Achievement (1) Freestyle Achievement (1) Nuclear Spoils Achievement (2) Fog of War Achievement (2) Cross-Map Achievement (3)
Ratings Achievement (2) Tournament Achievement (5) General Achievement (2) Clan Achievement (5) Map Contribution (1)
General Contribution (10)

Re: NEW: Assault Odds

Postby Woodruff on Fri Apr 10, 2009 5:32 pm

chipv wrote:Thread unlocked, welcoming comments now please.


I presume this does not take into account hidden territories, to include the pathfinding function?
User avatar
Corporal 1st Class Woodruff
 
Posts: 4881
Joined: Sat Jan 05, 2008 9:15 am
Medals: 27
Standard Achievement (4) Quadruples Achievement (1) Terminator Achievement (2) Manual Troops Achievement (1) Fog of War Achievement (3)
Speed Achievement (3) Teammate Achievement (1) Random Map Achievement (1) Cross-Map Achievement (3) Ratings Achievement (4)
Tournament Contribution (4)

Re: NEW: Assault Odds

Postby chipv on Fri Apr 10, 2009 5:34 pm

Woodruff wrote:
chipv wrote:Thread unlocked, welcoming comments now please.


I presume this does not take into account hidden territories, to include the pathfinding function?


Of course not.
User avatar
Colonel chipv
 
Posts: 2758
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (2) Terminator Achievement (2)
Manual Troops Achievement (1) Freestyle Achievement (1) Nuclear Spoils Achievement (2) Fog of War Achievement (2) Cross-Map Achievement (3)
Ratings Achievement (2) Tournament Achievement (5) General Achievement (2) Clan Achievement (5) Map Contribution (1)
General Contribution (10)

Re: NEW: Assault Odds

Postby The Fuzzy Pengui on Fri Apr 10, 2009 5:35 pm

I love it! Installed it just now, can't wait to try it out! :)

A question about an addition (though I'm not sure how feasible it would be); would you be able to add "Eliminate <x> player from game" and it would find your odds of eliminating the player from the game (not necessarily the path, but percentage for all the armies), or should we just use the Pathfinder option and do it for each path you would have to take?
Gilligan wrote:I'M SO GOOD AT THIS GAME
My stepmom locked the bathroom door
So I opened the lock with my shoelace
User avatar
Corporal 1st Class The Fuzzy Pengui
 
Posts: 2337
Joined: Mon Nov 27, 2006 6:52 pm
Location: Ohio
Medals: 49
Standard Achievement (3) Doubles Achievement (3) Triples Achievement (3) Quadruples Achievement (2) Terminator Achievement (2)
Assassin Achievement (1) Manual Troops Achievement (1) Freestyle Achievement (3) Nuclear Spoils Achievement (2) Fog of War Achievement (3)
Speed Achievement (1) Teammate Achievement (3) Cross-Map Achievement (3) Ratings Achievement (2) Tournament Achievement (4)
General Achievement (3) Clan Achievement (3) Tournament Contribution (2) General Contribution (5)

Re: NEW: Assault Odds

Postby The Fuzzy Pengui on Fri Apr 10, 2009 5:53 pm

For some reason when I add armies to be deployed, it completely screws up the amount of armies on each territory (in the pathfinder). In one case, in an Aussie game, it completely took away the option for me to deploy on a specific territory (even though I owned it).
Gilligan wrote:I'M SO GOOD AT THIS GAME
My stepmom locked the bathroom door
So I opened the lock with my shoelace
User avatar
Corporal 1st Class The Fuzzy Pengui
 
Posts: 2337
Joined: Mon Nov 27, 2006 6:52 pm
Location: Ohio
Medals: 49
Standard Achievement (3) Doubles Achievement (3) Triples Achievement (3) Quadruples Achievement (2) Terminator Achievement (2)
Assassin Achievement (1) Manual Troops Achievement (1) Freestyle Achievement (3) Nuclear Spoils Achievement (2) Fog of War Achievement (3)
Speed Achievement (1) Teammate Achievement (3) Cross-Map Achievement (3) Ratings Achievement (2) Tournament Achievement (4)
General Achievement (3) Clan Achievement (3) Tournament Contribution (2) General Contribution (5)

Re: NEW: Assault Odds

Postby Woodruff on Fri Apr 10, 2009 5:56 pm

chipv wrote:
Woodruff wrote:
chipv wrote:Thread unlocked, welcoming comments now please.


I presume this does not take into account hidden territories, to include the pathfinding function?


Of course not.


I presumed not, of course...but as a former programmer, I know how easy it can be to overlook what are the most obvious things sometimes (not that I've EVER done that, of course).
User avatar
Corporal 1st Class Woodruff
 
Posts: 4881
Joined: Sat Jan 05, 2008 9:15 am
Medals: 27
Standard Achievement (4) Quadruples Achievement (1) Terminator Achievement (2) Manual Troops Achievement (1) Fog of War Achievement (3)
Speed Achievement (3) Teammate Achievement (1) Random Map Achievement (1) Cross-Map Achievement (3) Ratings Achievement (4)
Tournament Contribution (4)

Re: NEW: Assault Odds

Postby chipv on Fri Apr 10, 2009 5:57 pm

The Fuzzy Pengui wrote:For some reason when I add armies to be deployed, it completely screws up the amount of armies on each territory (in the pathfinder). In one case, in an Aussie game, it completely took away the option for me to deploy on a specific territory (even though I owned it).


Gawd, I've tested this to death - was this in the middle of a turn (that's new code)?
User avatar
Colonel chipv
 
Posts: 2758
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (2) Terminator Achievement (2)
Manual Troops Achievement (1) Freestyle Achievement (1) Nuclear Spoils Achievement (2) Fog of War Achievement (2) Cross-Map Achievement (3)
Ratings Achievement (2) Tournament Achievement (5) General Achievement (2) Clan Achievement (5) Map Contribution (1)
General Contribution (10)

Re: NEW: Assault Odds

Postby chipv on Fri Apr 10, 2009 5:58 pm

The Fuzzy Pengui wrote:I love it! Installed it just now, can't wait to try it out! :)

A question about an addition (though I'm not sure how feasible it would be); would you be able to add "Eliminate <x> player from game" and it would find your odds of eliminating the player from the game (not necessarily the path, but percentage for all the armies), or should we just use the Pathfinder option and do it for each path you would have to take?


Good idea, I don't see why not!
User avatar
Colonel chipv
 
Posts: 2758
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (2) Terminator Achievement (2)
Manual Troops Achievement (1) Freestyle Achievement (1) Nuclear Spoils Achievement (2) Fog of War Achievement (2) Cross-Map Achievement (3)
Ratings Achievement (2) Tournament Achievement (5) General Achievement (2) Clan Achievement (5) Map Contribution (1)
General Contribution (10)

Re: NEW: Assault Odds

Postby The Fuzzy Pengui on Fri Apr 10, 2009 6:00 pm

chipv wrote:
The Fuzzy Pengui wrote:For some reason when I add armies to be deployed, it completely screws up the amount of armies on each territory (in the pathfinder). In one case, in an Aussie game, it completely took away the option for me to deploy on a specific territory (even though I owned it).


Gawd, I've tested this to death - was this in the middle of a turn (that's new code)?

I tried it both during the middle of a turn and before I started my turn in a different game.

What it appeared to do, when I wasn't actively in a turn, was take the amount of armies I set to "deploy" and subtract it from the actual amount that was already there (taking it down to 1). Then, once the amount of armies was at 1, it would add the amount of armies deployed.

Example: I had 4 on a territory and typed in 3 to deploy. It changed the 4 to a 1. So I changed the deploy amount to 10 just to see what would happen, and it changed the 1 to an 11.
Gilligan wrote:I'M SO GOOD AT THIS GAME
My stepmom locked the bathroom door
So I opened the lock with my shoelace
User avatar
Corporal 1st Class The Fuzzy Pengui
 
Posts: 2337
Joined: Mon Nov 27, 2006 6:52 pm
Location: Ohio
Medals: 49
Standard Achievement (3) Doubles Achievement (3) Triples Achievement (3) Quadruples Achievement (2) Terminator Achievement (2)
Assassin Achievement (1) Manual Troops Achievement (1) Freestyle Achievement (3) Nuclear Spoils Achievement (2) Fog of War Achievement (3)
Speed Achievement (1) Teammate Achievement (3) Cross-Map Achievement (3) Ratings Achievement (2) Tournament Achievement (4)
General Achievement (3) Clan Achievement (3) Tournament Contribution (2) General Contribution (5)

Re: NEW: Assault Odds

Postby chipv on Fri Apr 10, 2009 6:04 pm

When you enter a number in the deploy box, you need to click away from it and the numbers should change automatically.

it is working fine for me still, how are you doing this exactly and in which game?
User avatar
Colonel chipv
 
Posts: 2758
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (2) Terminator Achievement (2)
Manual Troops Achievement (1) Freestyle Achievement (1) Nuclear Spoils Achievement (2) Fog of War Achievement (2) Cross-Map Achievement (3)
Ratings Achievement (2) Tournament Achievement (5) General Achievement (2) Clan Achievement (5) Map Contribution (1)
General Contribution (10)

Re: NEW: Assault Odds

Postby sailorseal on Fri Apr 10, 2009 6:04 pm

So cool! Nice job!
User avatar
Cook sailorseal
 
Posts: 2741
Joined: Sun May 25, 2008 1:49 pm
Location: conquerclub.com
Medals: 27
Standard Achievement (2) Doubles Achievement (1) Triples Achievement (1) Quadruples Achievement (1) Terminator Achievement (1)
Assassin Achievement (1) Freestyle Achievement (2) Fog of War Achievement (1) Speed Achievement (2) Ratings Achievement (3)
Tournament Achievement (1) General Achievement (1) Tournament Contribution (7) General Contribution (3)

Re: NEW: Assault Odds

Postby The Fuzzy Pengui on Fri Apr 10, 2009 6:07 pm

chipv wrote:When you enter a number in the deploy box, you need to click away from it and the numbers should change automatically.

it is working fine for me still, how are you doing this exactly and in which game?

That's exactly how I'm trying it. Typing in the number and clicking away from the text box. The numbers change automatically, but to the wrong number. I tried it in Game 4567481 when pretending to deploy on Andrews.

And SA-WEET! About adding the % to eliminate player from game. :)
Gilligan wrote:I'M SO GOOD AT THIS GAME
My stepmom locked the bathroom door
So I opened the lock with my shoelace
User avatar
Corporal 1st Class The Fuzzy Pengui
 
Posts: 2337
Joined: Mon Nov 27, 2006 6:52 pm
Location: Ohio
Medals: 49
Standard Achievement (3) Doubles Achievement (3) Triples Achievement (3) Quadruples Achievement (2) Terminator Achievement (2)
Assassin Achievement (1) Manual Troops Achievement (1) Freestyle Achievement (3) Nuclear Spoils Achievement (2) Fog of War Achievement (3)
Speed Achievement (1) Teammate Achievement (3) Cross-Map Achievement (3) Ratings Achievement (2) Tournament Achievement (4)
General Achievement (3) Clan Achievement (3) Tournament Contribution (2) General Contribution (5)

Re: NEW: Assault Odds

Postby chipv on Fri Apr 10, 2009 6:36 pm

Ok problem fixed, how annoying, introduced that at the last minute.

Download new version by clicking on Latest Version Installed under Assault Odds menu.
User avatar
Colonel chipv
 
Posts: 2758
Joined: Mon Apr 28, 2008 5:30 pm
Medals: 44
Standard Achievement (2) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (2) Terminator Achievement (2)
Manual Troops Achievement (1) Freestyle Achievement (1) Nuclear Spoils Achievement (2) Fog of War Achievement (2) Cross-Map Achievement (3)
Ratings Achievement (2) Tournament Achievement (5) General Achievement (2) Clan Achievement (5) Map Contribution (1)
General Contribution (10)

Re: NEW: Assault Odds

Postby The Fuzzy Pengui on Fri Apr 10, 2009 6:42 pm

chipv wrote:Ok problem fixed, how annoying, introduced that at the last minute.

Download new version by clicking on Latest Version Installed under Assault Odds menu.

Working now. Thanks mate. :)
Gilligan wrote:I'M SO GOOD AT THIS GAME
My stepmom locked the bathroom door
So I opened the lock with my shoelace
User avatar
Corporal 1st Class The Fuzzy Pengui
 
Posts: 2337
Joined: Mon Nov 27, 2006 6:52 pm
Location: Ohio
Medals: 49
Standard Achievement (3) Doubles Achievement (3) Triples Achievement (3) Quadruples Achievement (2) Terminator Achievement (2)
Assassin Achievement (1) Manual Troops Achievement (1) Freestyle Achievement (3) Nuclear Spoils Achievement (2) Fog of War Achievement (3)
Speed Achievement (1) Teammate Achievement (3) Cross-Map Achievement (3) Ratings Achievement (2) Tournament Achievement (4)
General Achievement (3) Clan Achievement (3) Tournament Contribution (2) General Contribution (5)

Next

Return to Tool Archives

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Login