Farming (LA) NAFS - Nineza's Awesome Farming (and Shaping) Script

  • Thread starter DeletedUser110650
  • Start date

DeletedUser110650

Guest
Author
Nineza
Contributors
N/A
Quickbar Entry
javascript:void(jQuery.getScript('http://pastebin.com/raw.php?i=q1PezYz6', function(){ changeConfig(); }));
Public?
Public
The name wasn't my idea, but I kinda like it (I'm sometimes called Throne3d, sometimes Nineza). :p

Ok - considering the void left after (first) TWFR died and (next) TWPF seems to have gone down, I decided to create a farming script.

It's been approved (I just wanted to check in case AJAX isn't allowed or something - it was in the case of TWPF, but just checking) - basically it reads reports, creates a clicky link or two on certain pages, and helps with farming and shaping.

Instructions (per world)
1. Run the configuration script once and do as it asks (also feed it information as it requests it).
2. Import reports (either from Reports > Attacks or a specific report page by running the script).
3. Add villages to your farm list (find their village page, run the script, click "Add to list" if it's not already added - importing reports will also add them; this list is per-village).
4. Go to your rally point
5. Run the script - it should automatically scout (if set to do this) stale/old/unscouted villages, then shape them if enough troops available and set to do this (with axes, a scout, rams for the walls, catapults for the farm and headquarters and so on), then farm them if set to do this (with light cavalry and scouts).
6. On the confirmation page (Yes, click "Attack"!), if set to catapult, run the script again - here it will select and building and say "Changed" next to the dropdown.
7. Repeat.

Notes
It works using "localStorage", so you will have to have a browser compatible with this - it should warn you if localStorage is not present. This also means it will not work on multiple browsers, unless you save "localStorage.twstuffz" and reimport it on the other browser.
It was originally done using Chrome as the test bed, but has been updated to work in Opera 12 as well as the major browsers (mostly untested apart from Chrome + Opera 12).
On the rally point, it uses the current outgoings to work out which village to do next - this means you may do multiple tabs to attack in for multiple villages, but not multiple tabs for a single village.
If an error message appears stating the bigger player's points are too high, or that the player is banned, running the script again will trigger that village to be disabled from your farm list.
The configuration script's "delete disabled villages" is a one-time thing - to have this happen again, you must re-run the configuration script (just press "OK" on everything before the 'delete disabled' bit) and perform this action.

Old Links
Configuration script:
Code:
javascript:void(jQuery.getScript('http://pastebin.com/raw.php?i=q1PezYz6', function(){ changeConfig(); }));
The rest:
Code:
javascript:void(jQuery.getScript('http://pastebin.com/raw.php?i=q1PezYz6', function(){ def(); }));

Old Changelog
2014-08-27, 1.0.7:
-Allows changing of minimum wall level required to send rams.

2014-08-19, 1.0.6:
-New option to prevent import of reports with a player as the defender
-Truly fixed the localization thing (and the stupid page thing - beta has changed that village overview page YET AGAIN)

2014-08-19, 1.0.5c:
-Fixed localizations (duh. forgot to add it for "Coordinates" >_>)

2014-08-19, 1.0.5b:
-Fixed it to work with the new report layout (oops?)
-Fixed it to work with the new village overview layout (hopefully?)

2014-08-15, 1.0.5a:
-Allows more troop variety...

2014-08-01, 1.0.5:
-Now allows the choice of axes or spears (or whichever is available) for catapulting.
-Now allows the choice of spears, swords, axes, LC and mounted archers for regular farming.

Final note
Please make sure to give feedback (preferably here or via PM) - I will try to add any features you request (providing they aren't against the ToS and fit with the rest of the script), fix any bugs you may have, and add any extra notes that I haven't already stated! (The script runs somewhat weirdly, so you may have to ask for clarification on some points).

Also, it's possible that this post will become too old to be edited, in which case, I'll just post updates as they come in response to this thread. (Changelog can be found in an external file here - look for that version in reply)

New Edit - 2015/10/25
Apparently still works. Should still work. Might be kinda funny today after daylight saving time changes. Let me know if you have issues.

Re-vamped version (does near-enough exactly the same, needs to be reconfigured, needs to have reports added, has a few extra features that aren't guaranteed to work properly, notify me of any issues, translation thing isn't working 100% right now, etc.):
Config:
Code:
javascript:void($.getScript("https://pastebin.com/raw.php?i=HKM89370", function(){ changeConfig(); }));
Main script:
Code:
javascript:void($.getScript("https://pastebin.com/raw.php?i=HKM89370", function(){ def(); }));
 
Last edited by a moderator:
Upvote 0

DeletedUser

Guest
No errors in the console, but this note was at the bottom of the release notes for version 8.25:

One of the layout tweaks includes a more readable format for information about buildings in scout reports. Here follows information for script authors:
The old #attack_spy table has been split up:
#attack_spy_building_data // buildings
#attack_spy_resources // table with resources
#attack_spy_away // table with "units outside of the village"

I peaked at your code and it references the #attack_spy table and not the new tables.

On every report I try to upload on the "Attack" report page I get "NOT SAVED (Village disabled?)"

When I open a report and try to upload it nothing happens. No error in the console and "SAVED" does not show up.

EDIT: Also, it doesn't work when you try to delete or add a village in the "Village Information" screen.
 
Last edited by a moderator:

DeletedUser110650

Guest
No errors in the console, but this note was at the bottom of the release notes for version 8.25:



I peaked at your code and it references the #attack_spy table and not the new tables.

On every report I try to upload on the "Attack" report page I get "NOT SAVED (Village disabled?)"

When I open a report and try to upload it nothing happens. No error in the console and "SAVED" does not show up.

EDIT: Also, it doesn't work when you try to delete or add a village in the "Village Information" screen.

I believe I've fixed it now...

I didn't realise the update had been pushed out, and so hadn't updated it to prepare for that... It should work now.
 

DeletedUser104411

Guest
This script is amazing!!!! great work Throne3d :)

but I think I've found this glitch with chrome at least that whenever I run the script it's as if I've clicked it twice be cause it runs twice on the reports and in the village overview on my PC at least??? I just noticed the config also runs through twice??? I'm not sure if it's only for me but I'll put up a screen shot of what I'm trying to say...

Glitch.jpg
 

DeletedUser110650

Guest
This script is amazing!!!! great work Throne3d :)

