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.

Need 1 on 1 scripting tut ~Will pay~

Featured Replies

  • Must have a mic and be able to explain everything in depth
  • I would like for this person not to have that THICK of an accent 

Paying 500k-1m

i have everything downloaded thats needed 

Skype = Nick.Osbot

I would learn the api.  I haven't read any API.  But it's all common sense.

so your saying if i studied the API, theoretically i can make a script by my self ?

Studying the API will not help. You need practice. I suggest looking at a script skeleton and understanding what each method does. Then go find a basic script written by someone and see if you can understand what each part does and how it is done. Then just choose something simple and start working on it.

Studying the API will not help. You need practice. I suggest looking at a script skeleton and understanding what each method does. Then go find a basic script written by someone and see if you can understand what each part does and how it is done. Then just choose something simple and start working on it.

 

this. +1

Knowing the API is one of the most essential things when scripting, If you don't know where to look for things, or where the things you need are, how do you expect to be able to get anywhere?

 

Making a script is actually very easy

all you need to do is turn the actions required into a list... For example:
 
Basic woodcutter;
 
if im in the bank and my inventory isn't empty, empty inventory
if im in the bank and my inventory is empty, walk to the trees
 
if im at the trees and my inventory isn't full, chop the trees
if im at the trees and my inventory is full, walk to the bank
 
import org.osbot.script.Script;
import org.osbot.script.ScriptManifest;
import org.osbot.script.rs2.ui.Bank;
import org.osbot.script.rs2.utility.Area;

import java.awt.*;

/**
 * User: Cory
 * Date: 20/06/13
 * Time: 22:06
 */
@ScriptManifest(name = "WoodCutter", author = "Cory", version = 1, info="")
public class WoodCutter extends Script {

	private Area bank;
	private Area trees;

	@Override
	public void onStart() {
		try {
			//anything that needs to be done before your script runs.
			//We'll use this to initialise the areas.

			bank = new Area(bottomLeftX, bottomLeftY, topRightX, topRightY);
			trees = new Area(bottomLeftX, bottomLeftY, topRightX, topRightY);
			//Obviously replace the values with correct info.
		}
		catch (Exception e){}
	}

	@Override
	public int onLoop() throws InterruptedException {
		boolean isInventoryEmpty = client.getInventory().isEmpty();
		boolean isInventoryFull = client.getInventory().isFull();

		//if im in the bank
		if(bank.contains(myPlayer())) {

			//my inventory isn't empty
			if(!isInventoryEmpty) {
				Bank bank = client.getBank();

				//empty inventory
				//...open bank
				
				//deposit inventory
				bank.depositAll();

				//close bank
				bank.close();
			}

			//my inventory is empty
			if(isInventoryEmpty) {

				//walk to the trees
				walk(trees);
			}
		}

		//if im at the trees
		if(trees.contains(myPlayer())) {

			//my inventory isn't full
			if(!isInventoryFull) {

				//chop the trees
			}

			//my inventory is full
			if(isInventoryFull) {

				//walk to the bank
				walk(bank);
			}
		}

		return 100;
	}

	@Override
	public void onPaint(Graphics g){
		//Draw anything you would like onto the client
		//Such as a paint etc
	}
}

Edited by Cory

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.