Freeciv-server and lua scripts.

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.
Posts: 428
Joined: Sat May 04, 2013 2:19 pm

Freeciv-server and lua scripts.

Postby Lachu » Sat Jul 01, 2017 11:38 am

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

User avatar
Posts: 327
Joined: Mon Dec 23, 2013 3:13 am
Location: Hamburg

Re: Freeciv-server and lua scripts.

Postby dunnoob » Wed Sep 13, 2017 2:42 am

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 )

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