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