I'm no expert, but I like to code everything thinking in loops instead of sequentially
The main reason being; if you need to handle unexpected events, it is more difficult to implement this in sequential code
You could still use craftDartTips() call on each loop, but the logic would be less sequential and more reactive to the situation
Khal's example is great
for example:
loop1:
is chisel selected? no:
use chisel
customsleep (till selected)
return 0;
loop2:
is chisel selected? yes:
use gem
customsleep (till all crafted)
return 0;
Obviously with all the appropriate logic there too
Scenarios:
What if the bot misclicks?
What if you get a random event that you want to interact with? i.e. Genie
What if you are suddenly in combat?
In these cases, since the loop will end quickly or immediately, the next loop with handle these scenarios with priority over the task you were performing
Not saying those scenarios are relevant to this necessarily, but planning ahead?