# Friends Methods to interact with the friends gametab. ```{figure} ../../images/friends.png ``` - - - ## ERSFriendsButton ```pascal ERSFriendsButton = enum(ADD, DEL, FRIENDS, IGNORE); ``` Represents the buttons in the friends tab. - - - ## TRSFriend Record Represents a friend/ignore in the friends tab. - - - ## TRSFriends Record Main record responsible with handling the friends gametab. - - - ## Friends.IsOpen ```pascal function TRSFriends.IsOpen(): Boolean; ``` Returns true if the friends tab is open. Example: ```pascal WriteLn Friends.IsOpen(); ``` - - - ## Friends.Open ```pascal function TRSFriends.Open(): Boolean; ``` Attempts to open the friends gametab. Example: ```pascal WriteLn Friends.Open(); ``` - - - ## Friends.GetFriends ```pascal function TRSFriends.GetFriends(): TRSFriendArray; ``` Returns an array of all friends/ignores currently visible in the friends tab. Example: ```pascal var friend: TRSFriend; friends: TRSFriendArray; begin friends := Friends.GetFriends(); for friend in friends do WriteLn('Friend: ' + friend.Name + ' World: ' + IntToStr(friend.World)); end; - - - ## Friends.Find ```pascal function TRSFriends.Find(name: String): TRSFriend; ``` Searches for a friend/ignore by name in the friends tab. Example: ```pascal var friend: TRSFriend; begin friend := Friends.Find('SomePlayer'); if friend <> Default(TRSFriend) then WriteLn('Found friend: ' + friend.Name + ' World: ' + IntToStr(friend.World)) else WriteLn('Friend not found.'); end; - - - ## Friends.AddFriend ```pascal function TRSFriends.AddFriend(name: String): Boolean; ``` Attempts to add a friend to the friends list. Example: ```pascal WriteLn Friends.AddFriend('SomePlayer'); ``` - - - ## Friends.DeleteFriend ```pascal function TRSFriends.DeleteFriend(name: String): Boolean; ``` Attempts to delete a friend from the friends list. Example: ```pascal WriteLn Friends.DeleteFriend('SomePlayer'); ``` - - - ## Friends.SendMessage ```pascal function TRSFriends.SendMessage(name, message: String): Boolean; ``` Attempts to send a message to a friend. Example: ```pascal WriteLn Friends.SendMessage('SomePlayer', 'Hello there!'); ``` - - - ## Friends.AddIgnore ```pascal function TRSFriends.AddIgnore(name: String): Boolean; ``` Attempts to add a player to the ignore list. Example: ```pascal WriteLn Friends.AddIgnore('SomePlayer'); ``` - - - ## Friends.DeleteIgnore ```pascal function TRSFriends.DeleteIgnore(name: String): Boolean; ``` Attempts to delete a player from the ignore list. Example: ```pascal WriteLn Friends.DeleteIgnore('SomePlayer'); ``` - - - ## Friends variable Global {ref}`TRSFriends` variable.