I've spent the past month of so trying to learn how to start writing scripts here with little-to-no experience in coding. What helped me the most was looking through the downloadable script section, downloading .jars that people posted, and try to read their scripts and understand what they're doing, and why. It's also a good idea to read scripts written for other botting sites. Just keep in mind that by doing this, you may not be looking at the most optimized code. If you can find source code for more premium bots that would be a huge help for you to learn from.
Also, about the conditional sleeping talk above, here is how Explv showed me to do it:
new ConditionalSleep(7000) {
@Override
public boolean condition() throws InterruptedException {
return (S.chatbox.isVisible());
}
}.sleep();
If this needs explaining, this method will sleep until the condition you input returns true. However, if the condition never returns true, it will only sleep the preset amount. So the conditional sleep above will sleep until the chatbox is visible, but if the chatbox is never visible, it will stop sleeping after 7 seconds
I've tried to condense it down since conditional sleeps are so common, but I couldn't get it to work Here's how I tried, maybe someone will know why this didnt work:
public void customSleep(boolean sleepUntil, int sleepMax){
new ConditionalSleep(sleepMax) {
@Override
public boolean condition() throws InterruptedException {
return (sleepUntil);
}
}.sleep();
}