Page 1 of 1

Freeciv-server and lua scripts.

Posted: Sat Jul 01, 2017 11:38 am
by Lachu
Have freeciv-server integrated lua script engine, but not related to ruleset? I ask to run script written by someone with hack access, which server would execute on some event. I must tell idea about simpleparser make me invented idea about not-ruleset-related-scripting.

For what it could been used? That's the answer:
1) Send scripts to vote by players, like currently some options can be voted. Because not everybody are developer, so simpeparser could be helpful.
2) Debugging server

Re: Freeciv-server and lua scripts.

Posted: Wed Sep 13, 2017 2:42 am
by dunnoob
Lachu wrote:Have freeciv-server integrated lua script engine, but not related to ruleset?
The FCDB stuff is for server operators (user management with SQLite and other databases.)

AFAIK the Lua IO and OS libraries are not available, otherwise you can start scripts or Lua one-line commands on the server command line (server command /lua, maybe this needs hack access rights):
/lua cmd line runs a one-line script, /lua file name runs name.lua, and just for fun I created a file .lua in the data path started with /lua file consisting of two lines:

Code: Select all

notify.event( nil, nil, E.CHAT_MSG, '[c fg="#006400"].lua: %s with %s[/c]', fc_version(), _VERSION )
signal.list()                                                                                     

Also see the examples on the Wiki, but I fear it doesn't help for your ideas.