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.

Path generator

Featured Replies

I created this since I had to make many small paths that I couldn't well use with a map; hope someone finds some use in it tongue.png

Download:
http://up.ht/1gqZhyG
 

Notes:
-It will automatically copy the code to your clipboard
-It will also print it out in log
 
Yea just put in the tile distance (I usually use 5 it seems to work well for walking long distances).

 

Source if you want it

package com.zscripz;

import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.util.ArrayList;

import org.osbot.script.Script;
import org.osbot.script.ScriptManifest;
import org.osbot.script.rs2.map.Position;
	
	
	@ScriptManifest(name = "zWalker", author = "zScripz", version = 1.0, info="Creates a path based on tile distance")
	public class Walker extends Script {
		ArrayList<Position> posList = new ArrayList<>();
		Gui gui;
		Position control;
			
		public void onStart(){
			gui = new Gui();
			gui.frame.setVisible(true);
			control = client.getMyPlayer().getPosition();
		}
		
		public int onLoop() throws InterruptedException{
		if (!gui.textField.getText().equals("")) {
			if (distance(control) >= gui.getTileDistance()) {
				control = client.getMyPlayer().getPosition();
				posList.add(client.getMyPlayer().getPosition());
				log("Position added!");
			}
		}
		return 0;
		}
		public String convertPos(Position p) {
			return "(" + p.getX() + "," + p.getY() + "," + p.getZ() + ")" + ", ";
		}
		public void onExit() { 
			StringBuilder sB = new StringBuilder();
			sB.append("Position[] path = new Position[] { ");
			for(int i = 0; i < posList.size(); i++) {
				sB.append("new Position" + convertPos(posList.get(i)));
			}
			sB.append(" };");
			String myString = sB.toString();
			StringSelection stringSelection = new StringSelection (myString);
			Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard();
			clpbrd.setContents (stringSelection, null);
			log("Text copied to clipboard!");
			log(sB.toString());
			gui.frame.dispose();
		}
	}

Thanks for the contribution Scripz.

Edited by lolmanden

  • 2 weeks later...

I am sorry i feel stupid for asking but i have no experience with scripting and i would really like to learn, how would i go about making a script walk with this? How would i add it in would i need anything before/after the source you have given?

 

 

 

 

  • Author

I am sorry i feel stupid for asking but i have no experience with scripting and i would really like to learn, how would i go about making a script walk with this? How would i add it in would i need anything before/after the source you have given?

 

This won't walk anywhere, this will just generate an array of positions based on where you walk your character

  • 1 month later...
  • 2 months later...
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.