apranik

New Member
Reaction score
2
Author
tcamps
Contributors
apranik
Quickbar Entry
javascript:
var WCS = {
troops: [
{axe: 40, ram: 4, spy: 1}, // lvl 1
{axe: 50, ram: 7, spy: 1}, // lvl 2
{axe: 50, ram: 10, spy: 1}, // lvl 3
{axe: 80, ram: 16, spy: 1}, // lvl 4
{axe: 120, ram: 20, spy: 1}, // lvl 5
{axe: 160, ram: 25, spy: 1}, // lvl 6
{axe: 400, ram: 50, spy: 1} // lvl 7+
],
urlCount: 15, // How many tabs to open
newTabWait: 400, // Milliseconds between tabs
ramGreens: true, // Ram walls even if there were no losses
};
(() => {
if (window.location.href.indexOf("am_farm") < 0) {
alert('Run this on the Loot Assistant page!');
}
console.log('Extracting village info');

let urls = [];

$('#plunder_list')
.find('tr')
.filter((i, el) => $(el).attr('id'))
.each((i, el) => {
var wallLevel = $(el).find('td:nth-of-type(7)').text();
var iconUrl = $(el).find('td:nth-of-type(2) img').attr('src');
if (wallLevel < 1 || (!WCS.ramGreens && iconUrl.indexOf('green.png') >= 0)) {
return;
}

var id = $(el).attr('id').match(/(\d+)/)[1];
console.log('Found village ' + id);

var cv = /village=(\w+)/.exec(window.location.href)[1];
var rp = `/game.php?village=${cv}&screen=place&target=${id}`;
var troops = wallLevel <= WCS.troops.length ? WCS.troops[wallLevel - 1] : WCS.troops[WCS.troops.length - 1]
var tpParams = Object.keys(troops).map(u => `${u}=${troops[u]}`).join('&')
urls.push(`${rp}&${tpParams}`);
});

console.log('Made URLs: ', urls)

urls = urls.slice(0, WCS.urlCount);

urls.forEach((url, i) => setTimeout(() => window.open(url, '_blank'), i * WCS.newTabWait));
})();
void(0);
Public?
Public
This is the same as https://forum.tribalwars.net/index.php?threads/clear-barbarian-walls.280874/ with small modifications, but I wanted to make sure it's still legal.

The modifications are:
1. The old script runs everything twice (I think the original author might have missed that in the code after he fixed something). So I removed it to just run once.
2. I added a little bit of configuration to add the unit counts to the url that gets opened. Basically, it was opening /game.php?village=<village>&screen=place&target=<target>, now it opens /game.php?village=<village>&screen=place&target=<target>&spy=X&rams=Y&axe=Z based on the configs.
3. The previous script only cleared walls if the report had a loss, this allows configuration to also clear walls on greens if you want.

The script is pretty small, so it can be put directly into the quickbar.
 
Upvote 0

togabriel

New Member
Reaction score
2
Do not work, don't do anything for me, i try on .uk server, i don't know if that can be the reason
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
697
Do not work, don't do anything for me, i try on .uk server, i don't know if that can be the reason
Before using .net approved scripts on other markets make sure that these scripts are approved on those markets. Read the script rules on that specific market and check the approved scripts list on that market to make sure this one is on that list.
 

Arteezy

Well-Known Member
Reaction score
77
It opens the tabs but does not input the troop numbers for me. Any idea how to fix ?
 
Reaction score
0
This is the best barb wall script for me.

But ramGreens is not very convenient for me, if true it opens all green villages in a row if they don't have a scout report, and if false it doesn't send rams to green reports.
If added a check for report "wallLevel == '?'" with "ramGreens: true" then everything will work great for me.
I hope this script gets moved to the media server.

It opens the tabs but does not input the troop numbers for me. Any idea how to fix ?
Try copying from here.

Code:
IT IS NOT ALLOWED TO SHARE SCRIPTS LEFT AND RIGHT IF MODIFIED, EVEN IF THEY ARE MODIFICATIONS OF APPROVED SCRIPTS. IF YOU GOT A SCRIPT, SEND IT FOR APPROVAL THEN IT CAN BE SHARED LEFT AND RIGHT
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
697
This is the best barb wall script for me.

