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.

Sigma

Trade With Caution
  • Joined

  • Last visited

Everything posted by Sigma

  1. Good catch, it was pretty late when I was writing this. Of course. If you want me to make a tutorial of "your level", please let me know and I'd be happy to have you learn something new.
  2. Sigma replied to Sigma's topic in Tutorials
    http://docs.oracle.com/javase/tutorial/java/IandI/subclasses.html That is subjective. During this tutorial, hierarchy seems more appropriate. I could have gone further and added the CollegeStudent and CollegeTeacher classes which would have provided a slightly larger tree of classes to look at, though.
  3. Sigma posted a topic in Tutorials
    One of the most basic examples of this is the Person, Student, Teacher lesson which I will go over briefly. To start, we'll create the Person class: public class Person { private final String name; private int age; public Person(final String name, final int age) { this.name = name; this.age = age; } public String getName() { return this.name; } public int getAge() { return this.age; } public void setAge(final int age) { this.age = age; } @Override public String toString() { return "Name: " + getName() + ", Age: " + getAge(); } } A person has a name and an age. For the sake of this tutorial, a Person's name cannot change, but their age can. As an added foot-note (you don't have to do this), I added a toString to the Person class, so if you ever want to have access to that you can. Now, a Person is pretty bland and very ambiguous. Anyone can be a Person, so let's create two more classes that will extend Person (they will essentially "be" Person's). Student class: public class Student extends Person { private final int id; public Student(final int id) { super("Default", 50); this.id = id; } public Student(String name, int age, final int id) { super(name, age); this.id = id; } public int getId() { return this.id; } @Override public String toString() { return super.toString() + ", Id: " + getId(); } } In the class above, we have Student extend Person. This allows for the name and age fields to be inherited so we don't need to re-define them inside the Student class. Person is Students 'parent/super class', so the keyword 'super' is referring to the Person class. After we create the Teacher class, I will provide example usage of these three classes. Teacher class: public class Teacher extends Person { private final String className; public Teacher(final String className) { super("Default", 50); this.className = className; } public Teacher(String name, int age, final String className) { super(name, age); this.className = className; } public String getClassName() { return this.className; } @Override public String toString() { return super.toString() + ", Class Name: " + getClassName(); } } Now that we have all three classes defined, we can use them as we please. Example usage: import static java.lang.System.out; public class Test { public static void main(String[] args) { Person p = new Person("Bob", 20); Student s = new Student("Bob2", 25, 128396); Teacher t = new Teacher("Bob3", 40, "OSBot"); out.println(p); out.println(s); out.println(t); /* The following output is recorded: Name: Bob, Age: 20 Name: Bob2, Age: 25, Id: 128396 Name: Bob3, Age: 40, Class Name: OSBot */ } } Now you know basic class hierarchy. You can have as many parent and child classes as you want so long as what you're writing makes sense for what you're trying to accomplish. Per request: Java is always pass-by-value. Here's a short example of what this means: Take class Cat: public class Cat { private String name; public Cat(final String name) { this.name = name; } public String getName() { return this.name; } public void setName(final String name) { this.name = name; } @Override public String toString() { return getName(); } } Now, take class ReferenceTutorial: public class ReferenceTutorial { public static void main(String[] args) { Cat cat = new Cat("Bob"); //LINE 1 foo(cat); System.out.println(cat); //LINE 3 Cat cat2 = new Cat("Bob"); //LINE 9 foo2(cat2); System.out.println(cat2); //LINE 10 } public static void foo(Cat c) { c = new Cat("Bob2"); //LINE 2 System.out.println(c); //LINE 4 } public static void foo2(Cat c) { c.setName("Bob3"); //LINE 5 c = new Cat("Bob4"); //LINE 6 c.setName("Bob5"); //LINE 7 System.out.println(c); //LINE 8 } } On LINE 1, we create a pointer to a Cat called cat. This Cat has a memory address. If we pass that address into a method, such as foo() and then on LINE 2 we set that address to be a new Cat (which has a separate address), the name of the passed in Cat will not change because the two fields have different memory addresses. LINE 3 and LINE 4 will print out "Bob" and "Bob2" respectively. Why does LINE 4 print out "Bob2"? Because when we called println on the field c, we are still in the scope of the method and it will be referencing the new memory address we created. Now on LINE 5, we are referencing the original memory address we passed in by calling c.setName(). This will actually change the name of the Cat we created in the main method called cat2. Now on LINE 6, we create a new pointer that points to an entirely new memory address and then set that cat's name and print it out (remember, we created an entirely new address, so the Cat (pointer) we created on LINE 9 will not have its name changed twice and it will remain as "Bob3"). LINE 8 and LINE 10 will print out "Bob5" and "Bob3" respectively. Why does LINE 10 print out "Bob3"? Because we changed the name of cat2 on LINE 5 (we were referencing the original memory address). The recorded output will be: /* Bob2 Bob Bob5 Bob3 */ This should give you a general idea of what pass-by-value is. If you have any further questions, feel free to post them.
  4. That isn't wrong, it's just more code.
  5. thisIsCamelCase You use the above syntax to denote a field that is not final, examples: int numOne; Object objOne; public protected private abstract static final synchonized The above are modifiers you use before defining a field or method, examples: public static final String NAME; protected void method1() { } That is the order you should be putting them in, omitting any unused modifiers. You'll probably never use transient, volatile, or native modifiers, so they won't be included in the above order. byte short int long float double boolean char The above are primitive data types that you are able to compare equality with the == operator, examples: int numOne = 1; int numTwo = 2; public static void main(String[] args) { System.out.println(numOne == numTwo); //If you run the above code, it will print out as 'false' } ClazzName The above is the correct syntax for class names; the first letter of each word should be capitalized, examples: class TestClazz { } class TipsOnHowToNotBeBad { } I_AM_A_FINAL_FIELD The above is the correct syntax for defining a final field, examples: int MAX_VALUE = Integer.MAX_VALUE; int MIN_VALUE = Integer.MIN_VALUE; .equals(Object obj) The above is a method that is inherited from the Object class. It is used to compare two objects for equality (do not use the == operator, as stated in a previous lesson above it is for primitive data types only), examples: String cheese = "Cheese"; String cheese2 = "Cheese"; public static void main(String[] args) { System.out.println(cheese.equals(cheese2)); //If you run the above code, it will print out as 'true' } public void method1() { } public void method2() { } public void method3(){ } The above are three different ways to format your braces in java. All 3 are correct, but you should never mix one with another. if (booleanValue) method1(); The above is an if statement that has the braces omitted. You should only do this if there is only one line of code that is executed inside the if statement (note that you can also do this with for and while loops). int numOne; String stringOne; public Clazz(int numOne) { this(numOne, "Default); } public Clazz(int numOne, String stringOne) { this.numOne = numOne; this.stringOne = stringOne; } The above is an example of Constructor overloading. In the first constructor, you are only required to pass in an int, and the String field is automatically assigned whereas in the second constructor you are required to provide both an int and a String. If you learned anything from this, congratulations, you're less bad than you were before.
  6. First of all, multiple class files might be created from one java file. If your IDE automatically added it and someone who doesn't know anything puts that in, it will confuse them. Your third point makes no sense as it's not an argument, it's just a statement; a statement I most certainly agree with, however it was provided in a mediocre manner. I am communicating like an adult. I simply pointed out things that are wrong with your tutorial, and you should fix them. You are the only one who looks like a dumb teen swearing at me because you found out someone disagrees and knows more than you.
  7. Doing anything besides initializing variables in a constructor is bad. Just do switch(getState()) { } You create a new instance of a class every time the loop runs, that is an incredible waste of resources and memory. Why do you call the method onStart from the parent class inside the overridden method onStart from the parent class? That makes no sense. Why is this thread pinned?
  8. The script manager saying you're all shitty, and the script manager's source code being ugly as all hell is enough reason to group you all like that. If you think otherwise, get your head on straight. If I saw your code, I'd bet you I'd want to facedesk just as hard as I did when I read some threads in the tutorials section. If you don't believe me, post some and I'll be happy to take a look in a non-biased manner.
  9. The method does not validate anything, it simply checks if the conditional statement inside returns true or false. You basically just countered yourself by posting the dictionary definition of the word. A correct method name would be shouldExecute or something of the like. Also if you want to get into technicalities, then the execute method should be named executeNode.
  10. Just from looking at your GUI's, you don't know how to use layout managers which you should be doing for something static like a script UI. You add poor anti-ban to you scripts which believe it or not negatively effect your users. Here's why: Traditional scripter implemented anti-ban looks something like this: public static void antiBan() { switch(random int 0-100) { case 0: //wiggle mouse; break; case 20: //wiggle camera; break; case 60: //check xp; case 70: //break; case 90: //examine object; break; } } This forms a considerably easy to detect pattern. Now, this isn't so bad if only a few people are using your scripts, but lets say for the sake of this example you have 500 users running this script with this anti-ban. All 500 people will have the same pattern: -wiggle mouse 1% of the time -wiggle camera 2% of the time -check xp 1% of the time -examine object 1% of the time As you can see, that hurts your users more than helping them. None of your code is actually open source so I'm not able to comment on it.
  11. I'm not allowed to do that in my current position. If you want to head over to another botting site you'll see that I've done just that.
  12. Simple pathfinding can solve that for you.
  13. You don't need web walking to do it, you just need to write a method to figure out the best method of travel to get to the destination. The only things you need to hardcode are the non-coordinate clue destinations. You shouldn't need any other data prior to picking up a clue.
  14. Yes, with any clue other than the riddle clues, you can parse the data and send it to a method to solve the clue without previously knowing what the clue was. Which is why I was asking why you were hard coding every one of them.
  15. You're collecting clue data, what else would you be doing with it other than hard coding?
  16. Omitting braces with only one line inside the statement is ok... but explain why you do that, otherwise people looking at the tutorial will be confused. Sometimes you did it with more than one line, though. I promise you that the walking method in the api does not recurse itself until the destination is reached, therefore you are able to easily fix it by doing what I stated above. Lastly, if this is a tutorial, make sure the code is presentable and functional with no logic errors or syntax errors. The entire point of a tutorial is to teach people how to code correctly.
  17. Why are you hard coding clues? That is the worst way to go about a clue scroll script.
  18. I'm almost positive each of the skills is an interface child, so no point in create rectangles. Also, take Toph's suggestion, as the random element of the anti-ban should be created by the person using this snippet.
  19. Sigma replied to TheScrub's topic in Snippets
    Combine some of your if statements, there's no reason not to.
  20. Sigma replied to Swizzbeat's topic in Archive
    No, this pip provides no purpose. If you're adept at a language and post seldomly or often, people will recognize you for it regardless of whether or not you have a pip.
  21. No point in creating static variables that are not going to be used at the class level in any other classes, especially if they are inside a class that's parent is Script. Also, it's probably a good idea to be consistent with formatting, especially when making a tutorial (I am referring to your braces). It would be different if this was black box code, or something of the like. Your walking method looks to be written poorly with static sleeps not accounting for movements or lag. I don't know how the walk method inside the api works, but you're explanation of it "tending to click until it's at the destination" can easily be remedied by not calling the method over and over if the current game destination is the tile you wanted to walk to. Another thing, you may want to check if the object you're trying to click is on the screen before clicking it as that could cause problems. Lastly, you could be stuck in an infinite loop with that banking method you've written. Instead, why not use a conditional sleep that times out after x seconds if the clients open method returns true?

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.