Diablo check and (don't) wait

I made some code based on FastDiablo which contains:

My problem is at:

I’d like to wait/check for Diablo in centre of CS for some time (let’s say 5000 ms) and if Diablo spawns INSTANTLY continue doing:

Otherwise > do CS run.

But ATM when I set 2 conditions (delay(5000) && getUnit(1, 243)) bot at first waits all time (5000) and only then check/attack/kill Diablo.

Use the poll function in misc.js, something like Misc.poll( () => getUnit(1, 243), 5000, 50);

2 Likes