Dedicated server autopilot (current version: 2.0.4)
Moderator: OpenTTD Developers
-
- Engineer
- Posts: 20
- Joined: 31 Aug 2006 15:28
It was necessary. exp_send_user() works with \n but exp_send() needs \r.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.
I did that because exp_send() needs to send a \r after the command. With the parentheses, I skip the \nBrianetta wrote: Any reason why you changed the expect_out array index from 0 to 1 and added parentheses?

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

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).glx wrote:And don't forget the "package require Expect" at the beginning, it's needed for windows version.
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.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
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)
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

- Attachments
-
- convert.zip
- converts openttd.exe from GUI to console and vice versa
- (3.55 KiB) Downloaded 964 times
Last edited by glx on 16 Sep 2006 00:48, edited 1 time in total.
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.
This version is significantly more complex than the old one, and requires documentation.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
-
- Engineer
- Posts: 20
- Joined: 31 Aug 2006 15:28
-
- Engineer
- Posts: 20
- Joined: 31 Aug 2006 15:28
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.
work not:
Otherwise, nothing was changed. I delete the old .cfg file after upgrade.
What should I else do?
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
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
What should I else do?
-
- Engineer
- Posts: 20
- Joined: 31 Aug 2006 15:28
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.
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.
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.
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.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
From a quick read-through, the docs look fine to me.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
- Attachments
-
- autopilot.diff
- changes for windows
- (2.2 KiB) Downloaded 398 times
-
- Engineer
- Posts: 20
- Joined: 31 Aug 2006 15:28
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.
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.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
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.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.
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.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Brianetta - also notice that the date format changed at r5999. 

OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
[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. (:
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. (:
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
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.
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.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
Who is online
Users browsing this forum: No registered users and 16 guests