View Full Version : Scripts...

09-24-2005, 06:11 PM
Soooo how do you write scripts to do all these neat things that people are complaining about...

(Not that I would ever do something like that. :givebeer: )

09-24-2005, 07:35 PM
one waits for this red fellar with some peculiar spikes on his head, and you sign some contract.

it worked for me.

09-25-2005, 02:04 AM
George W?

09-25-2005, 07:25 PM
I do not think so, id say W is only a minion.

09-26-2005, 04:13 PM
What do you want to accomplish with a script?
Collect jewels?
Monitor resources?
Wage war?

Well, since this web site is called "Google Earth Hacks"...

Learn how the KML files in GE work, and especially what a NetworkLink is.
Use the "Ethereal" network sniffer to see what goes on when GE refreshes a KML NetworkLink.

For jewel collection, break down what you do when you manually hunt jewels:

When start to hunt jewels you get your first city name from either a refreshed KML or HTML
You type in the city in to GE
GE searches for the city (this ends up hitting Google Maps...)
Google Maps returns a KML with the city coordinates
GE flys to those coordinates
When the map stops moving, GE refreshes the main jewel KML file tells the GEWar server the bounding box (BBOX) of the GE view.
The GEWar server calculates if you are near the city
If you *are* near the city then the GEWar server returns a KML with a jewel icon and a URL to an HTML page
If you are *not* near the city then the GEWar server returns a KML that continues to tell you the city name that your jewel is in (return to step #5)
You click on the jewel icon and browse to the HTML page
You enter the obfuscated code
GEWar gives you the jewel and tells you where your next jewel is
Return to step #2

Now, write an application that automates as much of that as possible.
(All but #11 are automatable...just sniff your network traffic and then get creative about how to reproduce that)
None of this actually requires you to "Log In" to the GEWar web site.
However, once you figure out how to write an app that can log in to the GEWar site, you can automate a lot more functionality.
You can scrape information from the web pages (Regular Expressions are your friend!) and you will be able to monitor cities, armies, resources, etc.

NOTE: NEVER EVER SWAMP THE GEWAR SERVER WITH AUTOMATED NETWORK REQUESTS! ALWAYS play nice and induce at least a 2 second delay in in between any network request you send to GEWar.

For my app, I wrote it in C#.
I will not be responding to inquiries (except from admins) about the app until it becomes more stable.
I honestly don't know how other people accomplish their "scripting", or what they even have their scripts do.
My gut feel from the game is that less than a dozen people use "scripting".