Depends on the client that was used. AutoRune was a popular client that sent direct packets. The game client gathered metrics on mouse movement though, so if you used direct packet injection you still had to fake the mouse movement to some extent so you could escape this rudimentary detection. Or your bot could just control the mouse in a somewhat realistic way and avoid needing to do extra work.
For reading game state, many bots in this time used color detection. So for example a flax picking bot might be coded to click on specific colors of cyan on the screen. Jagex would likewise respond with bot mitigation that was intended to fool the color detection system, for example by making flax have the same color whether it could actually be picked or not.
Later, clients would be developed that used decompilation and reflection of the Java game client to directly read game state in the form of Java objects. This would then be able to be queried and interacted with by scripts via an API that the client exposed. So for example, a script could be written that queried for all the flax (identified by their object id) around the player and instructed the client to pick it; the client would handle exactly how to move the mouse and the camera to achieve that.