Page 4 of 15
Posted: 08 Sep 2006 08:22
by Picknicker
@ glx
With which OpenTTD version have you tried it?
cu
Picknicker
Posted: 08 Sep 2006 13:09
by glx
Brianetta wrote:
I see you changed the \n to \r after each command that the autopilot sends. Was that necessary? If so, I shall modify the new version appropriately. I'd have thought that the actual correct behaviour in Windows would be to send both.
It was necessary. exp_send_user() works with \n but exp_send() needs \r.
Brianetta wrote:
Any reason why you changed the expect_out array index from 0 to 1 and added parentheses?
I did that because exp_send() needs to send a \r after the command. With the parentheses, I skip the \n
And don't forget the "package require Expect" at the beginning, it's needed for windows version.
@Carnalito: yes, you need to get sources from svn (r6418 but other rev should work too), apply the patch, and compile.
@Picknicker: I used a modified r6418 version (see above

)
Posted: 08 Sep 2006 16:36
by Brianetta
glx wrote:And don't forget the "package require Expect" at the beginning, it's needed for windows version.
I can forget it if I like - it's practically the first line I added when I began coding 2.0 (which is a complete rewrite). The new version has support for specifying the syntax of the command you use to start openttd, and ts output can be easily translated through the use of external language files (although it still currently requires an English language dedicated server).
I'll assume that this patch of yours might make it into the trunk and will add some line termination magic to the current design. At the moment, it pops up a message if you try to run it in Windows telling you it won't work, unless you add a specific option to the config file.
Posted: 09 Sep 2006 17:17
by glx
For windows users who don't want to apply my patch and compile, I made a little app that converts openttd.exe from GUI to console (and vice versa). Just run convert.exe in the same dir as openttd.exe. Works for all versions (nightlies and releases).
The source is included in the zip.
See
http://www.tt-forums.net/viewtopic.php?p=489470#489470 for windows compatible autopilot script and how to use it.
EDIT: new version attached. Now it really works with all openttd versions

(thx Ploes)
Posted: 10 Sep 2006 22:09
by Brianetta
2.0 is running on #openttdcoop's sandbox server right now. The code will be released to the public very soon, although it will be non-Windows only for the time being. I'm not releasing it tonight because I haven't transferred the documentation from paper to computer yet.
This version is significantly more complex than the old one, and requires documentation.
Posted: 11 Sep 2006 16:20
by Picknicker
Great

I wait impatiently.
I hope the new version works here with topical miniIN and nightly version.
Does somebody have here autopilott with a current version of MiniIn or nightly in use?
sorry for my bad english

Posted: 11 Sep 2006 16:30
by Brianetta
There's no real reason why it shouldn't work. I don't believe the miniIN has any major modifications to the dedicated server console.
Posted: 11 Sep 2006 16:47
by Picknicker
I do not know it, i have 2 Debian 3.1 Server
1.) i386 Pentium (local development)
2.) AMD64 (I-Net Server)
On both Server works autopilot with follow MiniIn archives:
change amd64 with i386 for Server 1.
Code: Select all
OTTD-dedicated-linux-amd64-MiniIN-r5476-MiniIN.tar.bz2
OTTD-dedicated-linux-amd64-MiniIN-r5530-MiniIN.tar.bz2
OTTD-dedicated-linux-amd64-MiniIN-r5588-MiniIN.tar.bz2
OTTD-dedicated-linux-amd64-MiniIN-r5722-MiniIN.tar.bz2
OTTD-dedicated-linux-amd64-MiniIN-r5838-MiniIN.tar.bz2
work not:
Code: Select all
OTTD-dedicated-linux-amd64-MiniIN-r6027-MiniIN.tar.bz2 <- Bad Version, i know
OTTD-dedicated-linux-amd64-MiniIN-r6028-MiniIN.tar.bz2
OTTD-dedicated-linux-amd64-MiniIN-r6134-MiniIN.tar.bz2
OTTD-dedicated-linux-amd64-MiniIN-r6362-MiniIN.tar.bz2
OTTD-dedicated-linux-amd64-MiniIN-r6401-MiniIN.tar.bz2
OTTD-dedicated-linux-amd64-MiniIN-r6403-MiniIN.tar.bz2
Otherwise, nothing was changed. I delete the old .cfg file after upgrade.
What should I else do?
Posted: 11 Sep 2006 17:08
by Brianetta
Bring it up with RichK67. I don't think this is an autopilot problem, if it's the same as the one you described last time.
Posted: 11 Sep 2006 17:39
by Picknicker
O.k. thx, I think this is an OpenTTD problem, with nightly its the self problem.
With whom does Nightly/MiniIn with autopilot work? Am I only with problems?
EDIT: sice Nightly r5953 work not with autopilot.
r5934 work correct with autopilot.
All Version MiniIn/Nightly work without autopilot perfectly.
Posted: 12 Sep 2006 00:31
by osai
We are running running our servers with autopilot and nightly r6280 and we dont have any problems!
But Brianetta did all the work

