Here is the source for the utilities. I have included the basic
AI player I was working on also. If you do modify/add you
are encouraged to submit your changes so they can be included
in the package and you can be given credit. A strong AI player
would also come along faster were the work distributed.
This is the second release, including the new Search utility, the Spy Report
utility, the new earth.pl (1.2.7) and the News utility.
You need PERL5 and libwww. If you want to run these utilities from
your home Windows machine, you can use ActivePerl for Win32 which comes with libwww.
Otherwise, for UNIX machines, you can get libwww (from the CPAN archive).
Here is the ZIP file:
earth-util-5.zip (24kb)
Here is the README:
Earth 2025 Utilities Release 4 Original Release March 26, 1998 Last Code Update Oct 21, 2001 Released Jun 2, 2002 Denis Papp denis 'at' accessdenied.net http://www.accessdenied.net/earth Permission is granted to use/modify the included files (except cgi-lib.pl which is not mine) so long as you cite me. You are also encouraged to share your changes/enhancements/additions so they can be included in the package (with proper credit). WHAT IS EARTH: 2025 =================== Solaria Central Plaza Games Parlor (home of Earth: 2025) http://www.solarianet.com/games/ Earth: 2025 is a big web game (games of over 6000 players) with turns every 40 min. It is similar to the BBS game BRE. It has a mostly fixed communication protocol and these utilities set some groundwork for doing so. NEW IN RELEASE 3 ================ - several files updated to be compatible with changes to Earth: 2025 - allystats.cgi underwent minor changes - earth.pl, nph-earn.cgi major changes - news.cgi, stats.cgi minor changes - added spam.cgi WHAT'S NEW IN RELEASE 2 ======================= - See the respective files for a list of what's specifically new. - new earth.pl (1.2.7), new utility news.cgi, new search.cgi (1.1.0). - new nph-earn.cgi. Obsolete utility, included as another example - new allystats.cgi (cleaned up) - added spy.cgi (get a spy report, log it and store it somewhere) INTRO ===== This is a potential tool of evil and a potential tool of good. This package includes a library of utilities that are useful for interfacing with an Earth: 2025 web server. It also includes a few utilities as well as a really basic bot (AI player). I will continue to work on it (albeit slowly) but I am releasing this after some requests in the hopes that people will continue to work on it and will share their work. If you add/fix functions to the library or add/fix utilities, or - even better - work on the bot, I would like to receive these changes. If they are good they will be merged in and you will receive credit and they will be in the next release. I have many ideas for how the bot could work (basically an expert system) but haven't really laid out the framework, however I would be happy to communicate some of these ideas (or hear about some). If the bot thing catches on (I know of at least one other working on a bot - in C though) maybe we can convince Solaria to reserve a special game for a 'bot league'. The message system provides an excellent way for a team of bots to use their own protocol and cooperate. In fact a common communication protocol would provide a way for bots of different authors to conduct diplomacy with each other. Also if someone wants to port these functions to C (tricky with the heavy use of regexps) that would also be excellent, and I would include (but probably not use) them in the next release. REQUIREMENTS cgi-lib.pl handy perl CGI functions by Steven E. Brenner perl5 your system must have version 5 installed libwww perl utilities for doing HTTP. Get it from any of CPAN page (eg. http://www.cs.ruu.nl/pub/PERL/CPAN/CPAN.html) BTW - you will likely need some other packages before you can install this. I can't remember which ones. FILES IN PACKAGE allystats.cgi CGI to retrieve direct ally stats and put into table cgi-lib.pl CGI functions by Steven E. Brenner used by earth.pl README this file bot basic AI player state.dat sample state file for a bot player earth.pl functions that use libwww to talk to an Earth: 2025 server get utility to retrieve a file given a URL (uses earth.pl but has nothing to do with Earth: 2025) nph-earn.cgi auto-earn-a-turn CGI search.cgi CGI to retrieve stats for a list of countries DOCUMENTATION ... is lacking. earth.pl has some documentation and the rest you can figure out by reading code or looking at the samples. You'd better know PERL. Knowing libwww is not required - that's what the library is for. DON'T JOIN THE DARK SIDE A final note - I say 'tool of evil' because you can spam the Earth: 2025 servers (or as a CGI let users spam). For example, it would not be terribly difficult to write a message spammer which sent a message from your account to a list of targets. This might be handy but if abused (ie. say sent to more than 10-20 people) it might force Solaria to disable accounts which 'spam'. For this reason the 'search.cgi' utility has a controllable limit to how many countries it will retrieve stats for (either 50 or 100). Don't ruin the game for other people or get your site banned. If that's all you can think of then you have too much free time.