John Borwick’s blog

Neat stuff John likes.

January 28th, 2005

Trade Wars client

I have dumped the initial version of the (platform independent?) Trade Wars trader program I’ve been working on, in the just-created projects directory.

I wrote this program on Mac OS X. It’s a very UN*X-y approach.

Basically, you run the app-server first, like so:

app-server.pl --port=5000 nc host-name port

You then connect to the app server.

telnet localhost 5000

Finally, you run the “trader” program:

trader.pl --auto localhost 5000

This program will print out possible initial trading values for you, and then negotiate subsequent trades.

I would say this is an “OK” Trade Wars 2002 trading program for novices. It’s nowhere near the quality of ElderProphet’s. It saves me time; that’s all.

January 20th, 2005

UUFWS

I’ve been working on the new UUFWS website. I’ve finally gotten http://www.uufws.org to redirect properly.

We are using Plone for the back-end, and MailBoxer, a Zope listserv manager, for our mailing lists. Zettai.net is doing a great job of hosting us.

January 20th, 2005

Strindberg + Helium

Mom sent me a link to Strindberg + Helium, a small flash site with some funny (to me) cartoons. Czech it out!

January 16th, 2005

Welcome, Aaron!

Aaron Clauset has started up his own blog. It looks really nice!

January 8th, 2005

Trade Wars

I’ve been playing Trade Wars 2002 a LOT… at least since the beginning of December. I’ve been learning about strategy from various publicly-available forums.

The temptation to be better in the game, combined with the lack of another programming project, has driven me to write several versions of a trade wars 2002 client. The first version was very Windows-y: one big program with lots of GUI windows (handled with Perl, threads, and Tk).

The second version, on the other hand, is more UN*X-y, and is actually working. One program runs the equivalent of nc -e 'telnet $SITE $PORT'. It starts a server that multiple clients can connect to, however. One client is my telnet client where I play like normal. Another is a special program that recommends initial bids for trading and helps with subsequent bids. You can write other scripts as needed.

TCP/IP Illustrated helped me understand what was going on: telnet does some nutty things with buffering depending on when you connect to the main server. It’s kind of neat, actually, you can type “pt” for “port” then “trade”, but nothing happens until you hit a linefeed character. Telnet (at least for the mac) lets you “set forw1 ' '” to force space to flush the buffer. That way you don’t have to hit “pt^M” and buy whatever the port is selling.

Things aren’t totally set, yet, but with this buffering I got a routine for colonizing planets (starting at Earth):

l1                    # Land on Terra
t                     # Take the default number of colonists
[SECTOR]              # Go to your sector
yyl[PLANET-NUMBER]    # Transwarp, yes, then land on your planet
snl1                  # change colonist levels, don't display, leave colonists, put them in ore
tnt1[ORE-AMOUNT]      # take some ore for the next run
cb1                   # use your citadel beamer to go back to sector #1 (good only)
|