but I think I've found this glitch with chrome at least that whenever I run the script it's as if I've clicked it twice be cause it runs twice on the reports and in the village overview on my PC at least??? I just noticed the config also runs through twice??? I'm not sure if it's only for me but I'll put up a screen shot of what I'm trying to say...

~~snip~~
Well that's really bizarre! I've not encountered that yet, and I'm pretty sure there's no reason that it would be doing that, unless you somehow pasted the thing in twice when you set up the bookmarks ? o.o

I don't think anyone else has had this issue (at least not yet), so all I can do is assume it's something on your end. Try re-creating the bookmarks, but make sure it's only pasted in there once? ... It's really weird that it would do that.

To be honest, it shouldn't make a huge lot of difference either way. It'll just be a bit slower and there will be certain graphical bugs (like you showed), but it should function properly...
 

DeletedUser104411

Guest
Well that's really bizarre! I've not encountered that yet, and I'm pretty sure there's no reason that it would be doing that, unless you somehow pasted the thing in twice when you set up the bookmarks ? o.o

I don't think anyone else has had this issue (at least not yet), so all I can do is assume it's something on your end. Try re-creating the bookmarks, but make sure it's only pasted in there once? ... It's really weird that it would do that.

To be honest, it shouldn't make a huge lot of difference either way. It'll just be a bit slower and there will be certain graphical bugs (like you showed), but it should function properly...

yeah true, just slower... btw I definitely only have one pasted in I thought that my self so I checked :) I wonder what the problem is (maybe just a browser glitch) I'll try a different browser to check it.

Edit: lol i did have to *facepalm*
 
Last edited by a moderator:

DeletedUser108623

Guest
Could someone give me a skype fast run down on how to set this up. i know its on the first post. i had a go at it but its not working properly. it must be something im doing. im also not sure how to add the reports the fastest way. doing 2500 reports 1 by 1 will take longer than its worth to set up.
my skype is mikbenji2 if you can tel me how to set this up fast i would be greatfull.

thanks
mike
 

DeletedUser110650

Guest
Weird!!! same with Firefox ^^^
That's really weird - I just tested it in both Chrome and Opera (12.17), and it doesn't seem to be doing this...

Are you sure you just have a single bookmark with this inside? :

