Class BreakConditions


  • public class BreakConditions
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      BreakConditions()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static BreakCondition atSpecificTime​(int hourOfDay, int minute)
      Breaks at a specific time of day.
      static BreakCondition customCondition​(java.util.function.Supplier<java.lang.Boolean> shouldBreakCheck, java.lang.String reason)
      A custom break condition which can include any logic
      static BreakCondition onExperienceGained​(net.runelite.api.Client client, net.runelite.api.Skill skill, int expThreshold)
      Breaks when experience gained exceeds a threshold.
      static BreakCondition onLevelReached​(net.runelite.api.Client client, net.runelite.api.Skill skill, int targetLevel)
      Breaks when a specific skill reaches a target level.
      static BreakCondition onMaterialDepleted​(Context ctx, int itemId)
      Breaks when items in the bank run out (e.g., materials).
      static BreakCondition runOnce​(BreakCondition condition)
      Wraps a condition to ensure it only triggers once per session.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BreakConditions

        public BreakConditions()
    • Method Detail

      • onLevelReached

        public static BreakCondition onLevelReached​(net.runelite.api.Client client,
                                                    net.runelite.api.Skill skill,
                                                    int targetLevel)
        Breaks when a specific skill reaches a target level.
        Parameters:
        client - RuneLite Client
        skill - The Skill to track levels for
        targetLevel - The target level for when the break should occur when reached.
        Returns:
        BreakCondition
      • onExperienceGained

        public static BreakCondition onExperienceGained​(net.runelite.api.Client client,
                                                        net.runelite.api.Skill skill,
                                                        int expThreshold)
        Breaks when experience gained exceeds a threshold.
        Parameters:
        client - RuneLite client
        skill - The target skill for exp tracking
        expThreshold - The amount of exp needed to trigger the break
        Returns:
        BreakCondition
      • customCondition

        public static BreakCondition customCondition​(java.util.function.Supplier<java.lang.Boolean> shouldBreakCheck,
                                                     java.lang.String reason)
        A custom break condition which can include any logic
        Parameters:
        shouldBreakCheck - Supplier which returns a boolean. When true a break will occur.
        reason - The plain text reason for the break
        Returns:
        BreakCondition
      • runOnce

        public static BreakCondition runOnce​(BreakCondition condition)
        Wraps a condition to ensure it only triggers once per session. Useful for conditions like Level Reached or Material Depleted to prevent break loops.
        Parameters:
        condition - The condition to wrap
        Returns:
        A new BreakCondition that only returns true once.
      • onMaterialDepleted

        public static BreakCondition onMaterialDepleted​(Context ctx,
                                                        int itemId)
        Breaks when items in the bank run out (e.g., materials).
        Parameters:
        ctx - The API game context
        itemId - The item id to track. When this item is no longer present in the bank or your inventory, a break will be taken.
        Returns:
        BreakCondition
      • atSpecificTime

        public static BreakCondition atSpecificTime​(int hourOfDay,
                                                    int minute)
        Breaks at a specific time of day.
        Parameters:
        hourOfDay - The hour 0-24 of the day when a break should initiate
        minute - The minute of the hour 0-60 when a break should initiate
        Returns:
        BreakCondition