Jump to content
Shudsy

Shudsy's InfiniteWalker

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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);
	}
}

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing   0 members

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