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.

[Multi Thread] Action

Featured Replies

Hey, Does anyone know how multi-thread works?

Wanted to make some actions while walking like moving cameras and some other randomized stuff.

thanks.

Edited by The King

Maybe try this, Make a new class with the following code.

package osbot;
import org.osbot.rs07.script.MethodProvider;

public class Multi implements Runnable {

    private final MethodProvider script;

    public Multi(MethodProvider script) {
        this.script = script;
    }

public void run() {

        while (script.myPlayer().isMoving()) {

//Action --> Script.

     }
 
        }
  }  

In your script file add this

new Thread(new Multi(this)).start(); 

Here this is one of the snippets which I always use.

I hope it helps, Let me know!

Edited by Mr Pro Pop

  • Author

Thanks man it works but also does anyone have any other good methods ?

  • Author

Okay I have one more question,

If I want to walk from Lumbridge to draynor village or something and wanted to take it by 2 steps like it stops in the half of the destination to do an action and then continue walking the rest of the destination, How will I do it ?

 

@@Imateamcape

@@Mr Pro Pop

@@venetox

Edited by The King

I am not really sure.

 

Maybe you could do it by 2 times like make 2 areas ( Area 1 then Area 2 ) so it walks to a1 firstly to do an action there and then starts walking to a2.

also to randomize it so it doesn't do the same thing as always I would recommend adding a random area in a1 like the x you wanted +random(1,10) and y+random(1,10) so it doesn't stop at the same place as always.

 

This will make it going far away from the area within 1-10 steps.

but may I know what do you need that for and what will be the usage of that?

 

Good luck!

Edited by Mr Pro Pop

Pro Pop... facep.gif

 

@@The King

1) Issue move command using minimap tile destination

2) Execute action

 

Conditional:

3a) Issue move command to next minimap tile, if minimap tile exists.

3b) Otherwise, Issue move command to original position to cancel animation.

Edited by Solzhenitsyn

  • Author

Could you show me how pl

 

 

@@The King

1) Issue move command using minimap tile destination

2) Execute action

 

Conditional:

3a) Issue move command to next minimap tile, if minimap tile exists.

3b) Otherwise, Issue move command to original position to cancel animation.

 

Could you show me how please ?

Give me an example code of how it works

1) Instantiate mmtd

http://osbot.org/api/org/osbot/rs07/input/mouse/MiniMapTileDestination.html

MinimapTileDestination mmtd = new MiniMapTileDestination(org.osbot.rs07.Bot bot, Position position)
// ctor

2) Get data from mmtd

// Method 1: use bounding box
mmtd.getBoundingBox()

// Method 2: use point
mmtd.getPoint()

4) Execute move instruction - think, what do I do with a point or rectangle?

5) Execute action instruction

6) Conditional sleep

7) Perform nullity and existential checks to determine what you should do next

 

That should be more than enough to get started. When I was starting, I didn't understand why spoonfeeding is terrible. It is terrible. 

 

Edited by Solzhenitsyn

  • Author

Ohh thanks but I still don't get how to do it by bounding box as I am still a beginner on coding.

If you would like could you please give me a full code ( Example of walking to an area with this ) so I can learn how to do it in the future ?

@@Solzhenitsyn

Edited by The King

Create an account or sign in to comment

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.