Shinko to Kuma

Still Going Strong
Reaction score
776
Author
Shinko to Kuma
Contributors
N/A
Quickbar Entry
javascript:
var premiumBtnEnabled=false;
$.getScript('https://shinko-to-kuma.com/scripts/scavengingFinal.js');
Public?
Public
Just a small reminder to everyone (as I see other markets giving this topic attention): while this script is approved on international, this does not mean it is approved on other markets. An approval on international only makes it legal to use on Tribal Wars Beta and Tribal Wars US. Any other market will need approval from that specific market!

If you have not done so, you are at risk of being banned on these other markets. It is strongly recommended to submit this script for review on your respective markets beforehand.


Last update: 11 JUNE 2019 - REWRITING CODE FROM SCRATCH
https://puu.sh/DEi8Q.mp4

13 June: added a counter that says how many times the script got used by all users :D

How to use:

Bind the script to one of your quickbar numbers (for example, numpad3)

press numpad3, enter, 4 times, one time for each option. It will end up having sent out all categories for the exact same runtime.

Scavenge script:

Code:
javascript:
var premiumBtnEnabled=false;
$.getScript('https://shinko-to-kuma.com/scripts/scavengingFinal.js');

Youtube tutorial by Marshyyy


Preview:
CK0Wl.gif


Feel free to give feedback in comments or report any problems, I will attempt to fix them asap.


Current known bugs: None?




Update 27/02: fixed for .US worlds
Update 02/03: ADDED AUTOMATED GRABBING OF VARIABLES! Great progress
Update 07/03: Added functionality on hopefully all servers! (Cant test myself on every server so please give feedback)
Update 08/03: Rewrote and condensed script, fixed recalculation bug when going past certain limits
Update 09/03: Adjusted script to work for mobile app!
Update 16/03: Approved on .nl! Ticket nr. #T13037887
Update 05/04: Added option to disable individual categories
 
Last edited by a moderator:
Upvote 8

Anonymous...

Guest
I've noticed that it says the same, but still sends the runs out in hours. Seems like its just a typo and doesn't really affect the functionality of the script in any way
 

DeletedUser97446

Guest
I've noticed that it says the same, but still sends the runs out in hours. Seems like its just a typo and doesn't really affect the functionality of the script in any way

Seems like it to me too now that I think of it. I just set the counter to 99999. It works for me. Thanks for the heads up though
 

Shinko to Kuma

Still Going Strong
Reaction score
776
Seems like it to me too now that I think of it. I just set the counter to 99999. It works for me. Thanks for the heads up though
I've noticed that it says the same, but still sends the runs out in hours. Seems like its just a typo and doesn't really affect the functionality of the script in any way
I've noticed that it says the same, but still sends the runs out in hours. Seems like its just a typo and doesn't really affect the functionality of the script in any way

Sorry all, I put part of my test version as the live version, I did some testing to try and get the runtimes more accurate to allow for potential sniping through scavenging if people wanted to. I'll rollback and get the old version back till I have time to finish the update that will make the script work a LOT faster

EDIT: should work as intended now, there will be checkboxes to enable/disable categories but those won't work for now.
 
Last edited:

DeletedUser97446

Guest
Sorry all, I put part of my test version as the live version, I did some testing to try and get the runtimes more accurate to allow for potential sniping through scavenging if people wanted to. I'll rollback and get the old version back till I have time to finish the update that will make the script work a LOT faster

EDIT: should work as intended now, there will be checkboxes to enable/disable categories but those won't work for now.

Shinko, you and I need to become friends. LOL I have so much to learn.
 

DeletedUser116724

Guest
I have two questions shinko if you can oblige me with an answer.

1 - Do you think this will ever be edited to be able to leave reserve troops at home? I know there a couple of slightly tedious ways to do this anyway, But would be handy to be able to leave 1000/1000 sp/sw at home for a snipe if you get in trouble while troops are out scavenging.

2 - Literally 99% of players (some very experienced and math driven players) have been talking about diminishing rate of return the longer one scavanges, pretty much since scavenging came out. Am I missing something here? Because I dont see it. In fact, all i see is the opposite. Every additional hour one scavenges for, the higher the rate of return, and at no point does the rate diminish.
 
Last edited by a moderator:

Shinko to Kuma

Still Going Strong
Reaction score
776
Yep same here. Glancing at the script it looks like there are some variables no longer defined .

Looks like scavenging script stopped working this morning... anyone else has the same problem??

V

I haven’t touched that script at all but I’ll take a look, on mobile rn so if you could show me a console log or something (F12 on chrome) that would be helpful

- Sophie

PS: I have another approved version of the scav script, more advanced but it has some calculation issues here and there still. You can try this one as well

Code:
javascript:
$.getScript('https://dl.dropboxusercontent.com/s/e30h3fie7ohu2wi/scavSpeed.js');
 

DeletedUser123692

Guest
Hey mate this was in my console after trying to run the script
en109.tribalwars.net-1563801268572.log:
Code:
scavengingfinal.js?_=1563801242991:28 Uncaught TypeError: Cannot read property 'duration_factor' of undefined
    at scavenge (scavengingfinal.js?_=1563801242991:28)
    at scavengingfinal.js?_=1563801242991:736
 

