[CF-Devel] Client scripting interface

crossfire-devel-admin at archives.real-time.com crossfire-devel-admin at archives.real-time.com
Sun Sep 14 14:41:04 CDT 2003


A number of players have wanted to be able to automate tasks that are too
complicated for key bindings.  I know several have made special-case
modifications to their clients.  Others have written special client
programs for completely-automated characters.  What I thought would be most
useful in this area would be a general interface between the client and
scripts, so that's what I wrote.

My scripting interface works by adding a new client-side command: "script."
A player will issue a command like "script unlock containers" which will
cause the client to fork/exec a new process named "unlock" with the
command-line parameter "containers."  The stdin and stdout of the new
process are a socket that is managed by the client.

The script issues commands to the client by echoing them to stdout, and the
client sends information to the script as lines of text on its stdin.
Hence, scripts can be written in any language.

The script can issue commands to request information from the client (like
a copy of the inventory), to watch for selected commands from the server,
to send a command to the server, or to monitor the commands being sent by
the client.

There are a few things not working yet (like having the client send map
data), but it's working for me--I wrote a script to unlock all my
containers, empty them, identify everything, then re-lock them.

The patch can be downloaded from 
     
     http://www.crowcastle.net/cf/
     
     
It can be applied with something like:
   cd ..../client
   gunzip client_scripting-1.0-patch.gz | patch --strip=1


Any comments on the idea/implementation?

And the big question: Is this something that I should check in, or is
something we don't want players using?  (I could see it being abused to
gain non-combat experience, automatically drink healing potions as needed,
and things like that, as well as more mundane tasks such as inventory
management.)

--PC

_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list