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.

Successful tree felling counter

Featured Replies

Successful tree felling counter

Attempt to capture the logging by capturing the chat message that says "You get some logs." as follows:

public void onMessage(String message){
	if(message.contains("You get some logs.")){
		logsChooped++;
	}
}

But I can not capture the events of the chat, I do not understand how to initialize that function and that it keeps capturing the messages for that counter.

Thank you in advance and if there is a more ethical solution, I would appreciate the information.

Edited by trainux

Perhaps store an variable for an int which is called after every interaction with a tree ( for instance in a loop). Thus, each time a tree is cut, an increase of one to the integer is given. This can then be called for a gui of sorts if that is what you are looking for. Hope this helped get you on the right track with the thought process atleast

Kinda confused by your wording, what do you mean by "the events of the chat"? And you don't need to 'initialize' that method, just put in in your class which extends script with the @override annotation. Then it will automatically run in a sperate thread.

    @Override
    public void onMessage(Message message) throws java.lang.InterruptedException {
		String msg = message.getMessage().toLowerCase();
		if (msg.contains("you get some logs")) {
			woodCut++;
		}
	}

 

You're using an old version of the MessageListener interface. It takes a Message argument now instead of String.

I'm kind of confused what you're asking for are you asking for a counter for how many logs you have received or a counter for how many trees are cut?

	@Override
	public void onMessage(Message msg) {
		if (msg.getMessage().contains("You get some logs"))
			logsChopped++;
	}

 

 

  • Author
20 hours ago, Theorems said:

Kinda confused by your wording, what do you mean by "the events of the chat"? And you don't need to 'initialize' that method, just put in in your class which extends script with the @override annotation. Then it will automatically run in a sperate thread.


    @Override
    public void onMessage(Message message) throws java.lang.InterruptedException {
		String msg = message.getMessage().toLowerCase();
		if (msg.contains("you get some logs")) {
			woodCut++;
		}
	}

 

Thanks, solved.

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.