Posted: 12 Sep 2006 00:32
by Brianetta
OK, it's out.
Attached to the first post of this thread is the brand spanking new and shiny autopilot version 2.0
It's half one in the morning, and I'm tired, ao I am bound to have forgotten something important. If you find out what it is, please let me know.
It's all practically untested. It should work on a (properly modified) Windows version of OpenTTD. it should definitely work on Linux, BSD ans Mac OS X. Of course, there were a couple of last minute minor, nay, trivial, changes that I made. As a result it might not work at all, but as I said, I'm tired.
There's a manual
here. It's probably not as helpful as it seemed to me when I wrote it, but then, I am tired and I just finished it.
Well, there you go, folks. 2.0. Give it a go, and if you find bugs please tell me all about it.
Posted: 12 Sep 2006 01:06
by DaleStan
From a quick read-through, the docs look fine to me.
Posted: 12 Sep 2006 03:13
by glx
I made some changes and now it works fine on windows

(using my
patch or the
convert tool)
Posted: 12 Sep 2006 07:30
by Picknicker
osai wrote:We are running running our servers with autopilot and nightly r6280 and we dont have any problems!
But Brianetta did all the work

Under which OS runs the server?
Can you say to me which version of Expect works?
thx

Posted: 12 Sep 2006 08:03
by Brianetta
glx: That diff is interesting. Has starting_date in the config file really been replaced with starting_year? In which revision did this happen? I'm confused.
Is it actually necessary to include the -d to get the the Windows version's output to be read correctly? openttd -h and openttd -d -h are identical in Linux, so if this is the case I shall incorporate this change in the code.
I'll test your changes to the expect strings for loading in the maximum companies variable, etc. If they work with the Linux version, I shall keep the changes in there.
The final change, mapping \n to \r, is messy. There must be a better way of doing that, because in Windows when you press return you are, in fact, sending both (it's the user's own input that you are altering there, not autopilot's output). Mapping one to the other, as you have done, will send the enter key twice after each manually entered command at the console.
Posted: 12 Sep 2006 09:56
by Brianetta
Brianetta wrote:glx: That diff is interesting. Has starting_date in the config file really been replaced with starting_year? In which revision did this happen? I'm confused.
OK, I've just learnt that this changed in revision 5915. Furthermore, I have found that the old value of starting_date is simply discarded and the new starting_year is initialised at 1950 if an old openttd.cfg file is used.
This is lame behaviour, and the dev in question should hang their head in shame.
I've updated the file in the original post. It should work on all platforms. Most of glx's changes were used, the rest were implemented but in a slightly different way. Thanks, glx.
Posted: 12 Sep 2006 10:37
by richk67
Brianetta - also notice that the date format changed at r5999.

Posted: 12 Sep 2006 11:23
by Brianetta
[11:16] <rachel> Starting year is 1970
That's pretty much all autopilot uses it for, so the format isn't that important. What did surprise me is that using the config file from my nightly started the game at 1950, which is almost 30 years later than intended. (:
Posted: 12 Sep 2006 16:26
by Brianetta
New bugfix release - 2.0.2 is out, and on the first post.
Many thanks to glx for working with me on this one. We have code here which will run on a glx-patched Windows server with ActiveTcl, and a regular unix-style server with regular (sourceforge) Tcl and Expect.
It's all good. There are a couple of servers running with autopilot at the moment. If anybody has trouble setting up the database module, or setting up a web based chat viewer application, do let me know - I make huge assumptions about people's ability with MySQL, and it's not obvious at first glance how it goes together.
A web based set of PHP scripts for the database stuff is on my to-do list, but it's not at the top. I'm also looking at the feasibility of putting this thing in a revision control mechanism of some sort, so that others can collaborate on it.