Package 'Expect' for AutoPilot on Windows

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Package 'Expect' for AutoPilot on Windows

Post by petert »

Hi all,
Whilst trying to set up AutoPilot for Windows, I've stumbled upon an error.

Background:
I checked out the source for AutoPilot, then I started to get all the needed packages. I've already installed ActiveTCL, with success. Then, I went into my MinGW/MSYS bash and typed "./autopilot.tcl", which is where I got the error:

Code: Select all

can't find package Expect
    while executing
"package require Expect"
    (file "./autopilot.tcl" line 23)
It's easy enough to understand what this error meant, just that I don't have Expect installed in a place that MSYS could find/understand. Then, I was told to go to a help page called "Where is Expect?" to look for help. I read some of the comments and found one that was helpful, it told me to type the following in normal command:

Code: Select all

teacup install Expect
This installed Expect, but MSYS still could not find this installation. After this, I did a system-wide search for "Expect" and found the installation location from the teacup command. I then added this installation location to my $PATH environment variable. Still no good.

After that is when I took a new approach...double-clicking on autopilot.tcl to try and start it. It worked much better then in MSYS, the error complaining about the package Expect was gone and it moved on to other errors which I proceeded to fix (see attached diff below for one fix for Windows systems). It worked well, I was even able to run a test server.

Question: After all this, here is my question. Does anyone know of a way to get the Expect package installed and working in an MSYS enviornment? I would prefer MSYS then regular TCL, but then I can have debug outputs in the MSYS window.

Thanks, Peter

Credits: Big thanks to Ammler on IRC today, without his help I wouldn't have gotten anywhere. Also thanks to people at #openttd.
Attachments
windows_fix.diff
(392 Bytes) Downloaded 145 times
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Package 'Expect' for AutoPilot on Windows

Post by petert »

I've tried again today and I've had a bit more success. This time I used the command "tclsh autopilot.tcl" and that got the server running, but I continued to have this error:

Code: Select all

Peter@PETER-PC ~/ap+
$ tclsh autopilot.tcl 
[::ap::config] Language package successful loaded: en
Autopilot engaged
Starting new game: ''
Landscape: temperate
Dimensions: 256x256
Starting year: 1950
invalid command name "spawn"
    while executing
"spawn ./openttd -c openttd.cfg -D"
    ("eval" body line 1)
    invoked from within
"eval "spawn $command""
    (procedure "::ap::game::start" line 2)
    invoked from within
"::ap::game::start $commandline"
    invoked from within
"set ds [::ap::game::start $commandline]"
    (file "autopilot.tcl" line 119)
I don't really understand where this is coming from, any ideas?
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 13 guests