Code:
javascript:void(jQuery.getScript('http://pastebin.com/raw.php?i=q1PezYz6', function(){ def(); }));

And you only click it once - you go to a page and click it... right?
 

DeletedUser104411

Guest
Sorry lol I think I did somehow paste two copies because when I updated the script there is a weird glitch with chrome that when you select all in the target URL place and then if you just go ctrl+v over the top of the selected old text then it just disappears even though it got new stuff copied in you can't see it, so I guess I did ctrl+v twice because the second time it appears... it's really weird but anyway nvm I fixed it :) lol

EDIT: oh and somehow I did it with both bookmarks in both browsers too. lol :p
 
Last edited by a moderator:

DeletedUser

Guest
Anybody else having issues with troops other than axes sending rams to knock down wall? For some reason rams are not being sent with my spears, swords, and archers. And my Heavy Cavs don't work. I wonder if my issues have to do with playing on Casual 2?
 

DeletedUser115006

Guest
i encountered a problem with this script. After looking at my localStorage, I realized that some of the targets in my farm list are "deleted" villages. I guess the user clicked delete. Somehow the villages is completely gone from the map, no barb left behind.

I couldn't find a way to reset, so I just deleted the localStorage and started over with my farm list.

But it would be cool if the script could either make a list of farm targets, or do an automatic check for deleted villages.
 

DeletedUser110650

Guest
i encountered a problem with this script. After looking at my localStorage, I realized that some of the targets in my farm list are "deleted" villages. I guess the user clicked delete. Somehow the villages is completely gone from the map, no barb left behind.

I couldn't find a way to reset, so I just deleted the localStorage and started over with my farm list.

But it would be cool if the script could either make a list of farm targets, or do an automatic check for deleted villages.
Unfortunately I think it would make it quite a lot slower to do an automatic check for deleted villages, as it would either have to load the village page in the background and check for certain information (or a lack of, if it's a deleted village, for example), or it would have to load the list of village data from TribalWars, which I'm pretty sure would take a hugely long time to download each time.

I could, however, look at making it a possibility to click a button on the rally point (after running the script there) which lists the villages in your farm list for that village, along with buttons to allow you to delete each one (it would list the coordinates), so you wouldn't have to go to each individual village screen (especially if the villages are somehow deleted). That could work? I'll probably start work on that at some point within the next week if it's a feature people want, and it shouldn't be too difficult to implement.

Btw, I just pushed an update to allow you to make it so, for example, ram attacks don't get sent to a village if the wall is level 1 (you set the "minimum required ram amount" in the config to 2 for this). By default, it will send ram attacks to any village with a wall level greater than or equal to 1 (so, any village with a wall). There was possibly, however, a slight bug which may have affected some users, in that it may have set the default "min ram level" to 0, making it attack villages even without walls (that was only present for a couple of minutes, so hopefully it didn't affect anyone). If it did affect you, just recall your attacks which seem to involve only axes and scouts (and no rams) which were done by this script, and make sure to set it to 1 in the config. (I don't even know if there actually was a bug, but it's definitely possible that there was, though this potential bug should have been fixed)

Edit: Another bug, just fixed. It wasn't checking the new config setting at one point, resulting in it sometimes wanting to send axes and scouts but no rams (again). Fixed (again). Please notify me if you have any issues, and I'll try to get back to you as soon as possible.
 
Last edited by a moderator:

DeletedUser115006

Guest
Unfortunately I think it would make it quite a lot slower ...

I could, however, look at making it a possibility to click a button on the rally point (after running the script there) which lists the villages in your farm list for that village, along with buttons to allow you to delete each one (it would list the coordinates), .....

you could make a different function call/URL for the script, so the check for deleted villages could be manually invoked, without it having to run every time at the rally point.

I like the idea of providing a farm list somewhere. I wonder if you could even make an export-import option. That could be useful, for example, when you get your farm list just the way you want it and then want to use it on different browsers/devices. a user could export your farm list, save it to notebook, then on a browser at the second device retrieve from the notebook and import. I think those steps would be manual, that's fine. but just the export/import option would be cool. Or could even use the import to take in a list of coords
 

koser1

Guest
awesome script! Thanks so much, broke all my walls :) over 3.5k to be exact. Now to start shaping :)
 

DeletedUser104411

Guest
awesome script! Thanks so much, broke all my walls :) over 3.5k to be exact. Now to start shaping :)
I also agree it's AWESOME!!!!