DeletedUser123692

Guest
and this one when trying your other version


Code:
scavSpeed.js?_=1563801596820:55 Getting  /game.php?&screen=unit_info&ajax=data
scavSpeed.js?_=1563801596820:97 Uncaught TypeError: Cannot read property 'duration_factor' of undefined
    at scavSpeed.js?_=1563801596820:97
scavSpeed.js?_=1563801596820:76 Object
scavSpeed.js?_=1563801596820:82 TypeError: Cannot read property 'checked' of undefined
    at calculateHaul (scavSpeed.js?_=1563801596820:205)
    at scavSpeed.js?_=1563801596820:79
    at loadNext (scavSpeed.js?_=1563801596820:43)
    at Object.<anonymous> (scavSpeed.js?_=1563801596820:62)
    at c (game.js:9)
    at Object.fireWith [as resolveWith] (game.js:9)
    at k (game.js:11)
    at XMLHttpRequest.r (game.js:11)
(anonymous) @ scavSpeed.js?_=1563801596820:82
 

Shinko to Kuma

Still Going Strong
Reaction score
776
Thanks, with that info I can fix it, I’ll be on a laptop in like an hour to fix it and should take 5 mins
 

FoE2022

Well-Known Member
Reaction score
22
there must have been something similar on the balancing script as well as you have to "hit" manually send now; if you hit the script 2nd time it will just close the tab without sending the resources indicated earlier..
hope this make a sense:confused:

V
 

Shinko to Kuma

Still Going Strong
Reaction score
776
Update: both scripts should be fixed and working again, they did an update to major version 8.177, which changed the location of certain variables. Other servers (including .nl) are still running on 8.176 so I included an exception for those servers so they still keep working too.

there must have been something similar on the balancing script as well as you have to "hit" manually send now; if you hit the script 2nd time it will just close the tab without sending the resources indicated earlier..
hope this make a sense:confused:

V

Are you sure it doesn't send the resources before closing the tab? I have it set right now that it will close the tab once the URL no longer has "send" or "wood" in there, which only happens after the sending was succesfull and it returns to the market
 
Last edited:

Shinko to Kuma

Still Going Strong
Reaction score
776
I have two questions shinko if you can oblige me with an answer.

1 - Do you think this will ever be edited to be able to leave reserve troops at home? I know there a couple of slightly tedious ways to do this anyway, But would be handy to be able to leave 1000/1000 sp/sw at home for a snipe if you get in trouble while troops are out scavenging.

2 - Literally 99% of players (some very experienced and math driven players) have been talking about diminishing rate of return the longer one scavanges, pretty much since scavenging came out. Am I missing something here? Because I dont see it. In fact, all i see is the opposite. Every additional hour one scavenges for, the higher the rate of return, and at no point does the rate diminish.


1) I can do this but with the overhaul they are doing to scavenging right now idk if I want to invest the time in that right now. I could just deduct a value of the numbers I grab from the page so it thinks there are less available then there actually are

2) after 2 hours of scavenging time the rates pretty much are the same for every scavenging type. They drop exponentionally from the start and once they are around 2 hours it becomes stagnant

eba2a7a952d0483ac846ee7fb9dcae27.png
 

FoE2022

Well-Known Member
Reaction score
22
for the balancing - when I run my shortkeys twice and it closes all the tabs I went and look how many mechants left in my only big village and they were still all there; so I run it again and hit the "send" manualy 2nd time around and resources were shipped out fine:)
 

Shinko to Kuma

Still Going Strong
Reaction score
776
for the balancing - when I run my shortkeys twice and it closes all the tabs I went and look how many mechants left in my only big village and they were still all there; so I run it again and hit the "send" manualy 2nd time around and resources were shipped out fine:)

I can't reproduce it on my end, it works just fine here, but to be safe (might be latency related), I made it so it only closes the page after it sent and you reloaded the page, then you run the script again. So you can still keep pressing the script button and it will work. Let me know if this works better for you
 

FoE2022

Well-Known Member
Reaction score
22
Perfect; works for me just as before and I don't mind closing all tabs to the right once the 1st batch is done:)
Thanks you! You are great!!

V
 

Shinko to Kuma

Still Going Strong
Reaction score
776
What are Enable check boxes for?

that function is currently disabled cause the calculations sometimes have weird bugs when people do weird combos, like activating category 1 and 3 only. The other version I linked a few posts ago has those working but until I make the calculations correct in every case I don’t want to add it to the main script
 

DeletedUser122394

Guest
On some servers they changed their scavenge object, to fix it just change the array index from 0 to 1 on line 28
From
PHP:
var scavengeInfo = JSON.parse($('html').find('script:contains("ScavengeScreen")').html().match(/\{.*\:\{.*\:.*\}\}/g)[0]);
to
PHP:
var scavengeInfo = JSON.parse($('html').find('script:contains("ScavengeScreen")').html().match(/\{.*\:\{.*\:.*\}\}/g)[1]);
 
Last edited by a moderator:
Top