Class Teleporter

java.lang.Object
privbot.hooks.Teleporter

public final class Teleporter extends Object
Teleport actions: casting teleport spells, using teleport tabs, and item-based teleports.

Teleport tabs are inventory items with a "Break" action (option index 1 = CC_OP id 2 for Orion/NR, ITEM_FIRST_OPTION for Roat/Impact/SpawnPK). Using

invalid reference
PrivItem#interact(String)
is the cleanest path; this hook wraps it for convenience.
  • Method Details

    • castTeleport

      public boolean castTeleport(String name)
    • teleportToItem

      public boolean teleportToItem(int itemId)
      Activates the first inventory item matching itemId using its primary action ("Rub", "Break", "Activate", etc. — whatever option index 1 maps to for that item). Works for teleport tabs, jewellery, and any single-click teleport item.
    • teleportToItem

      public boolean teleportToItem(int itemId, String action)
      Uses a teleport item with a specific action label (case-insensitive). Useful when the primary action is not "Break" (e.g. "Rub" for amulets, "Activate" for tablets).
    • teleportToItem

      public boolean teleportToItem(String name)
      Breaks (or otherwise activates) the first inventory item matching name.
    • teleportToItem

      public boolean teleportToItem(String name, String action)
      Uses the first inventory item matching name with action ("Rub", "Break", "Activate", …).
    • useScrollOfRedirectedTeleport

      public boolean useScrollOfRedirectedTeleport()
      Uses a Scroll of Redirection (item 12403) from inventory with the "Use" action. Typically requires another item to be selected first.
    • transport

      public boolean transport(String movementEntryName, String... widgetTexts)
      Uses a movement-catalog transport or NPC entry, then clicks an exact widget path. Example: ctx.teleporter.transport("Glider", "Bosses", "Godwars").
    • transport

      public boolean transport(TransportRequest request)
      Same as transport(TransportRequest, PrivTaskContext) without a task context (widget ready-waits poll on the ClientThread).
    • transport

      public boolean transport(TransportRequest request, PrivTaskContext taskCtx)
      Uses a movement-catalog transport or NPC entry, then clicks an exact widget path. Prefers direct object/NPC interaction and can optionally fall back to a legacy workflow.
      Parameters:
      taskCtx - when non-null and the caller is not on the game thread, pauses between widget steps use PrivTaskContext.sleepUntil(BooleanSupplier, int) (same as ctx.sleepUntil in task nodes) so waits follow the script-thread model.
    • hasMovementEntry

      public boolean hasMovementEntry(String movementEntryName)
      True when the current server's movement catalog contains a transport/NPC entry with this name.