just wondering if you could make some options for choosing the amount of troops to send each time or/and only if the report is a certain age or something
(because when other people are farming the area it's a waste to send more troops that necessary and after a while the script will want to send way more troops for the amount of res left when lots of other people are farming)

also I'd love to have more shaping options like priority and options to exclude buildings and options to cat players also.

and I also think you should set up a donation thingy so we can support your work :icon_smile:
 

DeletedUser110650

Guest
I also agree it's AWESOME!!!!

just wondering if you could make some options for choosing the amount of troops to send each time or/and only if the report is a certain age or something
(because when other people are farming the area it's a waste to send more troops that necessary and after a while the script will want to send way more troops for the amount of res left when lots of other people are farming)

also I'd love to have more shaping options like priority and options to exclude buildings and options to cat players also.

and I also think you should set up a donation thingy so we can support your work :icon_smile:
It already has configuration for the number of troops to send each time and the age of the reports (as in, if it's greater than a certain age it won't attack, but will instead re-scout - if you mean it has to be a specific age, is there a particular reason? If it's due to low resources, you can just change the number of troops to send in each attack).

I think you might have forgotten to run the config script, maybe! Remember, there are two scripts: the regular one and the config. Also, up until about 2 weeks ago, the script was constantly changing, but now I've made it so it's just a single URL which should automatically link to the most up to date version. If you check the main post, it has both the "Configuration script:" bit and the "The rest:" bit - run the configuration script on the TribalWars page and change the details, then continue running the other script and it should function slightly differently.

If you've already used the config and you were talking about a different setting which doesn't seem to be there, which one? o.o

Shaping options like priority... I could definitely try those... What do you mean by "options to cat players", btw? So it only cats them and doesn't farm them...? If you want to cat and farm (or have it do what your regular settings are at), you should just be able to add it to the farm list for your village and the script should treat it like a barbarian village and farm/cat it regularly.
 

DeletedUser104411

Guest
Yeah I know how the config script works thanks, sorry I wasn't very clear and also forgot that players were treated like farms lol

yeah I mainly wanted more shaping options (especially options for which buildings to shape and in what order) and maybe different option choice for if it's a player so two option sets.

what I meant was have an option that after the report is a certain age, say the report is a day old, then you can have the option instead of JUST scouting to also send say 10 or 20 LC (also changeable) so you also get some resources instead of having to wait for the scout to arrive before sending troops. (the certain age could just be the stale report age but maybe it could also be separate)

thanks so much for the script and please set up a donation thing so people can give you $$$MONEY$$$ :p

EDIT: btw could you tell me how to get the local storage file... I could figure it out myself but it may just be easier to ask :)
 
Last edited by a moderator:

DeletedUser110650

Guest
Yeah I know how the config script works thanks, sorry I wasn't very clear and also forgot that players were treated like farms lol

yeah I mainly wanted more shaping options (especially options for which buildings to shape and in what order) and maybe different option choice for if it's a player so two option sets.

what I meant was have an option that after the report is a certain age, say the report is a day old, then you can have the option instead of JUST scouting to also send say 10 or 20 LC (also changeable) so you also get some resources instead of having to wait for the scout to arrive before sending troops. (the certain age could just be the stale report age but maybe it could also be separate)

thanks so much for the script and please set up a donation thing so people can give you $$$MONEY$$$ :p

EDIT: btw could you tell me how to get the local storage file... I could figure it out myself but it may just be easier to ask :)
Oh, okay, I'll see about adding that then.

In terms of accessing localStorage, you'll need to open the console in your browser (usually Ctrl+Shift+I), then write in "localstorage.twstuffz" and it should output (in string format) the save file.
 

rummike

Guest
I can't get it to work on W76. When importing reports, it says "NOT SAVED (Village disabled?)" in every report. So I tried adding villages manually, added a bunch and we to Rally Point. After running the scripts it tells me I have no villages left to attack. I know javascript quite well so I looked at the script a bit. Didn't really understand why it makes it act like this.
 

DeletedUser

Guest
A suggestion, I don't know how hard it would be to implement.

Could we have an option to send a different amount of scouts for a shaping run than a normal farming run.

Also if you have shaping disabled, does the script use cats as well to knock down walls? If not can this be implemented?

Thank you, great script so far keep up the good work!
 
Top