But ramGreens is not very convenient for me, if true it opens all green villages in a row if they don't have a scout report, and if false it doesn't send rams to green reports.
If added a check for report "wallLevel == '?'" with "ramGreens: true" then everything will work great for me.
I hope this script gets moved to the media server.


Try copying from here.

Code:
IT IS NOT ALLOWED TO SHARE SCRIPTS LEFT AND RIGHT IF MODIFIED, EVEN IF THEY ARE MODIFICATIONS OF APPROVED SCRIPTS. IF YOU GOT A SCRIPT, SEND IT FOR APPROVAL THEN IT CAN BE SHARED LEFT AND RIGHT
FYI @Eddy-Wan Kenobi ,

The script you shared has been removed and I added a notice on the "code" you shared.
 
Reaction score
0
FYI @Eddy-Wan Kenobi ,

The script you shared has been removed and I added a notice on the "code" you shared.
These are your own rules, aren't they?

"Script updates should not be used to clone an already approved script in order to implement minor alterations and adjustments, as this would inevitably lead to an unmanageable number of scripts."

"Please be aware that all updates and/or alterations to an approved script also need to be approved as even slight changes may make a script illegal! The exception to this are changes to script logic (eg. dividing by 10 instead of 100, using axes instead of swords, etc)."

My change is included in the exceptions. The village selection logic is changed and all villages without reports are skipped.

It seems to me that your “text” is against your own rules.
"IT IS NOT ALLOWED TO SHARE SCRIPTS LEFT AND RIGHT IF MODIFIED, EVEN IF THEY ARE MODIFICATIONS OF APPROVED SCRIPTS. IF YOU GOT A SCRIPT, SEND IT FOR APPROVAL THEN IT CAN BE SHARED LEFT AND RIGHT"
 

RedAlert

Senior In-Game Staff
Tribal Wars Team
Senior
Team
Script Moderator
Reaction score
697
These are your own rules, aren't they?

"Script updates should not be used to clone an already approved script in order to implement minor alterations and adjustments, as this would inevitably lead to an unmanageable number of scripts."

"Please be aware that all updates and/or alterations to an approved script also need to be approved as even slight changes may make a script illegal! The exception to this are changes to script logic (eg. dividing by 10 instead of 100, using axes instead of swords, etc)."

My change is included in the exceptions. The village selection logic is changed and all villages without reports are skipped.

It seems to me that your “text” is against your own rules.
"IT IS NOT ALLOWED TO SHARE SCRIPTS LEFT AND RIGHT IF MODIFIED, EVEN IF THEY ARE MODIFICATIONS OF APPROVED SCRIPTS. IF YOU GOT A SCRIPT, SEND IT FOR APPROVAL THEN IT CAN BE SHARED LEFT AND RIGHT"
Thank you, but no, not my rules because as much as I wish I could make rules, I can't.

When I checked the script you had shared, I checked it from mobile, and it looked like it was a different script logic. That's why I modified what you had shared.

However, if the only thing that changes is indeed troop amounts, sure, that is okay and can be shared and yes, that would not require approval for this script, if other logic is changed IT DOES NOT FIT into that exception.

That "auto-approved" rule is there mostly for scripts which are used as fake scripts. So players can modify values on fake scripts, can modify coordinates and can modify unit amounts, without having to approve any single fake script. However, every other change on a script, even a fake script, every other logical change on a fake script, does not make it auto-approvable.
 
Last edited:
Reaction score
0
Thank you, but no, not my rules because as much as I wish I could make rules, I can't.

When I checked the script you had shared, I checked it from mobile, and it looked like it was a different script logic. That's why I modified what you had shared.

However, if the only thing that changes is indeed troop amounts, sure, that is okay and can be shared and yes, that would not require approval for this script, if other logic is changed IT DOES NOT FIT into that exception.

That "auto-approved" rule is there mostly for scripts which are used as fake scripts. So players can modify values on fake scripts, can modify coordinates and can modify unit amounts, without having to approve any single fake script. However, every other change on a script, even a fake script, every other logical change on a fake script, does not make it auto-approvable.
Should I have called it “another small modification to a Wall Clear script”?
 
Top