Skip to content

vars

The vars table allows you to manipulate and manage FantasyVars.

moonlight.vars.add

Parameters

  • string name
  • string/number value
  • optional boolean is_float
  • optional boolean protected_flag

Returns

  • string/number - The value of the FantasyVar.

Remarks

  • You can change the value of an already added FantasyVar by using this function. Moonlight will automatically detect if the FantasyVar exists and will update its value.
  • If the protected flag is set to true, the FantasyVar will not save in your configuration.

moonlight.vars.get

Parameters

  • string name

Returns

  • string/number - The value of the FantasyVar.

moonlight.vars.set

Parameters

  • string name
  • string/number value

Returns

  • string/number - The value of the FantasyVar.

Remarks

  • This function will not add a new FantasyVar. Use moonlight.vars.add instead.

moonlight.vars.save

Parameters

  • optional string file

Remarks

  • This is the function to save your configuration.
  • If you do not include an argument for the file parameter, it will save your configuration to the default location.

moonlight.vars.load

Parameters

  • optional string file

Remarks

  • This is the function to load your configuration.
  • If you do not include an argument for the file parameter, it will load your configuration from the default location.

moonlight.vars.dump

Returns

  • string

Remarks

  • This will create a JSON dump of all the FantasyVars.
  • This dump is exactly what you will find in every configuration file. This simply returns it as a string.