anyone have it?
Forum > FAQ's, Player Guides and Newbie Help > cut CPU script
HighRoller74
offline
offline
// ==UserScript==
// @name GLB Cut CPU Players - pabst fix
// @namespace GLB
// @description Cuts CPU players to the minimum
// @author DDCUnderground
// @include http://goallineblitz.com/game/roster.pl?team_id=*
// @include http://glb.warriorgeneral.com/game/roster.pl?team_id=*
// @require http://code.jquery.com/jquery-1.4.2.min.js
// @version 14.02.26-pabst
// ==/UserScript==
//
$(document).ready(function(){
// functions
var buildobj = function(a){
var newobj = document.createElement(arguments[0]);
for (var varval = 1; varval < arguments.length; varval++) {
newobj.setAttribute(arguments[varval],arguments[varval+1]);
varval++;
};
return newobj;
};
function cutAllCPUS(){
$('#ddccutcpus').attr('value','Working');
$('#ddccutcpus').attr("disabled", "true");
$('tr[class="alternating_color1"],tr[class="alternating_color2"]').each(function(z){
//if (z<2) {
if ($('span[class="cpu"]',$(this)).length > 0) {
var playerid = $('a[href*="/game/player.pl?player_id="]',$(this)).attr('href');
playerid = playerid.substring(playerid.indexOf('player_id=')+10,playerid.length);
var upgradeData = 'action=Confirm Release&&player_id=' + playerid;
$.ajax({
async: false,
type: 'POST',
url: "/game/cut_player.pl?player_id="+playerid,
data: encodeURI(upgradeData),
success: function(returned_data) {
}
})
}
//}
})
window.location.reload();
}
var cutcpusbut = buildobj('input','type','button','id','ddccutcpus','Value','Cut CPUs');
var linebreak = buildobj('br');
$('.medium_head:first').append(linebreak);
$('.medium_head:first').append(cutcpusbut);
$('#ddccutcpus').bind('click',cutAllCPUS, false);
})
// @name GLB Cut CPU Players - pabst fix
// @namespace GLB
// @description Cuts CPU players to the minimum
// @author DDCUnderground
// @include http://goallineblitz.com/game/roster.pl?team_id=*
// @include http://glb.warriorgeneral.com/game/roster.pl?team_id=*
// @require http://code.jquery.com/jquery-1.4.2.min.js
// @version 14.02.26-pabst
// ==/UserScript==
//
$(document).ready(function(){
// functions
var buildobj = function(a){
var newobj = document.createElement(arguments[0]);
for (var varval = 1; varval < arguments.length; varval++) {
newobj.setAttribute(arguments[varval],arguments[varval+1]);
varval++;
};
return newobj;
};
function cutAllCPUS(){
$('#ddccutcpus').attr('value','Working');
$('#ddccutcpus').attr("disabled", "true");
$('tr[class="alternating_color1"],tr[class="alternating_color2"]').each(function(z){
//if (z<2) {
if ($('span[class="cpu"]',$(this)).length > 0) {
var playerid = $('a[href*="/game/player.pl?player_id="]',$(this)).attr('href');
playerid = playerid.substring(playerid.indexOf('player_id=')+10,playerid.length);
var upgradeData = 'action=Confirm Release&&player_id=' + playerid;
$.ajax({
async: false,
type: 'POST',
url: "/game/cut_player.pl?player_id="+playerid,
data: encodeURI(upgradeData),
success: function(returned_data) {
}
})
}
//}
})
window.location.reload();
}
var cutcpusbut = buildobj('input','type','button','id','ddccutcpus','Value','Cut CPUs');
var linebreak = buildobj('br');
$('.medium_head:first').append(linebreak);
$('.medium_head:first').append(cutcpusbut);
$('#ddccutcpus').bind('click',cutAllCPUS, false);
})
Do I have to edit the highlighted parts with my own stuff or does it do it automatically when I go to different team pages
Originally posted by ProfessionalKop
Do I have to edit the highlighted parts with my own stuff or does it do it automatically when I go to different team pages
Do you use Tampermonkey?
If so just click on the tampermonkey icon, create new script, paste what highroller put up there, and save.
Do I have to edit the highlighted parts with my own stuff or does it do it automatically when I go to different team pages
Do you use Tampermonkey?
If so just click on the tampermonkey icon, create new script, paste what highroller put up there, and save.
Originally posted by .spider.
Do you use Tampermonkey?
If so just click on the tampermonkey icon, create new script, paste what highroller put up there, and save.
OK got it. Wipe out all of original new script and insert all of above.
Thanks
Do you use Tampermonkey?
If so just click on the tampermonkey icon, create new script, paste what highroller put up there, and save.
OK got it. Wipe out all of original new script and insert all of above.
Thanks
Edited by madmal on Jun 18, 2019 11:01:42
Originally posted by madmal
OK got it. Wipe out all of original new script and insert all of above.
Thanks
yeah, sorry, thought that was assumed....
OK got it. Wipe out all of original new script and insert all of above.
Thanks
yeah, sorry, thought that was assumed....
Originally posted by .spider.
yeah, sorry, thought that was assumed....
Yes at first I didn't notice the top part was duplicated.
yeah, sorry, thought that was assumed....
Yes at first I didn't notice the top part was duplicated.
Originally posted by ProfessionalKop
nvm. worked. im just dumb .ty
also assumed
nvm. worked. im just dumb .ty
also assumed
You are not logged in. Please log in if you want to post a reply.