TribalWars Forum
 
Go Back   TribalWars Forum > Community Section > Scripts & Independent Tools and Links
Scripts & Independent Tools and Links In this Section we offer forum space for a few external, independent websites. They are TW related and all players are allowed to use the tools offered. The forums are not moderated by game staff but by the owners of those pages. more.

Reply
 
Thread Tools Search this Thread
reltihmd
 
Join Date: 2008,September 27th
Old #1   2009,October 24th, 16:28   Top Reply With Quote
Ok - here is one that I'm pondering - and would take out a lot of work updating farm scripts
  1. You have one farm script
  2. In it - you set a radius
  3. you have a list of all barb villas - either automatically updating from a website, or manually in the script itself
  4. when you click it from a village - it picks a barb village within the given radius
  5. it will pick different farms for each of your villages based on the radius you give it
  6. bottom line - one script does your farming for every village - simple

As I'm not a Javascript programmer - I have no idea how hard this is
reltihmd is offline  
King Arturus
 
King Arturus's Avatar
 
Join Date: 2008,October 12th
Old #2   2009,October 25th, 02:36   Top Reply With Quote
I already do this manually using blood angels farm finder tool but I find farming all those tedious little barbs tedious so I do it less often.. be a real good idea to do on a growing barb world though. Now a script that automatically updated would be a nice improvement to what I already do. ;-)
__________________



King Arturus is offline  
U K patriot
 
Join Date: 2009,February 9th
Old #3   2009,October 25th, 15:52   Top Reply With Quote
If someone made this it would be incredibly useful, I hope someone has a go at it
__________________
U K patriot is offline  
reltihmd
 
Join Date: 2008,September 27th
Old #4   2009,November 3rd, 14:05   Top Reply With Quote
I use the farm finder also - but end up clustering my villas so I end up with a fake script per 10 villages (10 fake scripts for 1 million points)

at this point it's becoming unusable, if I add more villages to a cluster I lose efficiency,

I'm happy to update the script's village list manually each week, but would like to have one script that is smart enough to pick which villages are closest to it
reltihmd is offline  
xort
 
Join Date: 2007,September 8th
Location: At the snow
Old #5   2009,November 3rd, 14:10   Top Reply With Quote
I have a script that picks the absolute closest, the next one i was going to request was one which picks from within a radius, or from among the 5-20 closest
__________________
All opinions are my own, and not that of =D-N=
xort is offline  
reltihmd
 
Join Date: 2008,September 27th
Old #6   2009,November 3rd, 21:41   Top Reply With Quote
the radius is the important thing - randomly selecting villas within 20 (variable number) fields in any direction

