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.

Vilius

Scripter II
  • Joined

  • Last visited

Everything posted by Vilius

  1. Timer class: public class Timer { private long period; private long start; public Timer(long period) { this.period = period; this.start = System.currentTimeMillis(); } public long getElapsed() { return System.currentTimeMillis() - this.start; } public long getRemaining() { return this.period - this.getElapsed(); } public boolean isRunning() { return this.getElapsed() <= this.period; } public void setPeriod(long period) { this.period = period; } public void reset() { this.start = System.currentTimeMillis(); } public static String format(long milliSeconds) { long secs = milliSeconds / 1000L; return String.format("%02d:%02d:%02d", new Object[] { Long.valueOf(secs / 3600L), Long.valueOf(secs % 3600L / 60L), Long.valueOf(secs % 60L) }); } }Then simply implement it like this: Timer timer = new Timer(4000); if(myPlayer().isAnimating()){ timer.reset(); } if(timer.getElapsed() > 4000){ //do stuff } That should work, just change the 4000 into the time it takes to cook the whole inventory in milisecondsActually change the time it takes to cook one and the delay in between, 4000ms should work.
  2. Our mouse class public class Mouse implements MouseListener { //create a boolean public boolean hidePaint; @Override public void mouseClicked(MouseEvent e) { //create our point variable Point p = e.getPoint(); //create our rectangle Rectangle rec = new Rectangle(x,y,width,height); //check if the rectangle contains point and change booleans state if(rec.contains(p)) hidePaint = !hidePaint; } @Override public void mouseEntered(MouseEvent e) { } @Override public void mouseExited(MouseEvent e) { } @Override public void mousePressed(MouseEvent e) { } @Override public void mouseReleased(MouseEvent e) { } } Main class public class Main extends Script{ //pas our mouse object Mouse mouse = new Mouse(); public void onStart(){ //add our mouse object as a mouse listener getBot().addMouseListener(mouse); } public void onPaint(Graphics2D g){ //check if our boolean is false if(!mouse.hidePaint){ //draw our stuff } } public int onLoop(){ return 0; } } Hope this helps
  3. Find yourself a static object that doesnt change its position in any instance created and map out the areas from its position. For getting all objects you could use RS2Object[] objc = getObjects().getAll().stream().filter(o -> o != null && o.getId() == id && areaVar.contains(o));
  4. The LAF might have changed, but it shouldnt affect any buttons with actions
  5. getWalking().webWalk(new Position(x,y,z)); The webWalk method needs a Position object to be passed into its parameters. Someone didn't want to overload the method much more
  6. http://hyperphysics.phy-astr.gsu.edu/hbase/cf.html http://www.s-cool.co.uk/a-level/physics/circular-motion/revise-it/angles-in-radians-and-angular-speed-versus-linear-speed goodluck
  7. //interact with inventory getInventory().interact("Use", "item"); //check is item selected if(getInventory().isItemSelected()){ //get the fire object RS2Object fire = getObjects().closest("Fire"); //interact with fire fire.interact("Use"); } I'm guessing that is what you want to do.
  8. Oh, and you should always look at the logger and see what line the error occurs one ;)
  9. Vilius replied to Huz's topic in Scripting Help
    Just do this //position object Position pos = new Position(x,y,z); //Will check if name is right and will check if the position isnt the ignored one NPC fish = getNpcs().closest(o -> o.getName().equals("Fishing spot") && !o.getPosition().equals(pos)); //Interact with fish fish.interact("action");
  10. Vilius replied to Huz's topic in Scripting Help
    NPC spot = getNpcs().closest("Fishing spot"); Position pos = new Position(x,y,z); if(!spot.getPosition().equals(pos)){ //do stuff }
  11. Mmmm.... Seems like Ace has never heard of layout managers But to fix that try changing your screens resolution if you are using like a 4k monitor, that usually fixes it.
  12. Paste with comments to explain things. //we check if our inventory is full and we are in bank area. if (getInventory().isFull() && Banks.VARROCK_WEST.contains(myPlayer())) { //We are in the bank are, doing banking. //check if bank is open if(getBank().isOpen()){ //Bank open, we are depositing it getBank().depositAll(); }else{ //if bank is closed, open it. getBank().open(); } }else{ //We are walking to the bank area, because we are not in it. getWalking().webWalk(Banks.VARROCK_WEST); } Raw paste: Good luck
  13. What are your plans for it? :p
  14. This will withdraw a specific numbergetBank().withdraw("item", 5); This will withdraw all getBank().withdrawAll("item");
  15. Check your errors, if you have an x on your project or anywhere else in the code for that matter, look into it.
  16. Max 180x180px, an upload via url with a direct link.
  17. Vilius replied to Shakur's topic in Introductions
    hi
  18. RuneScape has multiple entity types NPC's Objects GroundItems Determining which one to use is way simpler than people think. NPC's will have yellow name tags in game Objects will have blue name tags in game GroundItems will have orange name tags in game Now when it comes to declaring variables what should we use? For NPC's we would use the NPC class. Our code should look like this NPC npc = ... For Objects we would use the RS2Object class. Our Code should look like this RS2Object object = ... For GroundItems we would use the GroundItem class. Our code should look like this GroundItem item = ... Why would we shy away from using Entity class to define any entity from the game? Well simply put Entity is just an interface and it might not contain things needed to any specific Entity implementing classes. Like RS2Object will have getType() method but Entity will not. The main place to use Entity class is when we are passing it to a parameter of a method and making your own lets say interacting methods. We would use Entity in our parameter to make it accept any Entity type. public void interactCustom(Entity entity, String action){ if(entity.isVisible()) entity.interact(action); else getCamera().toEntity(entity); } Of course again there will come limitations, which are when you are making a method for getting the type of an Object and logging it. Having our code look like this will not work and give us an error. public void getTypeAndLog(Entity entity){ log("[Debug] objects type: " + entity.getType(); } So passing Entity to our parameter wouldn't give us the method getType() which RS2Object has, so we would need to have RS2Object in our parameter So we would need to have RS2Object in our parameter. And our code will work if he have it look like this public void getTypeAndLog(RS2Object object){ log("[Debug] objects type: " + object.getType(); } I hope this guide helped you understand the types of Entities and how to use them correctly
  19. And you said oop is useless ;)
  20. he said he wants to edit it, read the post pls
  21. You know that is harassment, do you?
  22. Look at local script section

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.