OSRS Plugin API
    Preparing search index...

    Function retrieveIfType

    • Function used to retrieve an IfType identified by its group and component Id.

      Parameters

      • groupId: number

        The IfType group identifier.

      • componentId: number

        The identifier for the IfType within its group. Components are 0-indexed because they match up with internal enums, and you may want to use enums from inside iftypes["yourinterface"] rather than raw numbers. But note that "component 0" will be the same component that you get from ifGroup.components[1].

      Returns osrs.IfType

      local comp = osrs.IfType.retrieveIfType(osrs.gamevals.iftypes["chatbox"].id, 0)
      local msgtype = (comp == nil) and "nil" or osrs.IfType.IfTypes[comp.type]
      osrs.printf("Type of component 0 in chatbox is %s", msgtype)