Using bots in RuneScape is against the game's rules, and Jagex has taken serious action to combat them. The company has won a series of lawsuits aimed at curbing botting operations.
While "illegal" in the legal sense is complicated, botting is strictly prohibited within the game. Many botting accounts have been permanently banned or had their hard-earned levels reset. In short, it simply isn't worth the risk.