Automatically repeating the same message over and over in RuneScape is typically done with a macro program—but here's the important part: that's against the game's rules.
While it's true that not everyone follows the rules, using macros can get your account banned, since Jagex actively polices automation. If you want to keep your account safe, it's far better to type your messages manually rather than risk a macro.