Home

Module news

Lua bindings to interact with the news. This will allow you to interact and manipulate the in-game news.

Functions

news.__eq (s, comp, a1, a2) Check articles for equality.
news.add (s, faction, title, content, date_to_rm, date) Adds an article.
news.bind (a) Tags an article or a table of articles with a string.
news.date (a) Gets the article date.
news.desc (a) Gets the article description.
news.faction (a) Gets the article faction.
news.get (characteristic) Gets all matching articles in a table.
news.rm (Lua_article) Frees an article or a table of articles.
news.title (a) Gets the article title.


Functions

news.__eq (s, comp, a1, a2)
Check articles for equality. Allows you to use the '=' operator in Lua with articles.

Parameters

  • s:
  • comp:
  • a1: article 1
  • a2: article 2

Return value:

true if both systems are the same.
news.add (s, faction, title, content, date_to_rm, date)
Adds an article.

Parameters

  • s:
  • faction: faction of the article, "Generic" for non-factional
  • title: Title of the article
  • content: What's in the article
  • date_to_rm: date to remove the article
  • date: What time to put, defaults to current date, use 0 to not use a date

Usage

  • news.add(faction,title,body,[date_to_rm, [date]])
  • s = news.add( "Empire", "Hello world!", "The Empire wishes to say hello!", 0 ) -- Adds an Empire specific article, with date 0.

Return value:

The article matching name or nil if error.
news.bind (a)
Tags an article or a table of articles with a string.

Parameters

  • a: article to get the faction of
news.date (a)
Gets the article date.

Parameters

  • a: article to get the date of

Return value:

date
news.desc (a)
Gets the article description.

Parameters

  • a: article to get the desc of

Return value:

desc
news.faction (a)
Gets the article faction.

Parameters

  • a: article to get the faction of

Return value:

faction
news.get (characteristic)
Gets all matching articles in a table.

Parameters

  • characteristic: characteristic to match, or no parameter for all articles

Return value:

a table with matching articles
news.rm (Lua_article)
Frees an article or a table of articles.

Parameters

  • Lua_article: article to free
news.title (a)
Gets the article title.

Parameters

  • a: article to get the title of

Return value:

title

Valid XHTML 1.0!