Archive for glbscripts.myfreeforum.org Forum dedicated to Greasemonkey Scripts made for Goal Line Blitz online game.
 



       glbscripts.myfreeforum.org Forum Index -> Requests
wlarson

Show DC assignments on player page.

Could be useful in a lot of places.  Being displayed on the team roster page would help owners/GMs spot any problems with their DC.  Seems pretty simple off hand.  As an alternative to adding DC assignments to the roster page, maybe a DC summary link from the DC edit page.  Something to allow viewing the entire DC without clicking on each position.
Augie

wouldn't be able to do this.  Even if you could get it to call the function and get the data, It would cause an unbelievable server load. since it would have to re load the DC page for each position.

when you click on those tabs in the DC it runs this function

Code:
function changeTab(tab) {
172 var content = '';
173
174 var chart = positionIds[tab];
175 if (chart && chart.length) {
176 for (var i = 0; i < chart.length; i++) {
177 var player_id = chart[i];
178 var player = rosterById[player_id];
179 if (player) {
180 var template = playerTemplate('position_player_template', player);
181 content = content + template;
182 }
183 }
184 }
185 $('position_players').innerHTML = content;
186
187 $('chart_name').innerHTML = fullPositionNames[tab];
188 selectedTab = tab;
189 updateRoster();
190}


that code has to run with the depth chart page open to be able to get the respected position depth chart.
wlarson

Hmm I'm not so good at front end stuff, but can't you pull the required data from a single DC load?  When viewing the source of that page I get:

positionIds['cb'] = ['251208','90319','322117','390493','330407'];

for each position and:

roster.push({id : '261192',
name : "Trace Long",
position: 'DE',
level: 25,
height: '6\'4\"',
weight: 262,
is_cpu: 0,
assigned_positions: ['lde']});
rosterById['261192'] = roster[roster.length - 1];

for each player.

I've yet to write a greasemonkey script, but all the data is available with just one page load.  I could write a command line script to do this with 'lynx --dump'.  Gotta think it's possible with greasemonkey...

Anyways, thanks for the feedback.  I think I'll take a stab at it.  Be fun to try for my first script, regardless of the outcome.
ddcunderground

wlarson you are correct you can get the load done with one hit of the page from what I can tell. then you just have to do text assosciation. Hope it works out for you
Augie

yeah thats whats displayed, but you would need to run the actual function with the page open for the data to change.

<a onclick="changeTab('qb')" href="javascript:;">QB</a>


that is what needs to happen for the script to change the data.  I can pull the data off easily by the grabbing the whole page source and hacking it up. but only for QB.

It would not be able to use an onclick to change the page source then read it.
ddcunderground

ok here is what i am thinking hit the dc page build and array for each player and assigned positions and build a second array for depth position loop through each player on roster page and make addition of depth position per arrays.
ddcunderground

Ok I now have it working for the team roster page for both owner/Gms and non owners. Working on getting it for player page once that is done will post
ddcunderground

ok so now it works for both players pages and for team roster. It only takes one hit to the DC page to get all the teams info. So let me know if you wanted anything different.
http://userscripts.org/scripts/show/34347
ddcunderground

also added button on dc page for list view of dc

       glbscripts.myfreeforum.org Forum Index -> Requests
Page 1 of 1
Create your own free forum | Buy a domain to use with your forum