Complete.Org: Mailing Lists: Archives: freeciv-dev: April 2005:
[Freeciv-Dev] (PR#12706) Events framework
Home

[Freeciv-Dev] (PR#12706) Events framework

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: per@xxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#12706) Events framework
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Sun, 3 Apr 2005 11:32:10 -0700
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12706 >

Hello,

Here is a small Lua toy that you may find interesting. Basically it
allows running Lua commands via the civserver console. I also made a
couple of custom Freeciv functions that will be acessible from Lua.
Including:

* log (logs messages to the console)
* notify (sends a message to a nation)

* foundNewTech(gives a nation a new tech)
* changeGold(modifies a nation's gold by a certain amount)

To try it out:

1) Get Lua from:
   http://www.lua.org/ftp/lua-5.0.2.tar.gz

2) cd freeciv/

3) tar zxvf lua-5.0.2.tar.gz

4) mv lua-5.0.2 lua

5) gzip -dc lua.diff.gz | patch -p0

6) ./autogen.sh

7) make

A small demo:
Run civclient; Start New Game; Start; choose the Romans; press Ok;
Open the Science report by pressing F6.

Then type these lines in the client chatline:

1) /run foundNewTech("Roman", "Gunpowder")
2) /run changeGold("Roman", 100)
3) /run notify("Roman", "*** Hello World! ***")

Have fun using your new cheat module!

Attachment: lua.diff.gz
Description: GNU Zip compressed data


[Prev in Thread] Current Thread [Next in Thread]