Page 1 of 28

BOB version 1.2 [was CC Greasemonkey script - unofficial]

PostPosted: Sun Mar 18, 2007 4:12 pm
by stocksr


Bug fix Version:

http://www.trentolson.ca/downloads/conquerclubbob.user.js

Thanks lobster

downloading & installing my script
To download the latest version of my script please use the following URL
BROKEN DO NOT USE
http://robertstocks.co.uk/conquerClub/conquerclub-bob.1.2.user.js


Upgrading to BOB
Before upgrading or installing for the first time you should disable or uninstall old versions of the script.

Before installing my script you will need to be using Firefox as your web browser and have the Greasemonkey add-on installed.

About my script
I have taken the official CC Greasemonkey Script (beta .5) "Band-Aid Release" and made some modifications, I post my version here with Tr0y's kind permission.

Please note my script will not work alongside Tr0y's version. You should disable his version before using mine.

Further to a recent poll in this thread [now closed] this version of my script is called BOB.


help & questions
Please read this thread for general help and guidance on installing the script.

Please note that I have delegated all Help/Info work to cicero. If you find any errors or have suggestions for additions to the Help/Info or simply don't understand it (which is its primary function after all) please post to this thread and cicero will respond.

If you have successfully installed the script please do read the Help/Info before posting help requests to the thread.

Robert [stocksr]



A version history of modifications starting from Tr0y's original script:
Code: Select all
//-----------------------------------------------------------------------------
// New features in Version BOB v1.2
//-----------------------------------------------------------------------------
// * Bug fix - Wraping on the Continents list
// * Bug fix - "Confim" messages broken
//-----------------------------------------------------------------------------
// New features in Version BOB v1.1
//-----------------------------------------------------------------------------
//  * Map Fade is a now a per MAP setting, Upgrading Users will inherit
//      your CURRENT setting as a default for new maps,
//      new installs will have 0% map fade as a default
//  * Stats and Text Map are now live settings ( DO NOT REQUIRE A REFRESH TO CHANGE)
//  * Confirm Items are now live settings (No refresh on change)
//  * Team Stats
//  * Bug Fix - New map had inconsistent spaces in name
//-----------------------------------------------------------------------------
// New features in Version BOB v1.0
//-----------------------------------------------------------------------------
//  * New Name - BOB - Thanks yeti_c
//  * Bug fix - Assassin target Broke the card counter;
//  * Bug fix - this script broke the Dice Analyzer Menu Item
//  * Popup message if any previous version of the script is detected.
//  * changed the highlight on a SAFE territory - SAFE means that all it's borders are owned by a member of the same team.
//-----------------------------------------------------------------------------
// New features in Version RJS.9
//-----------------------------------------------------------------------------
//  * And Click and Flash effect to text map, and continent list in the stats table
//  * Include Fortify Button in the confirm actions option for Non Unlimited Games
//  * Change card calculations to be read from the page (rather than worked out from the log)
//  * change clock display to not be editable - thanks weirdbro.
//  * Colour code the action dropdowns on all moves to show the colour of the player
//      who owns that territory and the number of the armies in the territory.
//  * Add Stats modes - Standard|Extended|Off This controls the level of detail
//      in the stats table and makes the include estimate option standard, I have moved
//  * Lots of work to improve performance
//  * Add Version number to menu title
//-----------------------------------------------------------------------------
// New features in Version RJS.8
//-----------------------------------------------------------------------------
//  * Add hover to the cards in the my cards list.
//  * Change the text map to offer two versions (Standard and Extended)
//  * Hover Highlight now includes those territories that can attack the selected one as well as the ones that you can attack
//  * Change the Map Inspect text line to show territories you can attack and territories that can attack you
//  * Change the clock format option to  Off|24h|am/pm
//  * Added Help Popup
//  * Bug Fix : Jump to map option refresh was not working correctly
//  * Formatting Change AM/PM -> am/pm & add leading 0 to 24h clock
//  * Bug Fix : Map fade 0% prevented menu from working correctly, thanks weirdbro
//  * Bug Fix : Some menu items where updating the wrong menu text when clicked, thank weirdbro
//  * Split confirm actions into two options - Confirm Deploy and Confirm Auto-Attack
//  * Consolidate Duplicated Continent Names
//  * Adds a points summary to the end of the log in Terminator games.
//-----------------------------------------------------------------------------
// New features in Version RJS.7
//-----------------------------------------------------------------------------
//  * Add Team Roll-over
//  * Remove Card Count from player list
//  * add site style card count to stats table
//  * move missed turns to it's own column
//  * Bug fix - map inspect, the status bar was not hiding if the option was turned off
//  * Tweak the options order to move the options that are changed more often to the top.
//  * Merge Ishiro's confirm attacks script, and add options to control it.
//  * Merge TAHITIWAHINI's estimate of armies from cards (with option to hide it) - I put it in it's own column
//-----------------------------------------------------------------------------
//   New features in Version RJS.6
//-----------------------------------------------------------------------------
//   * Adds Options Menu and moves settings into browser storage.
//    There is no longer any need to edit the script to change options; it is done using the on page menu.
//  * Handle Special case of playername in log not matching playername in player list ( See Game 332574)
//-----------------------------------------------------------------------------
//   New features in Version RJS.5
//-----------------------------------------------------------------------------
//   * Add Inspect - show information on hover
//   * Change map highlights to be fully transparent
//   * Add Continents information to statistics table.
//   * Bug fix in statistics table: Changed the * indicator next to Territories
//     to show * to indicate taking 1 territory will lose an army ** take 2 and *** take 3.
//    [Indicated the wrong number of armies in previous versions.]
//-----------------------------------------------------------------------------
//   New features in Previous Versions
//-----------------------------------------------------------------------------
//   * Add map fade - makes the numbers stand out more.
//                 - includes user option to control how much fade.
//   * Add finish time to clock - appends "Tomorrow @ 07:23" (for example) after time remaining
//   * Add text only version of map - off by default as it takes up a lot of space
//   * Add calculation of continent bonus - included in calculation of armies due next turn
//   * Add missed turn counter - included in calculation of armies due next turn
//   * Add hover highlights to map and player names


