Everything posted by Botre
-
[Snippet ]Predicate <-> Filter adapter
Updated from: http://osbot.org/forum/topic/91630-snippet-predicate-filter-adapter/ Adapts an OSBot Filter to work as a Java Util Predicate and vice versa. Useful if you don't wan't to rewrite your Predicate and / or Filter libraries but still want to enjoy the benefits provided by both worlds. If someone has a cleaner method, please do let me know! Example: package utils; import java.util.function.Predicate; import org.osbot.rs07.api.filter.Filter; import org.osbot.rs07.api.model.NPC; public class Example { public static void main(String[] args) { Filter<NPC> filter = npc -> npc.exists(); Predicate<NPC> predicate = FilterPredicate.fromFilter(filter); filter = FilterPredicate.fromPredicate(predicate); } } Snippet: package utils; import java.util.function.Predicate; import org.osbot.rs07.api.filter.Filter; /* * Adapts an OSBot Filter to work as a Java Util Predicate and vice versa. * */ public class FilterPredicate<V> implements Filter<V>, Predicate<V> { protected boolean _test(V value) { return false; } @Override public boolean match(V value) { return _test(value); } @Override public boolean test(V value) { return _test(value); } public static final <T> FilterPredicate<T> fromFilter(Filter<T> filter) { return new FilterPredicate<T>() { @Override protected boolean _test(T value) { return filter.match(value); } }; } public static final <T> FilterPredicate<T> fromPredicate(Predicate<T> predicate) { return new FilterPredicate<T>() { @Override protected boolean _test(T value) { return predicate.test(value); } }; } }
-
[Snippet] FilteredComboBox
FilteredComboBox Inspiration: http://stackoverflow.com/questions/10368856/jcombobox-filter-in-java-look-and-feel-independent Example: public static void main(String[] args) { JFrame frame = new JFrame("FilteredComboBoxExample"); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); JPanel content = new JPanel(); frame.setContentPane(content); FilteredComboBox<Skill> filteredComboBox = new FilteredComboBox<>(Skill.values(), s -> s.toString()); filteredComboBox.setPreferredSize(new Dimension(240, 60)); content.add(filteredComboBox); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); } Snippet: Not very MVC friendly but hey this is Swing after all. import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.function.Function; import javax.swing.DefaultComboBoxModel; import javax.swing.JComboBox; import javax.swing.JTextField; public class FilteredComboBox<T> extends JComboBox<T> { private static final long serialVersionUID = 283907792618669032L; @SuppressWarnings("unused") private List<T> full; private List<T> filtered; @SuppressWarnings("unused") private Function<T, String> fetcher; private JTextField field; @SuppressWarnings({ "unchecked", "rawtypes" }) public FilteredComboBox(List<T> full, Function<T, String> fetcher) { setModel(new DefaultComboBoxModel(full.toArray())); this.full = full; this.fetcher = fetcher; setSelectedIndex(0); setEditable(true); field = (JTextField) getEditor().getEditorComponent(); field.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent k) { String input = field.getText(); int code = k.getKeyCode(); if(!k.isActionKey() && k.getModifiers() == 0 && code != KeyEvent.VK_ENTER && code != KeyEvent.VK_CONTROL && code != KeyEvent.VK_ESCAPE) { filtered = new ArrayList<>(); for (int i = 0; i < full.size(); i++) { if (fetcher.apply(full.get(i)).toLowerCase().contains(input.toLowerCase())) { filtered.add(full.get(i)); } } if (filtered.size() > 0) { setModel(new DefaultComboBoxModel(filtered.toArray())); setSelectedItem(input); showPopup(); } else { setModel(new DefaultComboBoxModel(full.toArray())); setSelectedItem("No result matching: \" " + input + " \""); field.selectAll(); showPopup(); } } } }); } public FilteredComboBox(T[] full, Function<T, String> fetcher) { this(Arrays.asList(full), fetcher); } }
-
Functional interfaces examples (Function, Consumer, Predicate, Supplier, etc....)
Shame on me sensei but I have not yet read up on method references. It's on my TODO list for next week though
-
Functional interfaces examples (Function, Consumer, Predicate, Supplier, etc....)
"Functional interfaces provide target types for lambda expressions and method references." https://docs.oracle.com/javase/8/docs/api/java/util/function/package-summary.html In order to further my functional programming adventures I wrote a couple of (arbitrary and overly simplified) examples for almost every interface from java.util.function. Hope these help you understand / recognize the package in question a bit more. package org.dreamstream.sandbox.example.function; import java.util.Random; import java.util.function.*; public class FunctionPackageExample { public static void main(String[] args) { /** * Predicate * Represents a predicate (boolean-valued function) of one or two arguments. */ final Predicate<String> IS_EMPTY = s -> s.isEmpty(); System.out.println(IS_EMPTY.test("")); // = true final BiPredicate<String, String> ARE_EQUAL = (s1, s2) -> s1.equals(s2); System.out.println(ARE_EQUAL.test("Test1", "Test2")); // = false final IntPredicate IS_EVEN = i -> i % 2 == 0; System.out.println(IS_EVEN.test(2)); // = true final LongPredicate CAN_TRUNCATE_TO_INT = l -> l >= Integer.MIN_VALUE && l <= Integer.MAX_VALUE ; System.out.println(CAN_TRUNCATE_TO_INT.test(Integer.MAX_VALUE + 1l)); // = false final DoublePredicate IS_CLOSE_TO_ZERO = d -> Math.abs(d) < 2 * Double.MIN_VALUE; System.out.println(IS_CLOSE_TO_ZERO.test(0.0)); // = true /** * Function * Represents a function that accepts one or two arguments and produces a result. */ Function<String, Integer> CAST = s -> Integer.parseInt(s); System.out.println(CAST.apply("1") + 2); // = 3 BiFunction<Integer, Integer, String> SUM_TO_STRING = (i1, i2) -> Integer.toString(i1 + i2); System.out.println(SUM_TO_STRING.apply(5, 10) + "Hi"); // = 15Hi IntFunction<Double> AS_DOUBLE = i -> i * 1d; System.out.println(AS_DOUBLE.apply(1)); // = 1.0 LongFunction<Integer> AS_INTEGER = l -> (int)l; System.out.println(AS_INTEGER.apply(Long.MAX_VALUE)); // = -1 DoubleFunction<Integer> DOUBLE_AS_INTEGER = d -> (int)d; System.out.println(DOUBLE_AS_INTEGER.apply(2.5)); // = 2 /** * Consumer * Represents an operation that accepts one or two input arguments and returns no result. */ final Consumer<String> PRINT = s -> System.out.println(s); PRINT.accept("Yes / No"); // = "Yes / No" final BiConsumer<String, Integer> PRINT_STRING_AND_INTEGER = (s, i) -> System.out.println("String: " + s + " Ingeger: " + i); PRINT_STRING_AND_INTEGER.accept("Test", 3); // = "String: Test Ingeger: 3" final IntConsumer PRINT_I = i -> System.out.println(i); PRINT_I.accept(3); // = 3 final LongConsumer PRINT_L = l -> System.out.println(l); PRINT_L.accept(2); // = 2 final DoubleConsumer PRINT_D = d -> System.out.println(d); PRINT_D.accept(2.5); // = 2.5 final ObjIntConsumer<String> PRINT_I_S = (s, i) -> System.out.println(s + " " + i); PRINT_I_S.accept("A", 1); // = "A 1" final ObjLongConsumer<String> PRINT_L_S = (s, l) -> System.out.println(s + " " + l); PRINT_L_S.accept("B", 2); // = "B 2" final ObjDoubleConsumer<String> PRINT_D_S = (s, d) -> System.out.println(s + " " + d); PRINT_D_S.accept("C", 2.5); // = "C 2.5" /** * Supplier * Represents a supplier of results of a specific type. */ final Supplier<Double> SUPPLY_RANDOM = () -> Math.random(); System.out.println(SUPPLY_RANDOM.get()); // = A double value with a positive sign, greater than or equal to 0.0 and less than 1.0 final BooleanSupplier SUPPLY_TRUE = () -> true; System.out.println(SUPPLY_TRUE.getAsBoolean()); // = true final IntSupplier SUPPLY_EVEN = () -> new Random().nextInt() & -2; System.out.println(SUPPLY_EVEN.getAsInt()); // = An even int value final LongSupplier SUPPLY_ZERO = () -> 0; System.out.println(SUPPLY_ZERO.getAsLong()); // = 0 final DoubleSupplier SUPPLY_MIN = () -> Double.MIN_VALUE; System.out.println(SUPPLY_MIN.getAsDouble()); // = 4.9E-324 /** * ToNumber * Represents functions that accept one or two two arguments and produces a value of a number-type. */ final ToIntFunction<String> CHARACTER_COUNT = s -> s.length(); System.out.println(CHARACTER_COUNT.applyAsInt("Five5")); // = 5 final ToIntBiFunction<String, String> SUM_CHARACTER_COUNT = (s1, s2) -> s1.length() + s2.length(); System.out.println(SUM_CHARACTER_COUNT.applyAsInt("AB", "C")); // = 3 final ToLongFunction<String> THOUSAND_TIMES_CHARACTER_COUNT = s -> s.toCharArray().length * 1000l; System.out.println(THOUSAND_TIMES_CHARACTER_COUNT.applyAsLong("Five5")); // = 5000 final ToLongBiFunction<Long, String> SUM = (l, s) -> l + Integer.parseInt(s); System.out.println(SUM.applyAsLong(300l, "1")); // = 301 final ToDoubleFunction<String> HALF_CHARACTER_COUNT = s -> s.length() / 2d; System.out.println(HALF_CHARACTER_COUNT.applyAsDouble("One")); // = 1.5 final ToDoubleBiFunction<String, String> AVERAGE_CHARACTER_COUNT = (s1, s2) -> (s1.length() + s2.length()) / 2d; System.out.println(AVERAGE_CHARACTER_COUNT.applyAsDouble("One", "Five")); // = 3.5 /** * Operator * Represents an operation on one or two operands of the same type, producing a result of the same type as the operand(s). */ final UnaryOperator<String> REVERSE = s -> new StringBuilder(s).reverse().toString(); System.out.println(REVERSE.apply("test")); // = "tset" final BinaryOperator<String> CONCAT = (s1, s2) -> s1.concat(s2); System.out.println(CONCAT.apply("Hello, ", "World!")); // = "Hello, World!" final IntUnaryOperator DOUBLE = i -> i * 2; System.out.println(DOUBLE.applyAsInt(5)); // = 10 final IntBinaryOperator INTEGER_SUM = (i1, i2) -> i1 + i2; System.out.println(INTEGER_SUM.applyAsInt(9, 3)); // = 12 final LongUnaryOperator NEGATE = l -> -l; System.out.println(NEGATE.applyAsLong(1)); // = -1 final LongBinaryOperator DIFFERENCE = (l1, l2) -> l1 - l2; System.out.println(DIFFERENCE.applyAsLong(1, 3)); // = -2 final DoubleUnaryOperator HALF = d -> d / 2; System.out.println(HALF.applyAsDouble(5)); // = 2.5 final DoubleBinaryOperator AVERAGE = (d1, d2) -> (d1 + d2) / 2; System.out.println(AVERAGE.applyAsDouble(1.0, 2.0)); // = 1.5 } }
-
Botre Pest Control: Prioritization | Prayer | Special Attacks | Autocasting
Will do once it's released!
-
Change your passwords.
If only other people's daddies were as caring as ours :
-
[Very Experimental] OSBot 2.4.45 - Script Analyzer
Some things should, but if you start spamming people with unnecessary warning messages they end up just ignoring them which makes the entire security system redundant :p Eh, agree to disagree I guess.
-
[Very Experimental] OSBot 2.4.45 - Script Analyzer
If a script generates and compiles a second application that should obviously should raise flags The point would not be to monitor which data is sent over a connection (hard to do at compile time ), the point would be to detect at compile time whether a connection is established and warn the user of this (?). You can't micro-manage security scenarios without making life a living hell for script makers and script users So, posting some guards at the principal gates, that warn users about file modification, deletion, outgoing and incoming connections -> sure. But warning the user whenever a db request is made, whenever an image is being downloaded, whenever you're making a screenshot, whenever you are listening for keyboard shortcuts, whenever you send a key-event to the client, etc... -> please no That being said if they can do it in a way that's not too intrusive, eh why not
-
[Very Experimental] OSBot 2.4.45 - Script Analyzer
The Robot class / key listeners are perfectly safe. As long as incoming and outgoing connections are checked, we don't really have to worry about the rest :p
-
[Snippet] CSleep, Syntactic Sugar for ConditionalSleep
Updated to use BooleanSupplier instead of Predicate<T> https://docs.oracle.com/javase/8/docs/api/java/util/function/BooleanSupplier.html
-
[Snippet] Check if a class overrides all overridable methods from a super class
Checks if all overridable methods from a class are indeed overriden. Useful for writing decorator classes / wrappers. Example: public class InteractableObjectDecorator extends InteractableObject { static { ReflectionUtil.checkOverrides(InteractableObjectDecorator.class, InteractableObject.class); } public InteractableObjectDecorator(XInteractableObject instance) { super(instance); } } java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public java.lang.String org.osbot.rs07.api.model.InteractableObject.getName() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public java.lang.String[] org.osbot.rs07.api.model.InteractableObject.getActions() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public int org.osbot.rs07.api.model.InteractableObject.getId() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public int org.osbot.rs07.api.model.InteractableObject.getType() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public org.osbot.rs07.api.def.EntityDefinition org.osbot.rs07.api.model.InteractableObject.getDefinition() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public org.osbot.rs07.api.def.ObjectDefinition org.osbot.rs07.api.model.InteractableObject.getDefinition() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public boolean org.osbot.rs07.api.model.InteractableObject.exists() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public int org.osbot.rs07.api.model.InteractableObject.getLocalY() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public int org.osbot.rs07.api.model.InteractableObject.getGridY() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public int org.osbot.rs07.api.model.InteractableObject.getOrientation() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public boolean org.osbot.rs07.api.model.InteractableObject.isOnScreen() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public int org.osbot.rs07.api.model.InteractableObject.getZ() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public int[] org.osbot.rs07.api.model.InteractableObject.getModelIds() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public org.osbot.rs07.api.map.Area org.osbot.rs07.api.model.InteractableObject.getArea(int) from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public int org.osbot.rs07.api.model.InteractableObject.getUID() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public int org.osbot.rs07.api.model.InteractableObject.getLocalX() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public int org.osbot.rs07.api.model.InteractableObject.getGridX() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public boolean org.osbot.rs07.api.model.InteractableObject.hasAction(java.lang.String[]) from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public org.osbot.rs07.api.map.Position org.osbot.rs07.api.model.InteractableObject.getPosition() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public boolean org.osbot.rs07.api.model.InteractableObject.isPlayer() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public boolean org.osbot.rs07.api.model.InteractableObject.isNPC() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public org.osbot.rs07.api.model.Animable org.osbot.rs07.api.model.InteractableObject.getAnimable() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public int org.osbot.rs07.api.model.InteractableObject.getY() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public int org.osbot.rs07.api.model.InteractableObject.getSizeY() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public boolean org.osbot.rs07.api.model.InteractableObject.isVisible() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public boolean org.osbot.rs07.api.model.InteractableObject.interact(java.lang.String[]) from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public int org.osbot.rs07.api.model.InteractableObject.getX() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public boolean org.osbot.rs07.api.model.InteractableObject.hover() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public int org.osbot.rs07.api.model.InteractableObject.getSizeX() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public int org.osbot.rs07.api.model.InteractableObject.getConfig() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public boolean org.osbot.rs07.api.model.InteractableObject.isGameObject() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public boolean org.osbot.rs07.api.model.InteractableObject.examine() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public void org.osbot.rs07.api.model.Modeled.setPrioritized(boolean) from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public boolean org.osbot.rs07.api.model.Modeled.isPrioritized() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public void org.osbot.rs07.api.model.Modeled.updateModel(org.osbot.rs07.api.model.Model) from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public org.osbot.rs07.api.model.Model org.osbot.rs07.api.model.Modeled.getModel() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public int org.osbot.rs07.api.model.Modeled.getHeight() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public org.osbot.rs07.script.MethodProvider org.osbot.rs07.api.RS07Wrapper.getMethods() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public org.osbot.rs07.api.Client org.osbot.rs07.api.RS07Wrapper.getClient() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public org.osbot.core.AbstractBot org.osbot.rs07.api.RS07Wrapper.getBot() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public org.osbot.rs07.Bot org.osbot.rs07.api.RS07Wrapper.getBot() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public boolean org.osbot.core.api.Wrapper.equals(java.lang.Object) from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public java.lang.String java.lang.Object.toString() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) java.lang.NoSuchMethodException: class test.InteractableObjectDecorator does not override public native int java.lang.Object.hashCode() from class org.osbot.rs07.api.model.InteractableObject at reflection.ReflectionUtil.checkOverrides(ReflectionUtil.java:71) at test.InteractableObjectDecorator.<clinit>(InteractableObjectDecorator.java:11) Snippet public static void checkOverrides(Class<?> subClass, Class<?> superClass) { for (Method superMethod : superClass.getMethods()) { if(Modifier.isStatic(superMethod.getModifiers())) continue; if(Modifier.isFinal(superMethod.getModifiers())) continue; try { Method subMethod = subClass.getMethod(superMethod.getName(), superMethod.getParameterTypes()); if(subMethod.getDeclaringClass().equals(superMethod.getDeclaringClass())) { throw new NoSuchMethodException(subClass + " does not override " + superMethod + " from " + superClass); } } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (SecurityException e) { e.printStackTrace(); } } }
-
Object Orientation
- Object Orientation
RS2Object object = .... object .getOrientation();- bye osbot
Ok so now that Kevin's gone.... Jeez what an asshole right? Can't say I'm sad to see him go :p Shit scripter aswell x)- bye osbot
- Botre NMZ: Overloads | Absorptions | Prayer | Special Attacks | Powerups
No need to pay, free beta should be available soonTM.- Botre Pest Control: Prioritization | Prayer | Special Attacks | Autocasting
Soon hopefully!- Back in America
Some dank setup you got there man- Challenge Accepted
- Becoming a Script Writer
Sounds like a button to me! https://docs.oracle.com/javase/tutorial/uiswing/components/button.html- mein birthday
Happy birthday my friend!- Botre NMZ: Overloads | Absorptions | Prayer | Special Attacks | Powerups
Noted- Becoming a Script Writer
http://osbot.org/forum/topic/87731-explvs-dank-gui-tutorial/ Is a good beginner's tutorial on GUIs for scripters- Botre Pest Control: Prioritization | Prayer | Special Attacks | Autocasting
- Botre NMZ: Overloads | Absorptions | Prayer | Special Attacks | Powerups
You'll be the first person I'll contact once the script enters the BETA stage! - Object Orientation
Account
Navigation
Search
Configure browser push notifications
Chrome (Android)
- Tap the lock icon next to the address bar.
- Tap Permissions → Notifications.
- Adjust your preference.
Chrome (Desktop)
- Click the padlock icon in the address bar.
- Select Site settings.
- Find Notifications and adjust your preference.
Safari (iOS 16.4+)
- Ensure the site is installed via Add to Home Screen.
- Open Settings App → Notifications.
- Find your app name and adjust your preference.
Safari (macOS)
- Go to Safari → Preferences.
- Click the Websites tab.
- Select Notifications in the sidebar.
- Find this website and adjust your preference.
Edge (Android)
- Tap the lock icon next to the address bar.
- Tap Permissions.
- Find Notifications and adjust your preference.
Edge (Desktop)
- Click the padlock icon in the address bar.
- Click Permissions for this site.
- Find Notifications and adjust your preference.
Firefox (Android)
- Go to Settings → Site permissions.
- Tap Notifications.
- Find this site in the list and adjust your preference.
Firefox (Desktop)
- Open Firefox Settings.
- Search for Notifications.
- Find this site in the list and adjust your preference.