Jump to content

Shudsy's InfiniteWalker


Recommended Posts

Posted
package infinitewalker;
import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import java.awt.Color;
import java.awt.Graphics2D;

@ScriptManifest(author = "Shudsy", info = "Walks", name = "Shudsy's InfiniteWalker", version = 2, logo = "")
public class infinite extends Script {
	private long timeBegan;
	private long timeRan;
	public Area Runescape = new Area(2297, 3918, 3442, 2957);
	
    @Override
    public void onStart() throws InterruptedException {
    	timeBegan = System.currentTimeMillis();
    }
    @Override
    public int onLoop() throws InterruptedException {
    	if (!myPlayer().isMoving()) {
    		getWalking().webWalk(Runescape.getRandomPosition());
    	}
		return 100;
    	
   }
    @Override
    public void onExit() {
        log("hello");
    }
    @Override
    public void onPaint(Graphics2D g) {
    timeRan = System.currentTimeMillis() - timeBegan;
		g.setColor(Color.GREEN);
		g.drawString("Timeran: " + ft(timeRan), 20, 230);
		
    	
    }
	private String ft(long ms){

	    long s = ms / 1000, m = s / 60, h = m / 60, d = h / 24;
	    s %= 60; m %= 60; h %= 24;

	    return d > 0 ? String.format("%02d:%02d:%02d:%02d", d, h, m, s) :
	           h > 0 ? String.format("%02d:%02d:%02d", h, m, s) :
	           String.format("%02d:%02d", m, s);
	}
}

 

Decided to release this for free. enjoy

  • Like 1
Posted (edited)
10 minutes ago, Shudsy said:

inb4 i get roasted by @Explv for bad code

  • The timeRan variable should be local to the onPaint function.
  • The Runescape area should be private, final, and start with a lowercase first letter, as per standard Java conventions.
  • There should be a new line in between each method for better readability.
  • The class should start with an uppercase first letter, as per standard Java conventions.
  • Version number is 2, is this really version 2 though?
  • info and logo in the @ScriptManifest attribute are severely lacking.
  • You don't need to check that your player isn't moving before calling web walk. 
  • The indentation is completely fucked in some places.
  • onExit method is unnecessary, and definitely misleading as it prints "Hello" to the logger when the script is in fact exiting.
  • The methods and class should be final just in case someone in Lumbridge tries to override them.  
  • Do you really need to sleep for 100ms in between loops, when all you are doing is calling getWalking().webWalk()?

Otherwise, good job!

Edited by Explv
  • Like 3
Posted
6 minutes ago, Explv said:
  • The timeRan variable should be local to the onPaint function.
  • The Runescape area should be private, final, and start with a lowercase first letter, as per standard Java conventions.
  • There should be a new line in between each method for better readability.
  • The class should start with an uppercase first letter, as per standard Java conventions.
  • Version number is 2, is this really version 2 though?
  • info and logo in the @ScriptManifest attribute are severely lacking.
  • You don't need to check that your player isn't moving before calling web walk. 
  • The indentation is completely fucked in some places.
  • onExit method is unnecessary, and definitely misleading as it prints "Hello" to the logger when the script is in fact exiting.
  • The methods and class should be final just in case someone in Lumbridge tries to override them.  
  • Do you really need to sleep for 100ms in between loops, when all you are doing is calling getWalking().webWalk()?

Otherwise, good job!

pls

package infinitewalker;

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import java.awt.Color;
import java.awt.Graphics2D;

@ScriptManifest(author = "Shudsy", info = "Walks all around runescape and does not stop!", name = "Shudsy's InfiniteWalker", version = 1, logo = "")
public class Infinite extends Script {
	private long timeBegan;
	final public Area runescape = new Area(2297, 3918, 3442, 2957);
	
    @Override
    public void onStart() throws InterruptedException {
    	timeBegan = System.currentTimeMillis();
    }
    
    @Override
    public int onLoop() throws InterruptedException { {
    	getWalking().webWalk(runescape.getRandomPosition());
    }
	return 0;
    	
   }
    
    @Override
    public void onPaint(Graphics2D g) {
    long timeRan = System.currentTimeMillis() - timeBegan;
		g.setColor(Color.GREEN);
			g.drawString("Timeran: " + ft(timeRan), 20, 230);
		
    	
    }
	private String ft(long ms){

	    long s = ms / 1000, m = s / 60, h = m / 60, d = h / 24;
	    s %= 60; m %= 60; h %= 24;

	    return d > 0 ? String.format("%02d:%02d:%02d:%02d", d, h, m, s) :
	           h > 0 ? String.format("%02d:%02d:%02d", h, m, s) :
	           String.format("%02d:%02d", m, s);
	}
}

 

Posted
Just now, Shudsy said:

pls


package infinitewalker;

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import java.awt.Color;
import java.awt.Graphics2D;

@ScriptManifest(author = "Shudsy", info = "Walks all around runescape and does not stop!", name = "Shudsy's InfiniteWalker", version = 1, logo = "")
public class Infinite extends Script {
	private long timeBegan;
	final public Area runescape = new Area(2297, 3918, 3442, 2957);
	
    @Override
    public void onStart() throws InterruptedException {
    	timeBegan = System.currentTimeMillis();
    }
    
    @Override
    public int onLoop() throws InterruptedException { {
    	getWalking().webWalk(runescape.getRandomPosition());
    }
	return 0;
    	
   }
    
    @Override
    public void onPaint(Graphics2D g) {
    long timeRan = System.currentTimeMillis() - timeBegan;
		g.setColor(Color.GREEN);
			g.drawString("Timeran: " + ft(timeRan), 20, 230);
		
    	
    }
	private String ft(long ms){

	    long s = ms / 1000, m = s / 60, h = m / 60, d = h / 24;
	    s %= 60; m %= 60; h %= 24;

	    return d > 0 ? String.format("%02d:%02d:%02d:%02d", d, h, m, s) :
	           h > 0 ? String.format("%02d:%02d:%02d", h, m, s) :
	           String.format("%02d:%02d", m, s);
	}
}

 

 

You disgust me

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...