polserver/testsuite/testclient/pyuo
turleypol 5bd71ae8ee
Non blocking gump cmd (#871)
* refactor gump pkt creation

* testclient returns buttonid 1 pressed when 'button' is contained in the
commands

* extended test

* cleanup destructor mess a bit

* store gumps as pair to decide if the executor needs to be revived
more refactoring

* disallow copy, if used creates nasty bugs

* helper method to convert imp to character

* gumpevent

* new non-blocking dialog function, sends event instead

* test closegump

* test if serialnumber gets correctly converted and invalid entries get
skipped

* removed unused BApplicPtr class
added BApplicObjBase to impptrIf convert function

* use impptrIf

* CloseGump accepts now also an array of characters
extended tests

* moved deleted copy constructor to the public part

* by default clang tidy will check .inc files, removed this filter

* the last tidy run with modernize-loop wasnt added to the PR check

* keep vector with chr and gumpid per uomod
to prevent growing dont add to the cache if same chr with same id
already exists.

* docs

* core-changes
2026-03-16 08:11:43 +01:00
..
pyuo Non blocking gump cmd (#871) 2026-03-16 08:11:43 +01:00
.gitignore Testclient (#390) 2021-03-25 19:26:09 +01:00
LICENSE Testclient (#390) 2021-03-25 19:26:09 +01:00
README.md Testclient (#390) 2021-03-25 19:26:09 +01:00
terminal.py made ui version of the testclient work again (#837) 2026-01-02 14:00:46 +01:00
testclient.cfg Testclient (#390) 2021-03-25 19:26:09 +01:00
testclient.py Non blocking gump cmd (#871) 2026-03-16 08:11:43 +01:00

Build Status

pyuo

A text-only UO client written in Python Copyright (C) 2015-2016 Gabriele Tozzi

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

System Requirements

  • Python 3.4+

Archive content

Examples:

  • spary.py is a very simple draft of a script using this client
  • terminal.py is curses-based interactive command line client

The library itself is contained in the pyuo folder:

  • brain.py contains the classes useful for writing your scripts
  • client.py contains the client classes

How to use this stuff

Just start terminal.py and play with it or create your own script.

Here is a very minimal draft:

from pyuo import client
from pyuo import brain

class MyBrain(brain.Brain):
    ''' Override the base brain's methods to do your fancy things '''

if __name__ == '__main__':
    # Create a new client
    client = client.Client()
    # Connect to the server, get list of available servers
    servers = cclient.connect(ip_or_host, port, username, password)
    # Select first server, get list of characters
    chars = client.selectServer(servers[0]['idx'])
    # Select first character
    client.selectCharacter(chars[0]['name'], 0)
    # Finally start the main ai loop and enter it
    MyBrain(client)