I've botted for like 24+ hrs straight without a ban, multiple times. Location and the script you use definitely plays a huge factor. Went years without a ban, and then one day I carelessly fell asleep while botting RC abyss running nats and was perma'd (had received my first ban for botting a few months before for using the same script, but doing a different rune).
^ That was taken years ago, maybe 2013 or 2014 in early OSRS.