Ants on a Natural Log

PHP>=7.1, 150 Bytes

for([,$w,$n]=$argv;$i<ceil($n/$w)*5+1;)echo str_pad("| ".str_repeat(["","\O/ ","-O- ","/o\ "," ^  "][$i%5],$n<$w*ceil($i++/5)?$n%$w:$w),$w*4+2)."|\n";

Online Version


V, 70, 68 bytes

i \O/ 
 -O- 
 /o\ 
  ^  Àä{ò@bf }C GïpòÇÓ/d
HÄÒ çÞ/ÙÒ 
ëI|yê$p

Try it online!

00000000: 6920 5c4f 2f20 0a20 2d4f 2d20 0a20 2f6f  i \O/ . -O- . /o
00000010: 5c20 0a20 205e 2020 1bc0 e416 7bf2 4062  \ .  ^  ....{.@b
00000020: 6620 167d 4320 1b47 ef70 f2c7 d32f 640a  f .}C .G.p.../d.
00000030: 48c4 d220 e7de 2fd9 d220 0a16 eb49 7c1b  H.. ../.. ...I|.
00000040: 79ea 2470                                y.$p

This has never happened to me before, but a known bug has actually saved me bytes!

It's kinda hard to explain exactly what's going on, but unfortunately when you try to duplicate something by columns, V will move one column over before duplicating. Which is why originally I did:

h<C-v>{dÀp

which doesn't use the duplicate operator. However, because we already needed to move one line over, we can simply do

hÀä<C-v>{

Python 2, 144 bytes

n,w=input()
s=' ';k='|';a=k+s*w*4+s+k;print a
while n>0:
 for i in['\\O/','-O-','/o\\',' ^ ']:print k+s+(i+s)*min(w,n)+s*4*(w-n)+k
 n-=w;print a

Try it Online!