Updated (albeit a rather messy update) this script to work on OSRS.
If using ranged then not much to say (and I haven't tried it with ranged) but if using magic, then go into settings and make sure that you have it so that you left click everything to attack, even if stronger than you.
Also set up autocast before starting the script.
There is a constant to choose which world to log into near the top of the script.
This script runs using Pascal, so set the interpreter to Pascal script before trying to compile or run!
I would recommend babysitting the whole time when running it too but it's up to you.
Original thread can be found here;
https://villavu.com/forum/showthread.php?t=68426
Edit: The larger of the attachments has short and long breaking included and some outdated code deleted. IIRC the breaking is taken from one of Flight's scripts.