Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Conditional Sleeps

Featured Replies

New java class (call it what you want)

public class NAMEHEREConditionalSleep extends ConditionalSleep {

private final Script SCRIPT;

public NAMEHEREConditionalSleep(int arg0, Script script) {
super(arg0);
this.SCRIPT = script;
}

@Override
public boolean condition() {
return CONDITION HERE(If this is true, it will sleep.);
}

}

An example of a somthing to put in CONDITION HERE would be

 

return client.getMyPlayer().isAnimating();

Now whenever you call you conditional sleep, and your playing is animating, it will sleep until he stops animating.

 

Hope this helped! enjoy!

Finally thanks man i know you saw my question lol

Can you read my thread again i have another question

There is already something in the API that maxi made for this.. Looks identical :P

I think he's extending the conditionSleep from the api

 

 

Use it like so.

 

New java class (call it what you want)

public class NAMEHEREConditionalSleep extends ConditionalSleep {

private final Script SCRIPT;

public NAMEHEREConditionalSleep(int arg0, Script script) {
super(arg0);
this.SCRIPT = script;
}

@Override
public boolean condition() {
return CONDITION HERE(If this is true, it will sleep.);
}

}

An example of a somthing to put in CONDITION HERE would be

 

return client.getMyPlayer().isAnimating();

Now whenever you call you conditional sleep, and your playing is animating, it will sleep until he stops animating.

A new class isn't needed... very inefficient and doesn't follow oop

 

 

as for the doesnt follow loop part, it is only called from within the loop, so yeah it does follow the loop.

 

Dumbass oop stands for Object-orientated programming, why don't you learn it?

might aswell continue it here

Simplified

public void sleepCondition(boolean condition, int sleepTime) {
        while(condition) {
            sleep(sleepTime);
        }
}

Tho still wondering why you would need this

Edited by LifezHatred

Simplified

public void sleepCondition(boolean condition, int sleepTime) {
        while(condition) {
            sleep(sleepTime);
        }
}

Tho still wondering why you would need this

What if the condition was never to return false? Enjoy doing nothing endlessly. Also, why would you not finalize your objects? Also, why should the condition has to be a boolean, why can't it be something else, such as a numerical value?

Edited by Pseudo

Use it like so.

New java class (call it what you want)public class NAMEHEREConditionalSleep extends ConditionalSleep {

private final Script SCRIPT;

public NAMEHEREConditionalSleep(int arg0, Script script) {

super(arg0);

this.SCRIPT = script;

}

@Override

public boolean condition() {

return CONDITION HERE(If this is true, it will sleep.);

}

}

An example of a somthing to put in CONDITION HERE would be

return client.getMyPlayer().isAnimating();

Now whenever you call you conditional sleep, and your playing is animating, it will sleep until he stops animating.

A new class isn't needed... very inefficient and doesn't follow oop
as for the doesnt follow loop part, it is only called from within the loop, so yeah it does follow the loop.
Dumbass oop stands for Object-orientated programming, why don't you learn it?

might aswell continue it here

He never asked for anything related to oop. He simply asked fora code like the one 5uck gave. By nature java is an oop language, it doesn't matter if he used objects here or not. Sooo learn2geteducation before trying to act like you know anything about anything.
Lol your joking right? i did this because he came n commented on my shit

i never asked for his opinion on my shit

Do you know the concept behind OOP? creating a new class for each check definitely does not follow an OOP design or isn't organized

"He never asked for anything related to oop", this should be expected when releasing java code

You should realize that classes are part of Java making them part of oop. You think your methods are better and he thinks his are better. He has multiple very successful scripts, so I would follow his over yours. If it works it works. Get over it.
Omg are you serious? OOP is a programming concept that you take into consideration when writing a java program

just because java is a object-orientated programing language doesn't mean that the concept should be thrown out

Why don't you learn what i'm talking about before you comment back with ignorant replies. i never said my method was better than his i simply simplified what he has and said what he is doing is completely unneccassary

Lolol someone doesn't like to be wrong.

Objects of the same orientation or purpose should be classed together, try n learn what the factory concept in java is then come back
Lolol. Do you even know how to make an object? Do you even know what object attributes are? Have you even heard of an object constructor?

Get a brain then come back.

Edited by Mysteryy

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.