Class Chat


  • public class Chat
    extends java.lang.Object
    The Chat class provides functionality for sending messages in both private and public chat within the RuneScape game environment. It leverages the KSContext interface to interact with the game client and automate sending messages.
    • Constructor Summary

      Constructors 
      Constructor Description
      Chat()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void sendCommand​(java.lang.String text)
      Sends a command message.
      void sendPrivateMessage​(java.lang.String player, java.lang.String text)
      Sends a private message to a specific player.
      void sendPublicChat​(java.lang.String text)
      Sends a public chat message.
      • Methods inherited from class java.lang.Object

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

      • Chat

        public Chat()
    • Method Detail

      • sendPrivateMessage

        public void sendPrivateMessage​(java.lang.String player,
                                       java.lang.String text)
        Sends a private message to a specific player.
        Parameters:
        player - the name of the player to send the message to
        text - the content of the message to send
        Throws:
        java.lang.IllegalArgumentException - if the player name or message text is null or empty
        java.lang.IllegalStateException - if unable to open the private message interface
      • sendPublicChat

        public void sendPublicChat​(java.lang.String text)
        Sends a public chat message.
        Parameters:
        text - the content of the public chat message
        Throws:
        java.lang.IllegalArgumentException - if the message text is null or empty
      • sendCommand

        public void sendCommand​(java.lang.String text)
        Sends a command message.
        Parameters:
        text - the content of the command message
        Throws:
        java.lang.IllegalArgumentException - if the message text is null or empty