Ooops, didn't pay attention to the openttd.cfg file. When restarting the server, it wrote it current settings to it, overwriting my admin password.
I can connect now to the interface, but now I'm really lost. How can I receive chat and send pause commands? The source code tells me nothing anymore. I tried
Code: Select all
from libottdadmin2 import *
from libottdadmin2.adminconnection import *
from libottdadmin2.client import *
A = AdminConnection();
A.port = 3977
A.host = '127.0.0.1'
A.password = 'blabla'
A.connect()
C = AdminClient(A)
but this gives me the error
Code: Select all
Traceback (most recent call last):
File "bot.py", line 12, in <module>
C = AdminClient(A)
TypeError: __init__() takes exactly 1 argument (2 given)
When I do not pass the Client the connection, no exception is thrown, but it doesn't make sense to me that the connection is not needed. After all, the poll command doesn't work either way.
Also, I don't know how to go from there, I've never used event handlers.
I really could use an example