PostPosted: Sun Mar 18, 2007 4:26 pm
by Master Bush
Nobody should download this version until we here from Tr0y. Being that this is stocksr first post, you just never know what this script is.

No offense stocksr.

PostPosted: Mon Mar 19, 2007 3:36 am
by stocksr
Thats good advice Master Bush, I did offer Tr0y a copy via a PM and he asked me to publish it.

Tr0y: waiting for your comments

Suggestion

PostPosted: Tue Mar 20, 2007 1:47 am
by Windparson
I would love to see Grease Monkey, no matter whose version, show a yellow color on the data line to indicate the last player is on the clock before yourself. Also, and this could be a toggle option as some players would hate it, your yellow box could blink if there is 10 minutes or less left before your move is active.

Just my 2 cent. I love the program. I don't know how I played before Firefox and Grease Monkey!

Thanks!

Windparson

PostPosted: Tue Mar 20, 2007 1:50 am
by Numia Kereru
It is a pretty good script as far as I can tell. The stats take up a good chunk of the screen, but that'll just take some getting used to. I'm loving the bonus counter, helps out a lot.

Overall... great! Thanks :D

PostPosted: Tue Mar 20, 2007 2:02 am
by reverend_kyle
Good script. I like the actual number of total armies. and the screen fade at 0.2 other then that I dont care about the other new stuff.

PostPosted: Wed Mar 21, 2007 1:50 am
by logitech007
Nice script. How do you change the screen fade and hide the text?

PostPosted: Wed Mar 21, 2007 3:25 am
by stocksr
logitech007 wrote:Nice script. How do you change the screen fade and hide the text?


To hide the text based map edit the script file and look for (about line 64)
Code: Select all
OPTIONS['textMap'] = true;

change it to
Code: Select all
OPTIONS['textMap'] = false;


To change the fade, on the very next line is

Code: Select all
OPTIONS['fadeMap'] = 0.5; // 0 = No Fade  1 = Total WhiteOut


Change the number to your desired level.

Re: Suggestion

PostPosted: Wed Mar 21, 2007 5:17 am
by stocksr
Windparson wrote:I would love to see Grease Monkey, no matter whose version, show a yellow color on the data line to indicate the last player is on the clock before yourself. Also, and this could be a toggle option as some players would hate it, your yellow box could blink if there is 10 minutes or less left before your move is active.

Sorry Windparson I don't understand your request what are you referring to as the data line?

PostPosted: Wed Mar 21, 2007 12:49 pm
by Windparson
The line at the bottom of your browser thats shows all your games as red blocks if waiting and green blocks if your turn is up. Does that clarify?

Thanks for the reply too,

Windparson

PostPosted: Wed Mar 21, 2007 2:09 pm
by sully800
Windparson wrote:The line at the bottom of your browser thats shows all your games as red blocks if waiting and green blocks if your turn is up. Does that clarify?

Thanks for the reply too,

Windparson


That's a completely seperate script. Not tr0y's grease monkey and therefore not the new edited monkey either.

PostPosted: Wed Mar 21, 2007 2:35 pm
by Backglass
sully800 wrote:
Windparson wrote:The line at the bottom of your browser thats shows all your games as red blocks if waiting and green blocks if your turn is up. Does that clarify?

Thanks for the reply too,

Windparson


That's a completely seperate script. Not tr0y's grease monkey and therefore not the new edited monkey either.


