Module net.botwithus.rs3
Class ComponentQuery
java.lang.Object
net.botwithus.rs3.game.queries.builders.components.ComponentQuery
- All Implemented Interfaces:
BiPredicate<MemoryLayoutPREVIEW,,MemorySegmentPREVIEW> QueryBuilderPREVIEW
ComponentQuery relies on preview features of the Java platform:
ComponentQueryrefers to one or more preview APIs:MemoryLayout,MemorySegment.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
-
Field Summary
Fields inherited from interface net.botwithus.rs3.game.queries.builders.QueryBuilderPREVIEW
DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionalpha(int alpha) @NotNull ComponentQueryand(@NotNull BiPredicate<? super MemoryLayoutPREVIEW, ? super MemorySegmentPREVIEW> other) componentIndex(int... indices) font(int fontId) int[]Filters component if they have default option, eg close, select etchidden(boolean hidden) item(int itemId) item(int itemId, int amount) itemAmount(int min, int max) itemCategory(int category) itemName(String name, BiFunction<String, CharSequence, Boolean> spred) <T extends QueryBuilderPREVIEW>
Tmark()@NotNull ComponentQuerynegate()static ComponentQuerynewQuery(int... interfaceIds) option(String option, BiFunction<String, CharSequence, Boolean> spred) or(@NotNull BiPredicate<? super MemoryLayoutPREVIEW, ? super MemorySegmentPREVIEW> other) param(int id) parent(int componentId) reset()results()select(int interfaceId, int... parents) Selects all components from the given interface.Tries to select an component that is interactable from the given component.spriteId(int alpha) subComponentIndex(int... subComps) booleantest(MemoryLayoutPREVIEW memoryLayout, MemorySegmentPREVIEW segment) text(String text, BiFunction<String, CharSequence, Boolean> spred) textColor(int color) type(int... ids) <T> ComponentQuerywithOptionMapper(Function<Integer, T> mapper) Sets the option mapper for thisComponentQuery.withSubComponentMapper(Function<Integer, Integer> mapper)
-
Constructor Details
-
ComponentQuery
public ComponentQuery(int... interfaceIds)
-
-
Method Details
-
withOptionMapper
Sets the option mapper for thisComponentQuery.- Type Parameters:
T- the type of the option mapper- Parameters:
mapper- the option mapper to set- Returns:
- this
ComponentQuery
-
withSubComponentMapper
-
componentIndex
-
subComponentIndex
-
type
-
option
-
option
-
text
-
text
-
font
-
textColor
-
alpha
-
spriteId
-
itemName
-
itemName
-
itemName
-
itemName
-
item
-
itemAmount
-
itemCategory
-
parent
-
hasDefaultOption
Filters component if they have default option, eg close, select etc- Returns:
- The ComponentQuery
-
param
-
item
-
getInterfaceIds
public int[] getInterfaceIds() -
test
- Specified by:
testin interfaceBiPredicate<MemoryLayoutPREVIEW,MemorySegmentPREVIEW>
-
and
@NotNull public @NotNull ComponentQuery and(@NotNull @NotNull BiPredicate<? super MemoryLayoutPREVIEW, ? super MemorySegmentPREVIEW> other) - Specified by:
andin interfaceBiPredicate<MemoryLayoutPREVIEW,MemorySegmentPREVIEW>
-
negate
- Specified by:
negatein interfaceBiPredicate<MemoryLayoutPREVIEW,MemorySegmentPREVIEW>
-
or
@NotNull public @NotNull BiPredicate<MemoryLayoutPREVIEW,MemorySegmentPREVIEW> or(@NotNull @NotNull BiPredicate<? super MemoryLayoutPREVIEW, ? super MemorySegmentPREVIEW> other) - Specified by:
orin interfaceBiPredicate<MemoryLayoutPREVIEW,MemorySegmentPREVIEW>
-
reset
- Specified by:
resetin interfaceQueryBuilderPREVIEW
-
newQuery
-
select
Selects all components from the given interface. -
selectInteractableFrom
Tries to select an component that is interactable from the given component.- Parameters:
comp- the component to select from- Returns:
- an
Optionalof the interactable component
-
results
-
mark
- Specified by:
markin interfaceQueryBuilderPREVIEW
-
ComponentQuerywhen preview features are enabled.