Conquer Club

BOB version 1.2 [was CC Greasemonkey script - unofficial]

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.

What should the name of this script be?

Poll ended at Fri May 18, 2007 5:51 am

Bob
11
28%
TSAR
7
18%
TSAR BOMBA
6
15%
B.O.M.B.
5
13%
Trojan
1
3%
Trojan Horse
9
23%
 
Total votes : 39

Postby tahitiwahini on Mon May 28, 2007 8:14 pm

weirdbro wrote:It still gets cards from the log? I thought it switched to just reading from what CC says now that it was added.


You may be right about that bro.

But now I'm even more puzzled. Here's why:

2007-05-28 14:58:30 - Game has been initialized
2007-05-28 15:01:54 - mushyman18 gets a card
2007-05-28 15:04:44 - Incrementing game to round 2
2007-05-28 15:05:36 - mushyman18 gets a card
2007-05-28 15:07:02 - Incrementing game to round 3


So when the snapshot was taken prior to the beginning of round 3, red would have had 2 cards, which is confirmed by the number of cards listed next to red in the player roster.

So, something pretty strange went on there.

stocksr might have some ideas, but I'm pretty much stumped.
Cheers,
Tahitiwahini
User avatar
Private 1st Class tahitiwahini
 
Posts: 964
Joined: Fri Jan 19, 2007 5:26 pm

Postby tahitiwahini on Mon May 28, 2007 8:46 pm

Ok, having thought about it a little more here's what I think happened:

You were right bro, stocksr seems to be getting the number of cards held by player by parsing the information contained in the player roster to the right of the map.

A snippet of the code staring from line 703:

Code: Select all
  /*--- Get Player Card Counts ---*/
    var tmp2 = getElementsByClassName(rightside,"li","status");   
    for ( i in tmp2 )
    {
        var tmp3 = tmp2[i].textContent.split(/\W/);
        pl[pIndxs[i].innerHTML]._cards=parseInt(tmp3[1]);
    }