And...it's not a script at all. It's an add-on...a program itself, like the Greasemonkey Add-On.

So lets review:
  • "Conquer Tell" is a Firefox "Add-on", that gives you the red/green blocks.
  • "Greasemonkey" is a Firefox "Add-On"; A user script manager.
  • "Conquer Club" is the name of a Greasemonkey Script by Tr0y, used with the Greasemonkey Add-On.
  • "Conquer Club - Roberts Mods" is the name of stocksr's version of the above script.
Crystal Clear isn't it! :lol: Part of the confusion is that Troys script has no name (other than Conquer Club)

PostPosted: Wed Mar 21, 2007 2:37 pm
by tahitiwahini
^Thank you for making all that clear.

PostPosted: Wed Mar 21, 2007 8:46 pm
by tahitiwahini
Love the modifications to the script stocksr, thank you very much.

With the map fade feature for the first time I can comfortably see the Classic map (it used to appear so dark on my screen I could barely read the number of armies in each country).

The revised number of armies per turn (taking into consideration the continent bonus as well as the missed turn bonus) is excellent.

My user settings:

OPTIONS['colorblind'] = false;
OPTIONS['textMap'] = false;
OPTIONS['fadeMap'] = 0.4; // 0 = No Fade 1 = Total WhiteOut

Now that I can finally see the armies in each country I don't need the colorblind version. I can't imagine why anyone would want to see the text map. 0.4 seems to work best with my monitor.

I'm toying with adding an estimate of potential armies due to the card bonus to the stats. My first attempt will be to handle flat rate. If I get something working I will share my results here.

Thanks again.

PostPosted: Wed Mar 21, 2007 8:48 pm
by Tr0y
Yea, feel free to use modified versions of my script. 8)

I should of probably come up with a better name for it... :shock:

BTW

Well done on the script. :D

PostPosted: Wed Mar 21, 2007 11:09 pm
by Blind Date
Help....I have downloaded and for some of my games, it has a letter next to each army group on the map but others just the number?

In some games, I can see the bonus (es) that are coming for each player but others it just like the old version?

The fading...is a little to much for my liking..How do I get to the script to make an adjustment?

Thanks.

BD

PostPosted: Thu Mar 22, 2007 12:20 am
by tahitiwahini
Blind Date wrote:Help....I have downloaded and for some of my games, it has a letter next to each army group on the map but others just the number?

In some games, I can see the bonus (es) that are coming for each player but others it just like the old version?

The fading...is a little to much for my liking..How do I get to the script to make an adjustment?

Thanks.

BD


OK, first things first. You should only have one version of Conquer Club greasemonkey script enabled at one time.

Right-click your red (grinning) greasemonkey icon. If you want to run the new script you should see that Conquer Club is not checked and that Conquer Club - Roberts Mods is checked.

If that's not the way things are, left click on Manage User Scripts....

Make sure Conquer Club is grayed out and that Conquer Club - Roberts Mods is not grayed out.

To enable a script highlight it and then check the enable box.

To disable a script highlight it and then uncheck the enable box.

Again, you want Conquer Club disabled and Conquer Club - Roberts Mods enabled.

Click OK to close the Manage User Scripts.... window.

Now you want to edit the script.

[Edit]
If you are unfortunate enough to have a Mac:

Mac's are going to shave at least two years off of my expected lifespan :P

Right-click on the red monkey and then left-click on Manage User Scripts...

Highlight Conquer Club - Roberts Mods

Click the Edit button.

For the rest of us....

[/Edit]

Right-click the monkey, and then right-click Conquer Club - Roberts Mods 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.

Scroll down the editor until you see:

//-----------------------------------------------------------------------------
// USER SETTINGS
//-----------------------------------------------------------------------------
var OPTIONS = new Object();
OPTIONS['jumptomap'] = true;
OPTIONS['colorblind'] = false;
OPTIONS['focuscolor'] = '#C00';
OPTIONS['textMap'] = false;
OPTIONS['fadeMap'] = 0.4; // 0 = No Fade 1 = Total WhiteOut

I suggest you make sure that your settings match the ones given above.

Basically it turns off the color blind army numbers so the army numbers appear as numbers rather than letter-number combinations. That is, 5 instead of r5.

You don't really want to see the text map, so the settings given above turn it off.

Finally, the fade value of 0.4 seems to work best (at least for me).

Make any changes you want to the user settings in the script. When you're done save the file in the editor.

Go back to your browser, bring up a game window and click on the refresh button. At this point you will see the effect of the new script with your changes.

Good luck.

