Package rs.kreme.ksbot.api.game
Class Friends
- java.lang.Object
-
- rs.kreme.ksbot.api.game.Friends
-
public class Friends extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.String name)Adds a friend by opening the "Add Friend" widget and typing the name.booleanisAdded(java.lang.String name)Checks if a friend with the given name is in the friend list.booleanisOnline(java.lang.String name)Checks if a friend with the given name is currently online.booleanisOnline(net.runelite.api.Friend friend)Checks if the specified Friend object is online.FriendQueryquery()Returns a FriendQuery object to filter and search friends.voidremove(java.lang.String name)Removes a friend by opening the "Del Friend" widget and typing the name.
-
-
-
Constructor Detail
-
Friends
public Friends(KSContext ctx)
Constructor.- Parameters:
ctx- KSContext instance for accessing widgets, keyboard, dialogs, and logging.
-
-
Method Detail
-
query
public FriendQuery query()
Returns a FriendQuery object to filter and search friends. Updates the cached friend list only if the game tick has advanced since last query.- Returns:
- FriendQuery containing the cached list of friends.
-
isAdded
public boolean isAdded(java.lang.String name)
Checks if a friend with the given name is in the friend list.- Parameters:
name- Friend name to check.- Returns:
- true if friend is added, false otherwise.
-
isOnline
public boolean isOnline(net.runelite.api.Friend friend)
Checks if the specified Friend object is online.- Parameters:
friend- Friend object to check.- Returns:
- true if online, false if offline or null.
-
isOnline
public boolean isOnline(java.lang.String name)
Checks if a friend with the given name is currently online.- Parameters:
name- Friend name.- Returns:
- true if online, false otherwise.
-
add
public void add(java.lang.String name)
Adds a friend by opening the "Add Friend" widget and typing the name. Waits for the enter-name dialog and types the name smoothly.- Parameters:
name- Name of the friend to add.
-
remove
public void remove(java.lang.String name)
Removes a friend by opening the "Del Friend" widget and typing the name. Waits for the enter-name dialog and types the name smoothly.- Parameters:
name- Name of the friend to remove.
-
-