This is how the number of cards held are being parsed. But this is an assassin game, and it just so happens that your (The1exile) target is red. So there is a target symbol (crossthreads) there that would under normal circumstances not be there. The tmp3[1] item must be the target symbol (crossthreads) which cannot be converted into a number (yet is considered a word character), hence the number of cards held by the red player is set to NaN (Not a Number, the result of attempting to convert something that isn't a number into a number). So in the statistics table the red player's cards are listed as NaN and the Card Set Estimate will be -3 when the number of cards held by a player is NaN. Also it explains why at the end of the game the statistics table is correct, because at that point the target symbol is removed from the player roster because at that point in time the game is over.

I guess the quickest fix is simply to insert the following lines:

Code: Select all
   if (isNaN(pl[pIndxs[i].innerHTML]._cards)) {
       pl[pIndxs[i].innerHTML]._cards = parseInt(tmp3[2]);
   }


thusly:

Code: Select all
  /*--- Get Player Card Counts ---*/
    var tmp2 = getElementsByClassName(rightside,"li","status");   
    for ( i in tmp2 )
    {
        var tmp3 = tmp2[i].textContent.split(/\W/);
        pl[pIndxs[i].innerHTML]._cards=parseInt(tmp3[1]);
        if (isNaN(pl[pIndxs[i].innerHTML]._cards)) {
           pl[pIndxs[i].innerHTML]._cards = parseInt(tmp3[2]);
        }
    }


Of course, the only way to test this is to start an assassin game and see that your target's cards held is being calculated correctly.

[Update] The proposed fix has been tested and seems to work.
Cheers,
Tahitiwahini
User avatar
Private 1st Class tahitiwahini
 
Posts: 964
Joined: Fri Jan 19, 2007 5:26 pm

Postby haoala on Tue May 29, 2007 1:01 am

haoala wrote:i just realised a BIG BIG GLITCH with this thing
since lack introduced the new rule where if someone deadbeats in a team, the troops and cards will be given to the next guy.
but this isnt counted in the script, and it becomes inaccurate
will somebody fix this?
Gain the upper hand
User avatar
Lieutenant haoala
 
Posts: 295
Joined: Tue Feb 27, 2007 7:58 am
Location: Directly opposite the South of Napo

Postby yeti_c on Tue May 29, 2007 3:03 am

Tahiti,

Rob knows about the Assassin bug - and has a fix for it...

It will be in the next release...

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am

Postby stocksr on Tue May 29, 2007 7:05 am

yeti_c wrote:Tahiti,

Rob knows about the Assassin bug - and has a fix for it...

It will be in the next release...

C.


Which will be out some time in the next few days real life permitting.
r.
User avatar
Corporal stocksr
 
Posts: 132
Joined: Wed Mar 07, 2007 11:30 am
Location: South Coast, UK

Postby stocksr on Tue May 29, 2007 7:12 am

haoala wrote:
haoala wrote:i just realised a BIG BIG GLITCH with this thing
since lack introduced the new rule where if someone deadbeats in a team, the troops and cards will be given to the next guy.
but this isnt counted in the script, and it becomes inaccurate
will somebody fix this?


Hi Haoala, Do you have a game number we can check out, the script should work just fine, as we simply read the card and army counts from the page.

However please check that you are running the latest version as earlier version work differently and would have problems in this situation.
r.
User avatar
Corporal stocksr
 
Posts: 132
Joined: Wed Mar 07, 2007 11:30 am
Location: South Coast, UK

Postby Sparqs on Tue May 29, 2007 7:22 pm

Fantastic script! Thanks to stocksr, et al. <applauds>


I see that you are about to release BOB so it might be a bit late, but a few suggestions:

Remember custom fade setting for each map
The fade is great, but I need more fade on some maps to make them readable than I need on others.

Click fills-in Attacker/Defender
It would be nice if clicking on a country filled in the appropriate select box, saving me from choosing from the list.

Toggle stats and text map
When examining the log to determine what happened, referring back to the map is made more difficult by the stats and text map. Rather than click through various modes and waiting for redraw, it would really help to twiddle a control and hide those displays temporarily. As a workaround, an option to switch the log between it's current position and above stats would suffice.


Again, thanks to all for such a great script. It took no time at all to see how useful it is. If it's too late and/or difficult to get changes into BOB, I may try to add some of this myself. It looks like a good excuse to learn Greasemonkey.
User avatar
Sergeant Sparqs
 
Posts: 173
Joined: Tue May 29, 2007 5:52 am

Postby haoala on Tue May 29, 2007 9:43 pm

stocksr wrote:
haoala wrote:
haoala wrote:i just realised a BIG BIG GLITCH with this thing
since lack introduced the new rule where if someone deadbeats in a team, the troops and cards will be given to the next guy.
but this isnt counted in the script, and it becomes inaccurate
will somebody fix this?


Hi Haoala, Do you have a game number we can check out, the script should work just fine, as we simply read the card and army counts from the page.

However please check that you are running the latest version as earlier version work differently and would have problems in this situation.


http://www.conquerclub.com/game.php?game=448378

the games ended, but it still shows the wrong number of cards
Gain the upper hand
User avatar
Lieutenant haoala
 
Posts: 295
Joined: Tue Feb 27, 2007 7:58 am
Location: Directly opposite the South of Napo

Postby haoala on Tue May 29, 2007 9:46 pm

sorry!!!
i seemed to be using an older version
but now its ok
thanks
and sorry for wasting your time
Gain the upper hand
User avatar
Lieutenant haoala
 
Posts: 295
Joined: Tue Feb 27, 2007 7:58 am
Location: Directly opposite the South of Napo

Postby tahitiwahini on Tue May 29, 2007 9:48 pm

haoala wrote:
stocksr wrote:
haoala wrote:
haoala wrote:i just realised a BIG BIG GLITCH with this thing
since lack introduced the new rule where if someone deadbeats in a team, the troops and cards will be given to the next guy.
but this isnt counted in the script, and it becomes inaccurate
will somebody fix this?


Hi Haoala, Do you have a game number we can check out, the script should work just fine, as we simply read the card and army counts from the page.

However please check that you are running the latest version as earlier version work differently and would have problems in this situation.


http://www.conquerclub.com/game.php?game=448378

the games ended, but it still shows the wrong number of cards


When I went to look at the game both the BOB statistics and the player roster show the same number of cards for each player. How is it wrong? What should the number of cards each player holds be?
Cheers,
Tahitiwahini
User avatar
Private 1st Class tahitiwahini
 
Posts: 964
Joined: Fri Jan 19, 2007 5:26 pm

Postby haoala on Tue May 29, 2007 9:50 pm

i already said, my bad
Gain the upper hand
User avatar
Lieutenant haoala
 
Posts: 295
Joined: Tue Feb 27, 2007 7:58 am
Location: Directly opposite the South of Napo

Postby tahitiwahini on Tue May 29, 2007 10:47 pm

haoala wrote:i already said, my bad


No problem, I was fastposted.
Cheers,
Tahitiwahini
User avatar
Private 1st Class tahitiwahini
 
Posts: 964
Joined: Fri Jan 19, 2007 5:26 pm

Postby g. on Wed May 30, 2007 4:10 am

great script!!

suggestion: I think it would be nice to have also "data from last round" or "changes since last round" visible in the table with all the player stats. like that it would be easier to follow changes without reading the whole Game Log.

/g.
Corporal 1st Class g.
 
Posts: 11
Joined: Mon Mar 12, 2007 11:16 am

Postby stocksr on Wed May 30, 2007 5:15 am

Sparqs wrote:Fantastic script! Thanks to stocksr, et al. <applauds>


I see that you are about to release BOB so it might be a bit late, but a few suggestions:

Remember custom fade setting for each map
The fade is great, but I need more fade on some maps to make them readable than I need on others.

Click fills-in Attacker/Defender
It would be nice if clicking on a country filled in the appropriate select box, saving me from choosing from the list.

Toggle stats and text map
When examining the log to determine what happened, referring back to the map is made more difficult by the stats and text map. Rather than click through various modes and waiting for redraw, it would really help to twiddle a control and hide those displays temporarily. As a workaround, an option to switch the log between it's current position and above stats would suffice.


Again, thanks to all for such a great script. It took no time at all to see how useful it is. If it's too late and/or difficult to get changes into BOB, I may try to add some of this myself. It looks like a good excuse to learn Greasemonkey.


Hi Sparqs,

Thanks for the ideas, you are correct that it is a bit late to get theses suggestions into BOB v1.0 however I have added them to the ideas pile, and will see what I can do for BOB v1.1, if you want to work on them yourself then you are more than welcome, however I do suggest that you wait for BOB v1.0 (next couple of days I promise) as there are a few significant changes to the code which could cause problems if/when we try and re integrate the two branches.
r.
User avatar
Corporal stocksr
 
Posts: 132
Joined: Wed Mar 07, 2007 11:30 am
Location: South Coast, UK

Postby stocksr on Wed May 30, 2007 5:20 am

g. wrote:great script!!

suggestion: I think it would be nice to have also "data from last round" or "changes since last round" visible in the table with all the player stats. like that it would be easier to follow changes without reading the whole Game Log.

/g.


Hi g.

I like what you are suggesting however given the current game log, there is not actually enough information available to do this, for example there is no way to work out how many armies were on each territory at any given point except the current situation.
r.
User avatar
Corporal stocksr
 
Posts: 132
Joined: Wed Mar 07, 2007 11:30 am
Location: South Coast, UK

Latest Site Changes

Postby stocksr on Wed May 30, 2007 5:22 am

Hi, has anybody noticed any problems since the latest update to the site? if so please let me know the game number. Thanks
r.
User avatar
Corporal stocksr
 
Posts: 132
Joined: Wed Mar 07, 2007 11:30 am
Location: South Coast, UK

Postby Tubby Rower on Wed May 30, 2007 5:42 am

the only thing is that I can't see anyone's new ranks unless I turn off the script.
User avatar
Sergeant 1st Class Tubby Rower
 
Posts: 349
Joined: Wed Mar 22, 2006 8:36 am
Location: under a rolling pin

Postby Selin on Wed May 30, 2007 5:48 am

same with me
Brigadier Selin
 
Posts: 1100
Joined: Wed Oct 04, 2006 7:56 am
Location: Istanbul, Turkey

Postby Tubby Rower on Wed May 30, 2007 5:54 am

it's working now :?: at least for me.
User avatar
Sergeant 1st Class Tubby Rower
 
Posts: 349
Joined: Wed Mar 22, 2006 8:36 am
Location: under a rolling pin

Postby cicero on Thu May 31, 2007 1:42 am

Tubby Rower wrote:the only thing is that I can't see anyone's new ranks unless I turn off the script.


As you/Selin have probably discovered by now you just need to refresh(F5) your browser.

The missing icons are nothing to do with BOB.

Cicero
FREE M-E-Mbership and simple rules. Conquer Club - it's not complicated.

random me statistic @ 13 December 2008 - 1336 posts : 232nd most public posts (not counting Tower of Babble) of all time.
User avatar
Sergeant cicero
 
Posts: 1358
Joined: Wed Mar 07, 2007 1:51 pm
Location: with the infected neutrals ... handing out maps to help them find their way to CC

Postby pancakemix on Fri Jun 01, 2007 6:42 pm

I'm having a problem.

The script isn't working. I've had it installed for a while now, but it just disappeared. It's not on my list of installed scripts and when I try to reinstall it, it says it's already installed.
Epic Win

"Always tell the truth. It's the easiest thing to remember." - Richard Roma, Glengarry Glen Ross

aage wrote:Never trust CYOC or pancake.
User avatar
Corporal 1st Class pancakemix
 
Posts: 7973
Joined: Wed Jan 31, 2007 3:39 pm
Location: The Grim Guzzler

Postby tahitiwahini on Fri Jun 01, 2007 8:10 pm

pancakemix wrote:I'm having a problem.

The script isn't working. I've had it installed for a while now, but it just disappeared. It's not on my list of installed scripts and when I try to reinstall it, it says it's already installed.


Try this:

http://www.conquerclub.com/forum/viewtopic.php?t=15255
Cheers,
Tahitiwahini
User avatar
Private 1st Class tahitiwahini
 
Posts: 964
Joined: Fri Jan 19, 2007 5:26 pm

Postby pancakemix on Fri Jun 01, 2007 8:47 pm

tahitiwahini wrote:
pancakemix wrote:I'm having a problem.

The script isn't working. I've had it installed for a while now, but it just disappeared. It's not on my list of installed scripts and when I try to reinstall it, it says it's already installed.


Try this:

http://www.conquerclub.com/forum/viewtopic.php?t=15255


This doesn't quite address the problem. It's just not there and I can't reinstall it as it won't uninstall because it's not there.
Epic Win

"Always tell the truth. It's the easiest thing to remember." - Richard Roma, Glengarry Glen Ross

aage wrote:Never trust CYOC or pancake.
User avatar
Corporal 1st Class pancakemix
 
Posts: 7973
Joined: Wed Jan 31, 2007 3:39 pm
Location: The Grim Guzzler

Postby stocksr on Sat Jun 02, 2007 2:35 am

pancakemix wrote:I'm having a problem.

The script isn't working. I've had it installed for a while now, but it just disappeared. It's not on my list of installed scripts and when I try to reinstall it, it says it's already installed.


This is a known bug in greasemonkey, you will need to delete the script file from your profile folder manually, I am posting from my phone or I would provide detailed instructions
r.
User avatar
Corporal stocksr
 
Posts: 132
Joined: Wed Mar 07, 2007 11:30 am
Location: South Coast, UK

Postby yeti_c on Sat Jun 02, 2007 3:20 am

stocksr wrote:
pancakemix wrote:I'm having a problem.

The script isn't working. I've had it installed for a while now, but it just disappeared. It's not on my list of installed scripts and when I try to reinstall it, it says it's already installed.


This is a known bug in greasemonkey, you will need to delete the script file from your profile folder manually, I am posting from my phone or I would provide detailed instructions


Now there is dedication... Hang on - I'll help...

Scripts will be located in the following folder...

C:\Documents and Settings\Chris\Application Data\Mozilla\Firefox\Profiles\cdheyiiz.default\gm_scripts

(Modify for your username on your PC)

Delete them from there and hey presto...

C.
Image
Highest score : 2297
User avatar
Lieutenant yeti_c
 
Posts: 9624
Joined: Thu Jan 04, 2007 9:02 am

PreviousNext

Return to Tool Archives

Who is online

Users browsing this forum: No registered users