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.

Script help

Featured Replies


Can't find the error with this, log spams Error while executing Script!
import org.osbot.script.Scriptimport org.osbot.script.ScriptManifest @ScriptManifest(name = "Iron Miner", author = "LifezHatred", version = 1.0D, info="Banks and mines iron")class IronMiner extends Script {     	def ironRockId = 2093    	def emptyRockId = 452    	def MineRock = null	enum State {		Mining, Looking, Idle, Droping, WalkingTo, WalkingFrom, Banking	}	  def state = State.Looking	 int onLoop() {		switch(state) {			case State.Mining:				return doMine()			case State.Looking:				return getRock()			case State.Idle:				return doIdle()			case State.Droping:				return dropOre()		}        		return 600	}	 int doIdle() {		return 600	}	 int dropOre() {		return 600	}	 int doMine() {		if(MineRock != null || mineRock.isInArea() || mineRock.exists()) {			return 600 + gRandom(200,400)		} else {			state = State.Looking			return 600		}	}	 int getRock() {		MineRock = closestObject(2093)		if(distance(MineRock.getPosition() > 5)) {			//will add idle state here			if(gRandom(100) < 10) {				return 1200 + gRandom(1000, (1000*120))			}			return 600 + gRandom(1000,2000)		} else {			MineRock.interact("Mine")			state = State.Mining			return 600		}		return 600	}}

Edited by LifezHatred

goovy blah, I want java syntax! your missing a bunch of semicolos xD

On topic... I can't seem to spot an error... Odd

Edit:  try to get rid of this:

|| mineRock.isInArea()


Because i think thats the error...

Edit again:

also add a null check here:
 

int getRock() {        MineRock = closestObject(2093)        if(MineRock != null && distance(MineRock.getPosition() > 5)) { //What happens if it can't find the rock !            //will add idle state here            if(gRandom(100) < 10) {                return 1200 + gRandom(1000, (1000*120))            }

Edited by zeejfps

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.