Jump to content

Botre

Members
  • Posts

    5883
  • Joined

  • Last visited

  • Days Won

    18
  • Feedback

    100%

Everything posted by Botre

  1. Edit: client is up to date! Runescape was updated a few minutes ago, this happens every thursday. Client will not work until it's updated, which is usually pretty soon.
  2. Method 1 in your SecondaryClass: toPaint(Graphics2D g2d){ g2d.drawString("This is text added to the g2d by the secondary class", 1, 1); } in your Primary Class: private SecondaryClass instance; @override onPaint(Graphics2D g2d) { instance.toPaint(g2d); } Method 2 You could also just use accessors: in your SecondaryClass: private x var1 = something; private x var2= something; public x getVar1() {return var1;} public x getVar2() {return var2;} in your Primary Class: private SecondaryClass instance; @override onPaint(Graphics2D g2d) { g2d.draw(instance.getVar1(), 0, 0); g2d.draw(instance.getVar2(), 0, 0); } Written without an IDE but should get the point across, there are other ways to do it but these are a good start imho.
  3. Thank you for the proggy
  4. Once I get a framework down (which I can easily do with any alter, so F2P would be fine), adding new altars becomes just a question of plugging in data Pm me if you are able to throw at least 2 testing accounts at me
  5. I'm deffo going to look into this later (6 in the morning right now and I need some sleepz). Might start working on an air rune prototype tomorrow (if you could hit me up with a throw-away account with an air tally and another account with some regular rune ess laters that'd be really helpful :x). Not sure if I would make this free (especially for the higher tier runes) but we'll see
  6. Hit me up with the ressources to test it and I will = -)
  7. I'll do the second one and turn it into an AIO stackable looter if you have an account that doesn't aggro the minotaurs @the spot or near varrock, pm meh.
  8. 1. Request a script. 2. Throw an account with the reqs and supplies at me. 3. Fr33 script for th3 communit33 yesh. 4. Get your account thrown back at you. PM me now! NOW! (Nothing that competes directly with anything premium on the store) (Something small and niche would be preferred)
  9. Sponsored by: Plank Farmer Big up to @Diecast for lending me a testing account dl: http://www12.zippyshare.com/v/HhQOHiAs/file.html
  10. Will need it for around an hour. I just need access to the gnome course (a teleport to there would be great :p), no items or skills required. It's a free script for the community, pm me !
  11. new EntityDefinition(this .name("Man") .action("Pickpocket") .reachable()); vs new EntityDefinition( this, "Man", "Pickpocket", true); 1 constructor 0 ambiguity 100% modular 100% extendable So... yes? On top of that, the class is wrapped around a predicate: the ability to add properties in the sequence you want makes tactical logical shortcutting a piece of pie among other cool things. Source:
  12. Sowyyy, tbh I don't think many people even know how to compile this so dw :p I think it was just getMap().distance(Entity) that was deprecated, getMap().distance(Entity.getPosition()); hasn't been touched (yn).
  13. I'm working on an extremely high-level API that sits on top of the OSBot API, makes it a bit more beginner friendly and adds plenty of shortcuts. Here's how a simple pickpocketer looks like (works flawlessly): import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.ScriptManifest; /** * Created by Bjorn on 21/07/2015. */ @ScriptManifest(author = "Botre", info = "", logo = "", name = "PPS", version = 0.0) public class PickpocketScript extends BasicScript { private EntityDefinition definition = new EntityDefinition(this) .name("Man") .action("Pickpocket") .reachable(); private Target<NPC> target = new Target<>(definition, Searcher.closest(this, definition)); @Override public void loop() { if(target.valid() || target.find()){ target.get().interact("Pickpocket"); } } }
  14. Meh I might when my noob-friendly framework is ready :x
  15. Some code I toyed around with yesterday to test out a few things: Core: import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.util.Comparator; import java.util.function.Predicate; import java.util.stream.Stream; @ScriptManifest(author = "Botre", info = "", logo = "", name = "Experiment", version = 0.0) public class ExperimentalScript extends Script { private ScriptClock clock = new ScriptClock(1.6); private String name = "Man"; private String action = "Pickpocket"; private Predicate<NPC> validityPredicate = o -> o != null && o.exists() && o.getName().equals(name) && o.hasAction(action) && getMap().canReach(o.getPosition()); private Comparator<Entity> distanceComparator = EntityComparator.create(this, EntityComparator.Type.DISTANCE_FROM_PLAYER); private Target<NPC> target = new Target<>(validityPredicate, () -> getNpcStream().filter(validityPredicate).min(distanceComparator)); @Override public int onLoop() throws InterruptedException { if (target.valid() || target.find()) { target.get().interact(action); } return clock.tick(); } private Stream<RS2Object> getObjectStream() { return getObjects().getAll().stream(); } private Stream<NPC> getNpcStream() { return getNpcs().getAll().stream(); } } Target: import java.util.Optional; import java.util.function.Predicate; /** * Created by Bjorn on 19/07/2015. */ public class Target<T> { private T target; private TargetSearcher<T> searcher; private Predicate<T> validity; public Target(Predicate<T> validity, TargetSearcher<T> searcher) { this.validity = validity; this.searcher = searcher; } /** * @return The current target. */ public T get() { return target; } /** * @return Whether the current target is valid. */ public boolean valid() { if (validity.test(target)) { return true; } else { target = null; return false; } } /** * Searches for and assigns a new target by making a call to the search() method. * * @return Whether a new target was find. */ public boolean find() { Optional<T> optional = searcher.search(); if (optional.isPresent()) { target = optional.get(); return true; } else { return false; } } } Target searcher: import java.util.Optional; /** * Created by Bjorn on 21/07/2015. */ public interface TargetSearcher<T> { /** * Searches for a new target. * * @return The new target. */ Optional<T> search(); } Script clock: /** * Created by Bjorn on 19/07/2015. */ public class ScriptClock { private double loopsPerSecond ; private int millisecondsPerLoop; private long systemMilliseconds; private long deltaMilliseconds; private int sleepMilliseconds; public ScriptClock(double loopsPerSecond) { this.loopsPerSecond = loopsPerSecond; millisecondsPerLoop = (int) ((1 / loopsPerSecond) * 1000); systemMilliseconds = System.currentTimeMillis(); } public int tick() { deltaMilliseconds = System.currentTimeMillis() - systemMilliseconds; systemMilliseconds = System.currentTimeMillis(); sleepMilliseconds = (int) (millisecondsPerLoop - deltaMilliseconds); return sleepMilliseconds > 0 ? sleepMilliseconds : 0; } } Entity comparator: import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.model.NPC; import org.osbot.rs07.script.MethodProvider; import java.util.Comparator; /** * Created by Bjorn on 20/07/2015. */ public final class EntityComparator { public enum Type { DISTANCE_FROM_PLAYER, } public static Comparator<Entity> create(MethodProvider mp, Type type) { switch(type) { case DISTANCE_FROM_PLAYER: return (a, b) -> mp.getMap().distance(a.getPosition()) - mp.getMap().distance(b.getPosition()); } return null; } }
  16. I suggest you give this a read: https://en.wikipedia.org/wiki/Computational_linguistics I hope you have some decent knowledge about linguistics, it's going to be hard to learn a computer something you don't understand yourself (I'm not saying you don't, I'm just taking shortcuts here ) Gl though
  17. If you want to do database querying there are plenty of vast academic quality databases around you might want to use instead of building your own from scratch. But that probably wouldn't even suffice, you really are going to want semantic recognition / AI for this and not just sentence and word keys to query a db (unless you have the server resources and time for it :p).
  18. You don't send a jar to the SDN, you send source code to be compiled. The source code is checked for compilation errors and malicious content by the SDN manager(s) (probably a mixture of software-assisted human checking and detection software).
×
×
  • Create New...