|  Developer
Updated on May 17, 2022

generate_item_dictionary_number_id()

  • Generates free number key for specific dictionary item in specific range
Edit

  • params: item_id (string), min_id (int), max_id (int)
  • return: item_dictionary_id (int) or nil if no free ids in the range.
Edit
				
					require "core"

item_id = "1234abcd"

item_dictionary_id = core.generate_item_dictionary_number_id(item_id, 1, 10)
print(item_dictionary_id) -- output: 1

core.update_item_dictionary_value( item_id, tostring(item_dictionary_id), "value1" )

item_dictionary_id = core.generate_item_dictionary_number_id(item_id, 1, 10)
print(item_dictionary_id) -- output: 2