PostPosted: Thu Mar 22, 2007 12:54 am
by ClessAlvein
Also, if you get tired of seeing the 24-hour mode for when your next turn is going to be (personally I can't stand 24-hour mode), all you have to do is change

var currentTime = new Date();
var hours = currentTime.getHours();
var minutes = currentTime.getMinutes();
var day = ' @ ';

minutes = (minutes + parseInt(time[1]));
if (minutes >= 60) {
hours = hours + 1;
minutes = minutes - 60;
}

if (time[0][0] == '0')
{
time[0] = time[0][1];
}
//alert ('h:' + hours);
hours = (hours + parseInt(time[0]));
//alert ('h:' + hours);
if (hours >= 24)
{
day = "tommorow @ ";
hours = hours - 24
}
//alert ('h:' + hours);
if (minutes < 10)
minutes = "0" + minutes

var clock = day + "<b>" + hours + ":" + minutes + " " + "</b>"

to this:

var currentTime = new Date();
var hours = currentTime.getHours();
var minutes = currentTime.getMinutes();
var day = ' @ ';
var ampm = ' AM';

minutes = (minutes + parseInt(time[1]));
if (minutes >= 60) {
hours = hours + 1;
minutes = minutes - 60;
}

if (time[0][0] == '0')
{
time[0] = time[0][1];
}
//alert ('h:' + hours);
hours = (hours + parseInt(time[0]));
//alert ('h:' + hours);
if (hours >= 24)
{
day = "tommorow @ ";
hours = hours - 24
if (hours >= 12)
{
ampm = " PM";
hours = hours - 12;
}
}
if (hours >= 12)
{
ampm = " PM";
hours = hours - 12;
}
if (hours == 0)
{
hours = hours + 12;
}
//alert ('h:' + hours);
if (minutes < 10)
minutes = "0" + minutes

var clock = day + "<b>" + hours + ":" + minutes + ampm + " " + "</b>"

PostPosted: Thu Mar 22, 2007 8:07 am
by Blind Date
Twahini..and many others

Thanks!! For being so helpful and helping me (and others) with the programming!

It is a great site!

Blind Date

PostPosted: Thu Mar 22, 2007 9:27 am
by stocksr
New Version:

Hi I have just posted a new version at
http://robertstocks.co.uk/conquerClub/conquerclub-rjs.2.user.js

The version includes ClessAlvein's modification to show the time in 12 hour format AS AN OPTION, so you can now choose your own poison.

It also adds another way of identifying what belongs to whom, try moving the mouse over a player name in the list.
_________________
r.

PostPosted: Thu Mar 22, 2007 9:54 am
by tahitiwahini
stocksr wrote:It also adds another way of identifying what belongs to whom, try moving the mouse over a player name in the list.


Brilliant, love the enhancement! Thanks.

One tiny nit, please consider replacing:

Code: Select all
Line 292:              day = "tommrow @ ";

with:

Code: Select all
Line 292:                day = "<br>tomorrow @ ";

PostPosted: Thu Mar 22, 2007 10:18 am
by stocksr
tahitiwahini wrote:One tiny nit, please consider replacing:

Code: Select all
Line 292:              day = "tommrow @ ";

with:

Code: Select all
Line 292:                day = "<br>tomorrow @ ";


I have corrected the spelling (thanks) however I decided against the br because it moves the rest of the side down, which I don't like personally, but if I get enough requests I will add it in.

PostPosted: Thu Mar 22, 2007 4:49 pm
by AndrewB
stocksr wrote:New Version:

Hi I have just posted a new version at
http://robertstocks.co.uk/conquerClub/conquerclub-rjs.2.user.js

The version includes ClessAlvein's modification to show the time in 12 hour format AS AN OPTION, so you can now choose your own poison.

It also adds another way of identifying what belongs to whom, try moving the mouse over a player name in the list.
_________________
r.


Great update! One suggestion though.

Identifying what belongs to whom takes up a lot of resources on every refresh. So when I am eliminating someone, and clicking attack 100 times, it will slow down the process dramatically.

So here are my questions:

1. Can we cache it somehow? Probably not, because the armies might have been changes between those refreshes. Or maybe just cache XML? Because that AJAX call is still expensive.
2. Can we make this identification optional? So I will turn it off, when I am doing refreshes often...

Great job!

PostPosted: Thu Mar 22, 2007 5:51 pm
by artur1
Hi all, I have just installed the new one and I got it to work correctly on all maps but, the USA. I cant see tabel that provides armies, cards and so on?

PostPosted: Thu Mar 22, 2007 9:40 pm
by tahitiwahini
artur1 wrote:Hi all, I have just installed the new one and I got it to work correctly on all maps but, the USA. I cant see tabel that provides armies, cards and so on?


Take a look at that game again. Make sure the greasemonkey is red and smiling on that page. If he is, right-click and make sure the Conquer Club - Roberts Mods script is listed and checked. Finally, click the refresh icon on that page. You should see the stat table now.

The script really shouldn't have any issues with any of the maps.

Let us know what you find out.