I'm not saying this script will be perfect, as it's random (or if sequential doesn't take into account other villas of yours around the one you are currently farming from), but it'll be soooooo easy to use I really don't care about these facts
reltihmd is offline  
Kylan
 
Kylan's Avatar
 
Join Date: 2007,September 27th
Old #7   2009,November 4th, 09:57   Top Reply With Quote
If I had this I might even farm on w7 :O
__________________
Quote:
Originally Posted by mykil View Post
My E-peen is this *Holds arms out to sides* long.
>
Kylan is offline  
triplm
 
triplm's Avatar
 
Join Date: 2008,May 4th
Old #8   2009,November 4th, 12:35   Top Reply With Quote
i doubt updating the list would be possible to do automatically without somehow having the script access the world data to find out what villages are barbarian and someone would have to host the data for the script to access (not entirely sure but i don't think the world data is readable and sortable in it's raw format)

but a manually updated list seems possible altho it would be beyond my knowledge

it would require a cookie at least

i would assume you would have your list of villages to farm in the script and your at the rally point for the village you want to send the farming runs from and then an array would search thru the list picking out those on the list that are within the radius and placing into a cookie the order in which they would be sent and how many sets of coordinates there are

then it would work like a normal farming list script until it would hit the "last village" (the list count is greater than the number of sets of coordinates) pop up then it would erase the cookie or set cookie to clear then you would move on to the next village you wish to repeat this process on


again i this is beyond my ability to make and there is most likely a better way of doing it than what i outlined but i'm sure it's do-able
__________________
I'll never forget Therese

Last edited by triplm : 2009,November 4th at 12:38.
triplm is offline  
reltihmd
 
Join Date: 2008,September 27th
Old #9   2009,November 4th, 14:29   Top Reply With Quote
I think you've got it bang on the nose triplm, I don't mind it being random as opposed to sequential (my current scripts are random as I use them for multiple villas,

If the script were to access the villas automatically, it would need to use data similar to what the farmfinder uses, although I realise there would be a huge performance hit over having the villas predone into the script, so I'm happy to update it manually

I was kinda hoping fluffy or someone would have replied by now with "easy peasy" and a line of code underneath

so I'm assuming it isn't as easy as i thought
reltihmd is offline  
Fluffy88
 
Fluffy88's Avatar
 
Join Date: 2008,July 26th
Old #10   2009,November 4th, 17:30   Top Reply With Quote
It would be pretty simple, I think.
For auto updating there would be a hit to performance if it needed to call an external server for the coords, but using the local storage thing that DaMouse has been talking about you could avoid that.
It would need to call possibly once per day to look for updates.

Then personally I would make it sequential, it should be possible to store the position for each village in a cookie using the village id's.

But unfortunately I dont find much time for scripts these days, aetost has been at me for awhile to do a script which I only got to yesterday, so if I get time soon I may look at it, but you might have to wait a long time for me
tbh I would imagine DaMouse is already thinking about how he could do it.
__________________
Fluffy88 is offline  
reltihmd
 
Join Date: 2008,September 27th
Old #11   2009,November 4th, 20:30   Top Reply With Quote
your turn DaMouse

you are halfway there i think with This Post

but this will only send to the closest villa from what I can glean and doesn't set a radius

come on - how often do you get to change the way everyone plays the game with a perfect solution (Hi SlowTarget)
reltihmd is offline  
wardo001
 
wardo001's Avatar
 
Join Date: 2008,July 7th
Old #12   2009,November 4th, 22:36   Top Reply With Quote
i'd say if you combine
a sequential farm script,
with a kind of map tool/script that shows you a list of the coordinates of all barbarian villages (maybe even sorted per radius?) you see on the map (15x15, or less)

you can just make a list using the second tool, insert it in the first script, and start farming everything around you. does only work for one village at a time tough.
just a tip, maybe an idea others can work on and improve
__________________
Proud Baron of The Order Of Darkness
Unbent, Unbowed, Unbroken
wardo001 is offline  
jdrane
 
Join Date: 2009,October 22nd
Old #13   2009,November 18th, 01:33   Top Reply With Quote
What about a farming script to, instead of inserting coordinates randomly or in order, choose the closest (unused) coordinates to the village you're in?

I'm imagining you would use this for cluster farming and you would put every barb within a large radius into the script (like a traditional farming script) and the script chooses the closest barb. This would greatly increase the efficiency of cluster farming.

I don't know jack about scripting but it seems that if Servy's distance ordering script is possible this should be possible.
__________________
jdrane is offline  
undeadwear
 
undeadwear's Avatar
 
Join Date: 2009,July 1st
Old #14   2009,November 18th, 09:26   Top Reply With Quote
This is absolutely doable.

Steps:
1)Collect the id of the current village.
2)Parent script requests remote script and passes village id (and other variables) in the process.
3)Host reads village id, and other variable and does a search in the database for villages matching the query.
4)Host returns farming script with coords dynamically filled in.


Variables to pass:
-village id
-radius
-max points
-min points
-??? etc....


Fluffy, DaMouse... you have the resources. Now make it happen.
undeadwear is offline  
LastApparatus
 
LastApparatus's Avatar
 
Join Date: 2008,April 11th
Old #15   2009,November 18th, 19:26   Top Reply With Quote
As for getting a list of barbs... And you'll have to excuse my crappy coding, I suck at javascript...

