army and territory count bookmarklet

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

Moderators: Beta Team, Tech Team, Global Moderators

Forum rules
Please read the Community Guidelines before posting.

army and territory count bookmarklet

Postby registered_user on Sat Sep 29, 2007 8:42 pm

Here's a quick bookmarklet script that may or may not be useful to you folks. I keep it in my bookmarks bar. Basically, you hit the bookmarklet, and the browser shows an alert that contains the players' names and how many armies and territories they have.

To use it, you create a bookmark and change the URL to this:

Code: Select all
javascript:var np=document.getElementById("players").getElementsByTagName("li").length;var te=new Array();var ar=new Array();var players=new Array();var skip=0;for(var i=0;i<np;i++){te[i]=0;ar[i]=0;var s=document.getElementById("players").getElementsByTagName("li")[i].getElementsByTagName("a")[0]; if(s){players.push(s.getElementsByTagName("span")[0].innerHTML);}else{skip++;}}np=np-skip;var aa=document.getElementById('armies').innerHTML.split(',');for(var i=0;i<aa.length;i++){var seg=aa[i].split("-");ar[seg[0]-1]=(ar[seg[0]-1]*1)+(seg[1]*1);te[seg[0]-1]++;}var output="There are "+np+" players\n---------------\n";for(var i=0;i<np;i++){output+=players[i]+"\n\tTotal Armies: "+ar[i]+"\n\tTotal Territories: "+te[i]+"\n\n";}alert(output);



It's not terribly exciting, and it may have been done before. I hope y'all find it useful. I tested in Safari 2 and Firefox 2.

enjoy.

edit: fixed the script to work in team games.
edit2: conflicted with the attack to drop-down, so I adjusted it, and I removed whitespace and shortened variable names.
Last edited by registered_user on Sun Sep 30, 2007 11:24 am, edited 2 times in total.
Major registered_user
 
Posts: 22
Joined: Sat Sep 08, 2007 8:50 pm
Location: Providence, RI
Medals: 4
Standard Achievement (1) Doubles Achievement (1) General Contribution (2)

Postby gimil on Sat Sep 29, 2007 8:47 pm

if you use firefox theres a script that give these states on the in game window.

but its the thought that counts buddy :wink:

may be usful for those people who dont use FF
What do you know about map making, bitch?

natty_dread wrote:I was wrong


Top Score:2403
User avatar
Corporal 1st Class gimil
 
Posts: 8605
Joined: Sat Mar 03, 2007 12:42 pm
Location: United Kingdom (Scotland)
Medals: 39
Standard Achievement (3) Doubles Achievement (2) Triples Achievement (2) Quadruples Achievement (2) Terminator Achievement (2)
Assassin Achievement (1) Freestyle Achievement (3) Fog of War Achievement (2) Speed Achievement (3) Teammate Achievement (2)
Cross-Map Achievement (2) Ratings Achievement (2) Map Contribution (7) Tournament Contribution (1) General Contribution (5)

Postby registered_user on Sat Sep 29, 2007 8:56 pm

I also just noticed that it doesn't work in team games. It seems that the headlines are list items like the players. Oh well, it's not perfect. edit: fixed -- it now works in team games.

And yes, I've seen the FF add-ons. But I don't like Firefox, and when I do use it, I don't have any real use for Greasemonkey, so I'd just as soon keep the add-ons simple. :)
Last edited by registered_user on Sat Sep 29, 2007 9:34 pm, edited 1 time in total.
Major registered_user
 
Posts: 22
Joined: Sat Sep 08, 2007 8:50 pm
Location: Providence, RI
Medals: 4
Standard Achievement (1) Doubles Achievement (1) General Contribution (2)

Postby PerkinsRooster on Sat Sep 29, 2007 8:56 pm

gimil wrote:
may be usful for those people who dont use FF


or those who use ajax like me
Let's golf.
Major PerkinsRooster
 
Posts: 89
Joined: Wed Feb 21, 2007 11:05 pm
Location: Canada
Medals: 12
Standard Achievement (3) Doubles Achievement (1) Triples Achievement (2) Fog of War Achievement (1) Speed Achievement (1)
Teammate Achievement (1) Ratings Achievement (3)

Postby registered_user on Sat Sep 29, 2007 9:34 pm

I hope you find it useful, Perkins.

Also, I just edited the original post. I fixed the script so that it works in team games.
Major registered_user
 
Posts: 22
Joined: Sat Sep 08, 2007 8:50 pm
Location: Providence, RI
Medals: 4
Standard Achievement (1) Doubles Achievement (1) General Contribution (2)

