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.

Open Source Oak woodcutter with semi-auto muling

Featured Replies

ZzWoodcutter

Status:Working

Download: V1.1

Code:Github

Simple working script to chop logs from 1-15 then Oak logs until ban

  • 1-15 logs 15-ban oak logs
  • Start with 7 questpoints
  • Deposits oak logs at port sarim
  • Muling support at set amount of logs
  • Desktop notifications when it is ready to mule
  • Very informative paint
  • Muling at Draynor bank

 

Future features?

 

Known bugs

can only use bronze axe

 

Guidelines:

Start anywhere,

Equip axe (not mandatory but helpful, has to at least be in inventory)

Expect a ban

Can be started at whatever Woodcutting level

 

Notes:

I would like to thank @Rays for helping me by showing me snippets to help with this and for the idea

I created this script in 24 hours if there are any bugs please report them

 

Edited by Zor

Hi, I didn't fully look at your code but I see so many people doing this recently so I had to say something (bad open source code hurts the community because bad practices are being learned, not saying your code is bad or anything, just in general).

'This' keyword is used mainly for ambiguity.

Example:

public Class Test(){
  private String name;
    
    public Test(String name){
    	this.name = name;
  	}
}

 People lately have been doing 'this.add()' where add() is a function that exists in the class that you're writing in. Don't do this.

  • Author
48 minutes ago, dreameo said:

Hi, I didn't fully look at your code but I see so many people doing this recently so I had to say something (bad open source code hurts the community because bad practices are being learned, not saying your code is bad or anything, just in general).

'This' keyword is used mainly for ambiguity.

Example:


public Class Test(){
  private String name;
    
    public Test(String name){
    	this.name = name;
  	}
}

 People lately have been doing 'this.add()' where add() is a function that exists in the class that you're writing in. Don't do this.

tbh anything with "this" in it was a copy and paste i did a lot of copy and paste for this and then fixing it but ill remove it to help out the community i dont really see how it hurts it though

Edit:Removed this as much as i could

Edited by Zor

I would recommend splitting the project into multiple files. It is not easy to read the code when everything is thrown in to 1 file. If you are unsure about using multiple files, then organize your code such that similar methods are close to each other

IMO I would put in this order

  • onStart()
  • onLoop()
  • onExit()
  • onPaint()
  • onMessage() These 5 methods are inherited from Script, and are similar in that sense.
  • bank()
  • mule() and waitForTrade() These 3 are helper methods as they "help" do things in onLoop
  • afk() only sleeps for a bit, why not just replace every afk() call with whatever you had. sleep(random(3000, 8000)) or whatever.

Furthermore this line in onMessage() does not discern between different message types, if a player spams "You get some oak logs" then your oak log cut counter gets incremented.

if(m.getMessage().contains("You get some oak logs")) oaklogscut++;

first check the message type, you only care if it is a game message. See: https://osbot.org/api/org/osbot/rs07/api/ui/Message.html

if(m.getType == Message.MessageType.GAME && m.getMessage().contains("You get some oak logs") oaklogscut++;

Also, what does this do? the timegui variable is never used. You don't need to use a separate thread to track time, do this in onPaint() which already runs on its own thread. I think you already do this, so this snippet does nothing. 

thread = new Thread(){

	                @Override
	                public synchronized void run() {
	                    while (Main.this.isRunning) {
	                        try {
	                            timegui = System.currentTimeMillis() - Main.this.startTime;
	                            this.wait(50);
	                        }
	                        catch (InterruptedException ex) {
	                            Main.this.log((Object)ex);
	                        }
	                    }
	                }
	            };
thread.start();

Finally why is the code indented weirdly. If you are using an ide you can auto-formate the code.

Anyway, good job.

On 8/15/2018 at 3:08 AM, PayPalMeRSGP said:

Also, what does this do? the timegui variable is never used. You don't need to use a separate thread to track time, do this in onPaint() which already runs on its own thread. I think you already do this, so this snippet does nothing. 


thread = new Thread(){

	                @Override
	                public synchronized void run() {
	                    while (Main.this.isRunning) {
	                        try {
	                            timegui = System.currentTimeMillis() - Main.this.startTime;
	                            this.wait(50);
	                        }
	                        catch (InterruptedException ex) {
	                            Main.this.log((Object)ex);
	                        }
	                    }
	                }
	            };
thread.start();

Finally why is the code indented weirdly. If you are using an ide you can auto-formate the code.

Anyway, good job.

This is probably due to him picking up some things from my source-code; I actually did not know that onPaint() already runs on its own thread.

Also, the "this" keyword which is a bad habit I adapted when first starting out.

Edited by Rays

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.