PDA

View Full Version : Available Lua Standard Libraries



st4lk3r87
August 31st, 2018, 21:57
The current documention related to FG Scripting (https://www.fantasygrounds.com/modguide/scripting.xcp) says: "math", "string" and "table" are the standard libraries available.
The combat timer extension (https://www.fantasygrounds.com/forums/showthread.php?30856-Combat-Timer-Extension-(v-0-0-1)) is using the "os" library.

So my question is. Is the wiki outdated? Are there other libraries/functionalities I can use as a dev?

Thank you! :)

damned
September 1st, 2018, 00:32
The current documention related to FG Scripting (https://www.fantasygrounds.com/modguide/scripting.xcp) says: "math", "string" and "table" are the standard libraries available.
The combat timer extension (https://www.fantasygrounds.com/forums/showthread.php?30856-Combat-Timer-Extension-(v-0-0-1)) is using the "os" library.

So my question is. Is the wiki outdated? Are there other libraries/functionalities I can use as a dev?

Thank you! :)

Primarily the listed ones are the ones that are available.
The author of the Combat Timer found a specific function in os that was used elsewhere and exploited.
Im sure there may well be a couple of others but the ones listed in the wiki were the ones that were deliberately exposed to the rest of us.

st4lk3r87
September 1st, 2018, 00:36
Primarily the listed ones are the ones that are available.
The author of the Combat Timer found a specific function in os that was used elsewhere and exploited.
Im sure there may well be a couple of others but the ones listed in the wiki were the ones that were deliberately exposed to the rest of us.

Thank you damned. So, can I say: "It's not safe to use those exploited functions cause they may change without breaking-changes advice" ?

damned
September 1st, 2018, 00:40
Thank you damned. So, can I say: "It's not safe to use those exploited functions cause they may change without breaking-changes advice" ?

The reason (or at least a reason) not all libraries are exposed is to prevent (or at least minimise) anyone doing anything malicious with a ruleset or extension.
If you found a routine or function used in one of the official rulesets you can probably safely reuse it.

st4lk3r87
September 1st, 2018, 01:03
The reason (or at least a reason) not all libraries are exposed is to prevent (or at least minimise) anyone doing anything malicious with a ruleset or extension.
If you found a routine or function used in one of the official rulesets you can probably safely reuse it.

Yes, I'm aware of it. I think it's a wise decision.
Less freedom for "lawful good" developer unfortunately :D

Moon Wizard
September 1st, 2018, 04:24
Try this more updated developer guide page:

https://www.fantasygrounds.com/wiki/index.php/Developer_Guide_-_Rulesets_-_Scripting#Fantasy_Grounds_Specific_Lua_Changes

Cheers,
JPG