OSRS Plugin API
    Preparing search index...

    Function setValue

    • Stores a key-value pair into the internal database and invokes a callback. Key-Value pairs are unique to the current plugin and overwrite if a duplicate key is provided. Overwriting an existing key with a nil value deletes the entry from the database.

      Parameters

      • key: string

        The unique string used as a key to index the value provided.

      • value: any

        The value that is stored to database and associated with the provided key.

      • callback: setValueCallback

        The callback function that is invoked with a boolean representing whether the value was successfully set.

      Returns void

      -- Invoke the Set Function
      osrs.Persistence.setValue("Example Key", "Example Value",
      function(key, success)
      if(success) then
      osrs.print("Set Value succeeded.")
      else
      osrs.print("Set Value failed.")
      end
      end
      )