HTML Code:
// Stolen code to make script work for premium and non premium
var win = (window.frames.length > 0) ? window.main : window;

// Grab the page source and assign it to the "report" variable
var report = win.document.body.innerHTML

// Use REGEX to grab the village information from the page
var village = report.match(/\href\=\"\/game\.php\?village\=\d{1,8}\&amp\;screen\=info\_village\&amp\;id\=\d{1,8}\" onmouseover\=\"map\_popup\(\'.+? \(\d{3}\|\d{3}\) K\d{2}\'\, \'\'\, \'\'\, \d{2,5},.+?,/ig);

	// While there are still villages left to check...
	while(village.length > 0){
	
		// Split the long string up into more useful variables
		var villagetemp = village.shift();
		var villagecoords = villagetemp.match(/\d{3}\|\d{3}/i);
		var ownvillage = villagetemp.match(/href\=\"\/game\.php\?village\=\d{1,8}/i);
		ownvillage = ownvillage.toString().split("=")[2];
		var villageid = villagetemp.match(/\&amp\;screen\=info\_village\&amp\;id\=\d{1,8}/i);
		villageid = villageid.toString().split("=")[2];
		var villagepoints = villagetemp.split("'")[6];
		var villageowner = villagepoints.split(", ")[2];
		villageowner = villageowner.split(",")[0];
		villagepoints = villagepoints.split(", ")[1];
		villagepoints = villagepoints.split(",")[0];
		
		// If a players village with less than 1000 points OR
		// a barbarian village with less than 2000 points...
		if(villagepoints <= 1000 || (villageowner == "null" && villagepoints <= 2000)){
			/* ******************************************************
			Add your own code to append the village to some list,
			using 'villagecoords' for the farm's coordinates,
			'ownvillage' for your own village ID, (useful for
			giving different farms to different villages)
			'villageid' for the farm's village ID, 'villagepoints'
			for the village's point value, and 'villageowner' for
			the player whose village it is: A barbarian or bonus
			will have a 'villageowner' value of "null", as suggested
			by the if statement before this long section of comments.
			****************************************************** */
			// An example of useful code for this section would be...
			output = output + villagepoints + "points.....[url=http://en34.tribalwars.net/game.php?village=" + ownvillage + "&screen=place&mode=command&target=" + villageid + "]rally.point[/url].....[village]" + villagecoords + "[/village]\n";
			// And then you could (output the ouput in a new window
			// at the end, for a list of farms in BBCode format.
		}
	}


The only problems are:
...it was made for a different purpose, so its salvaged code.
...it was never finished
...it grabs the "own village ID" variable off of whatever village you run the script from, not some fancy "which village is closest" method
...it grabs the village information directly form the source, so you're limited to whatever map size you use. (ie, if using 7x7, the script will check the 49 visible squares at the time of its execution for villages, and if using 15x15, it'll check the 225 visible squares, etc, etc)
__________________
LastApparatus:
Small attention span. Big ego.

Last edited by LastApparatus : 2009,November 18th at 19:43.
LastApparatus is offline  
DaMouse404
 
Join Date: 2007,August 13th
Old #16   2009,November 18th, 20:45   Top Reply With Quote
I posted something similar to this to be approved. It scrapes the map for all villages matching a certain criteria then stores the coords in localStorage. From there you can go to individual village pages to remove it or call the script from the rally point to send 1 scout to each village. On the confirm page you can also remove villages from your list.

Waiting for approval obvs :P.

-DaMouse
__________________
Quote:
Originally Posted by The Great 1One1 View Post
This script was made by God.
>
DaMouse404 is offline  
undeadwear
 
undeadwear's Avatar
 
Join Date: 2009,July 1st
Old #17   2009,November 18th, 23:33   Top Reply With Quote
Sound nice. Definitely possible to open up wider than the map with external data. But with your farming village centered there generally plenty of villages to farm in that area, more than most people would need if your farming with many villages.
undeadwear is offline  
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 07:59.
Powered by vBulletin Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd. Copyright ©2003 - 2009, InnoGames GmbH