Class Production

java.lang.Object
privbot.hooks.Production

public final class Production extends Object
Create/make an item via the standard skill-creation interface (smithing/anvil, cooking, fletching, crafting, …). Reusable by any skilling plugin.

v1 targets the standard creation menu: optionally use an item on an object to open it (Production.Make.openWith(int, String)), then click the product row with a "Make all"/quantity option (text-driven via Widgets), with a Dialogue option-list fallback for servers that render products as a chat-style option list. Exotic interfaces fall back to a recorded sequence (see recordedFallbackName(String) — wired through the action executor's PLAY_RECORDING path).

Blocking — drives interaction + settle on a worker thread (sleeps), with each client touch marshalled via GameThread.ensure(java.util.function.Supplier<T>, T).

MAKE-interface assumptions:

  • Standard OSRS/RSPS creation interface uses widget groups 270, 446, 271, 309 — the product row's text matches the product name (partial/contains), and the row's actions include "Make all" or "Make N". If none of these groups are visible and the dialogue option-list fallback also misses, Production.Make.run() returns false and the caller must drive a recorded action sequence.
  • The OSRS creation interface group 270 is the canonical shape; group 446 is used by some RSPS forks. This is a best-effort scan — if the target server uses a non-standard group ID, add it to CREATION_GROUPS.
  • Method Details

    • offeredItemIds

      public List<Integer> offeredItemIds()
      Exact product IDs currently offered by Elorin's native creation menu; empty when closed.
    • createItem

      public boolean createItem(int itemId)
      Select one currently offered product. Dispatch only; callers must confirm the inventory output.
    • make

      public Production.Make make(String product)
      Begin a make request for product (e.g. "Steel platebody").
    • isCreationMenuOpen

      public boolean isCreationMenuOpen()
      True when a known creation interface is currently visible.
    • options

      public List<String> options()
      Product names visible in the currently-open creation interface (best-effort). Falls back to the dialogue option list when the standard widget interface is absent (some servers render products as chat-style options).
    • recordedFallbackName

      public static String recordedFallbackName(String product)
      Recommended recorded-action name to fall back to when the standard interface is absent.