Type function Library gamecircle.* Return value None Revision Release 2022.3683 Keywords Low, List, SyncableNumberList, Whispersync
Add a value to a LowNumberList. If the number is lower than the highest number stored in the list, then it will be added. And then, if the list exceeds it's maximum length, the number that is currently highest in the whole list will be trimmed off.
gamecircle.Whispersync.AddToLowNumberList(key, value, NT_constant) gamecircle.Whispersync.AddToLowNumberList(key, value, NT_constant, metadata)
String. The key used to access a specific lowest number.
Number. The value to be assigned to the lowest number.
String. The NT_constant, which is either "INT" or "DOUBLE", determins how the lowest number will be stored. "INT" cutt off the decimal value. "DOUBLE" maintain the decimal value intact. If the string given is invalid, "INT" will be used by default.
Metadata. A table of metadata to be stored with the number. It must be a lua table comprised only of string fields with string values in those fields. For examples and more information, check the documentation page for metadata.
local lowListKey = "myFirstLowNumberList" local gamecircle = require("plugin.gamecircle") gamecircle.Init(false, false, true) gamecircle.Whispersync.SetLowNumberListLength(lowListKey, 4) gamecircle.Whispersync.AddToLowNumberList(lowListKey, 10, "INT") gamecircle.Whispersync.AddToLowNumberList(lowListKey, 1000, "INT") gamecircle.Whispersync.AddToLowNumberList(lowListKey, 1, "INT") gamecircle.Whispersync.AddToLowNumberList(lowListKey, 10000, "INT") gamecircle.Whispersync.AddToLowNumberList(lowListKey, 100, "INT") print("Here is the list of numbers as they are stored in the low number list. They should be in the order from lowest to highest.") local lowList = gamecircle.Whispersync.GetLowNumberList(lowListKey) for i,entry in ipairs(lowList) do print("-" entry.value) end local keys = gamecircle.Whispersync.GetLowNumberListKeys() for i,key in ipairs(keys) do print("-" .. key) end