OSRS Plugin API
    Preparing search index...

    Interface ConfigDecoders

    This interface allows decoding of information within our client configs, providing various information depending on the type decoded. The IDs for various aspects can be found in the osrs.gamevals global table, such as osrs.gamevals.objtypes., osrs.gamevals.dbrowtypes., etc.

    interface ConfigDecoders {
        decodeAllChildDBTables(tableID: number): DBRowType[];
        decodeDBRow(rowID: number): DBRowType;
        decodeLocType(locID: number): LocType;
        decodeNpcType(npcID: number): NpcType;
        decodeObjType(objID: number): ObjType;
        decodeSingleDBColumn(
            rowID: number,
            columnID: number,
        ): string | number | boolean | any[];
    }
    Index

    Methods

    • Decodes and returns ALL DBRows that use the same parent table.

      Parameters

      • tableID: number

        Parent table ID, can be found in osrs.gamevals.dbtabletypes.*

      Returns DBRowType[]

      local dbTableIDs = osrs.gamevals.dbtabletypes
      local musicDBRows = osrs.Engine.Decoders.decodeAllChildDBTables(dbTableIDs.music)
      for key, value in pairs(musicDBRows) do
      osrs.print(key)
      end
    • Decodes and returns all the available information of a given DBRow in the form of a table. Each DBRow is structured differently and not all the information is available to the client.

      Parameters

      • rowID: number

        The ID of the DBRow to decode.

      Returns DBRowType

      local seventhRealmMusic = osrs.Engine.Decoders.decodeDBRow(osrs.gamevals.dbrowtypes.music_7th_realm)
      local musicColumns = osrs.gamevals.dbtabletypes.music
      --The table will be returned with the keys being the column names, if you know these you can access directly via
      osrs.print(seventhRealmMusic.sortname)
      --Otherwise you can also use the dbtabletypes to get these column names
      osrs.print(seventhRealmMusic[musicColumns[1]])
    • Return a table of information decoded from Loc configs.

      Parameters

      • locID: number

        The ID of Loc to decode.

      Returns LocType

      local loc = osrs.Engine.Decoders.decodeLocType(osrs.gamevals.loctypes.poh_portal_teak_empty)
      osrs.print("Name: ", loc:getName())
      osrs.print("Width: ", loc:getWallWidth())
      local locParams = loc:getParams()
      for key,value in pairs(locParams) do
      osrs.print("Key: " .. key .. ", Value: " .. value )
      end
    • Returns a table of information decoded from Npc configs

      Parameters

      • npcID: number

        The ID of npc to decode.

      Returns NpcType

      local lesserdemon = osrs.Engine.Decoders.decodeNpcType(osrs.gamevals.npctypes.lesser_demon)

      if lesserdemon:getSize() > 1 then
      osrs.print("You should try a scythe.")

      if string.find(lesserdemon.deathdrop, "bone") then
      osrs.print("Grab that bonecrusher!")
      end

      for key, value in pairs(lesserdemon:getParams()) do
      osrs.print(key .. ", " .. value)
      end
    • Returns a table of information decoded from Obj configs

      Parameters

      • objID: number

        The ID of Obj to decode.

      Returns ObjType

      local ironSword = osrs.Engine.Decoders.decodeObjType(osrs.gamevals.objtypes.iron_sword)

      if not ironSword:getParams().demonbane then
      osrs.print("Does not have DemonBane")

      if ironSword:getName() == "Iron sword" then
      osrs.print("Is Iron Sword")
      end
    • Decodes a single column of a DBROW and get whatever value(s) are in it. Useful for runtime retrievals so the whole table doesn't need to be rebuilt.

      Parameters

      • rowID: number

        DBRow you want to access.

      • columnID: number

        The column of respective DBRow you want.

      Returns string | number | boolean | any[]

      local musicDuration = osrs.Engine.Decoders.decodeSingleColumn(osrs.gamevals.dbrowtypes.music_7th_realm, osrs.gamevals.dbtabletypes.music.duration)