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.

Getting very strange results from interfaces

Featured Replies

I have this very simple code:

 

client.getInterface(307).getChild(2).interact("Cook All");

sleep(random(200,500));

 

It works when I have Interface enabled in my Settings->Advanced, see picture:

 

kebwg9.png

 

 

But does NOT work when it is not enabled, which I find very strange.

Can anyone help me with this?

I have this very simple code:

 

client.getInterface(307).getChild(2).interact("Cook All");

sleep(random(200,500));

 

It works when I have Interface enabled in my Settings->Advanced, see picture:

 

But does NOT work when it is not enabled, which I find very strange.

Can anyone help me with this?

 

The interface for interacting with the cooking option is actually the following:

Parent: 307
Child: 6

Update your ID's and it should work smoothly ^_^

Edited by Divinity

  • Author

I think I found the problem, made this while loop for testing stuff about interfaces:

boolean t = true;

 

while (t) {

    sleep(1000);

    ~stuff~

    if (client.getInterface(307) != null) {

        client.getInterface(307).getChild(3).interact("Cook All");

    }

    ~stuff~

}

 

I guess that when the onLoop() method isn't completed, information about the client won't get updated.

Still doesn't explain why it did work when I had Interfaces enabled at debugging.

Edited by aikewoody

I think I found the problem, made this while loop for testing stuff about interfaces:

boolean t = true;

 

while (t) {

    sleep(1000);

    ~stuff~

    if (client.getInterface(307) != null) {

        client.getInterface(307).getChild(3).interact("Cook All");

    }

    ~stuff~

}

 

I guess that when the onLoop() method isn't completed, information about the client won't get updated.

Still doesn't explain why it did work when I had Interfaces enabled at debugging.

 

Use the hover debug in future, much more accurate for the simple things you're trying to do!

 

Edited by Divinity

  • Author

The interface for interacting with the cooking option is actually the following:

Parent: 307
Child: 6

Update your ID's and it should work smoothly happy.png

 

 

Thanks for your reply, looking at this debugger I thought it would be 3:

 

28a7o9k.png

 

 

 

I still can't get my head around the fact that my test while loop only worked when I selected Interfaces in the debug settings...

Thanks for your reply, looking at this debugger I thought it would be 3:

 

 

I still can't get my head around the fact that my test while loop only worked when I selected Interfaces in the debug settings...

 

 

Edit: Another thing you will notice, 307 is the interface ID for the chatbox, you're checking if its not null which is always, you never check however if the interface your trying to interact with is visible.

if(client.getInterface(307).getChild(6).isVisible()){
//interact with it
}

Do the above and you will find it works.

 

Edited by Divinity

all hail divinity the scripter god jfc

Just like to point out that your observation about not updating client information while onLoop is executing is correct. The reason it works when you turn of Interfaces debugging is because turning that on spawns a new thread which will update the client information even while onLoop is running. Once you turn that debug off, however, the updates stop until onLoop finishes.

  • Author

Just like to point out that your observation about not updating client information while onLoop is executing is correct. The reason it works when you turn of Interfaces debugging is because turning that on spawns a new thread which will update the client information even while onLoop is running. Once you turn that debug off, however, the updates stop until onLoop finishes.

 

WOW that's just what i needed to hear, thanks!

Guest
This topic is now closed to further replies.

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.