Postby philh on Sun Sep 30, 2007 6:28 am

Works in Opera 9.2 as well.
Major philh
 
Posts: 85
Joined: Sat Jan 20, 2007 6:30 am
Medals: 11
Standard Achievement (1) Doubles Achievement (1) Triples Achievement (1) Terminator Achievement (1) Freestyle Achievement (1)
Fog of War Achievement (1) Ratings Achievement (1) Tournament Achievement (1) Tournament Contribution (1) General Contribution (2)

Re: army and territory count bookmarklet

Postby psaxnoulis on Sat May 03, 2008 2:18 pm

Thanx, man! Saves you from counting... And fatal mistakes...
User avatar
Major psaxnoulis
 
Posts: 10
Joined: Wed Mar 19, 2008 5:27 am
Location: Athens, Greece
Medals: 14
Standard Achievement (4) Doubles Achievement (2) Nuclear Spoils Achievement (1) Trench Warfare Achievement (1) Cross-Map Achievement (3)
Ratings Achievement (2) Tournament Achievement (1)

Re: army and territory count bookmarklet

Postby registered_user on Mon Jun 09, 2008 6:35 pm

Hey! Does this count towards a Special Contribution medal?

::begs for hand out::
Major registered_user
 
Posts: 22
Joined: Sat Sep 08, 2007 8:50 pm
Location: Providence, RI
Medals: 4
Standard Achievement (1) Doubles Achievement (1) General Contribution (2)

Re: army and territory count bookmarklet

Postby t-o-m on Sat Jun 14, 2008 4:54 pm

i dont get this?
Colonel t-o-m
 
Posts: 2824
Joined: Sat Mar 22, 2008 2:22 pm
Location: Redistributing wealth
Medals: 39
Standard Achievement (3) Doubles Achievement (3) Triples Achievement (2) Quadruples Achievement (1) Terminator Achievement (1)
Assassin Achievement (2) Manual Troops Achievement (2) Freestyle Achievement (3) Fog of War Achievement (3) Speed Achievement (3)
Teammate Achievement (2) Cross-Map Achievement (2) Ratings Achievement (3) Tournament Achievement (1) General Achievement (1)
Clan Achievement (2) Map Contribution (1) Tournament Contribution (3) General Contribution (1)

Re: army and territory count bookmarklet

Postby gdeangel on Sat Jun 14, 2008 4:55 pm

t-o-m wrote:i dont get this?

It seems to be a poor mans version of BoB... probably for people who don't have firefox / grease monkey.

I haven't tried it...
My ever constant two last games seem to have no end in sight!
User avatar
Sergeant gdeangel
 
Posts: 779
Joined: Mon Jan 14, 2008 11:48 pm
Location: In the Basement
Medals: 12
Standard Achievement (2) Doubles Achievement (1) Triples Achievement (1) Quadruples Achievement (1) Speed Achievement (1)
Cross-Map Achievement (1) Ratings Achievement (1) Tournament Achievement (1) Clan Achievement (1) Tournament Contribution (2)

Re: army and territory count bookmarklet

Postby psaxnoulis on Sat Oct 10, 2009 5:25 am

just installed on firefox 3.5.3 - works ok
User avatar
Major psaxnoulis
 
Posts: 10
Joined: Wed Mar 19, 2008 5:27 am
Location: Athens, Greece
Medals: 14
Standard Achievement (4) Doubles Achievement (2) Nuclear Spoils Achievement (1) Trench Warfare Achievement (1) Cross-Map Achievement (3)
Ratings Achievement (2) Tournament Achievement (1)

Re: army and territory count bookmarklet

Postby Calidrmr on Tue Aug 16, 2011 11:47 am

moved to archives by Calidrmr
reason: over 1 year since last post, appears obsolete
shadow topic left for 72 hours
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.
User avatar
Lieutenant Calidrmr
 
Posts: 640
Joined: Wed Sep 12, 2007 5:00 pm
Location: the corner bar...
Medals: 61
Standard Achievement (2) Doubles Achievement (3) Triples Achievement (3) Quadruples Achievement (3) Terminator Achievement (1)
Assassin Achievement (1) Manual Troops Achievement (1) Freestyle Achievement (1) Nuclear Spoils Achievement (1) Fog of War Achievement (3)
Speed Achievement (1) Teammate Achievement (2) Random Map Achievement (1) Cross-Map Achievement (3) Ratings Achievement (3)
Tournament Achievement (1) General Achievement (10) Clan Achievement (5) Training Achievement (1) General Contribution (15)


Return to Tool Archives

Who is online

Users browsing this forum: No registered users

cron
Login