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.

XenoFightCaves - You look like you could use some sleep(:

Featured Replies

Should i just save this to scripts folder as XenoFightCaves.groovy/java or watwat? i'm totally lost atm :D sorry! and is there food support/is there gonna be food support?

Should i just save this to scripts folder as XenoFightCaves.groovy/java or watwat? i'm totally lost atm biggrin.png sorry! and is there food support/is there gonna be food support?

since the client was updated to java, i believe now you would save it as .java

It doesnt support food due to that fact is solely for experience since it is a safe minigame.

I am still not sure why the script stops after 22 minutes and logs you out?

I am still not sure why the script stops after 22 minutes and logs you out?

That's a bug with every fight cave bot on here.

Like xeno linked on his description no one really knows right now. I've tried looking at it compared to others and its probably the client itself.

289diqq.png

For those of you with the issue where the script randomly hangs, after numerous debugging sessions we have confirmed this is not because of the script or it's programming. Please see bug report here for other users having the same issue.

 

http://osbot.org/forum/topic/697-freezing-client/

 

import java.awt.Graphics;import java.awt.Image;import java.io.IOException;import java.net.URL;import java.util.Objects;import javax.imageio.ImageIO;import org.osbot.script.Script;import org.osbot.script.ScriptManifest;import org.osbot.script.rs2.model.RS2Object;import org.osbot.script.rs2.ui.Tab;@ScriptManifest(name = "XenoFightCaves", author="XenoTools", version = 1.12D, info = "Recent Update: More stable release, updated with anti-ban.")public class XenoFightCaves extends Script {	private static enum BotState {		INITIALIZING, GOING_TO_CAVE, AFK_IN_CAVE, ERROR	};	private BotState state;	private static final int CAVE_ENTRANCE = 9356, CAVE_EXIT = 9357;	private static long START_TIME;	Position fix = new Position(2439, 5169, 0);	int sAttackEXP, 			sDefenceEXP,			sStrengthEXP,			cAttackEXP,			cDefenceEXP,			cStrengthEXP,			hAttackEXP,			hDefenceEXP,			hStrengthEXP,			gAttackEXP,			gDefenceEXP,			gStrengthEXP,			sTokkul,			cTokkul,			hTokkul,			gTokkul,			training;		RS2Object CAVE_ENTRANCE_OBJ, CAVE_EXIT_OBJ;	Image background = getImage("http://i48.tinypic.com/289diqq.png");	private Image getImage(String url) {		try {			return ImageIO.read(new URL(url));		} catch (IOException e) {			return null;		}	}    @Override    void onPaint(Graphics g) {	        g.drawImage(background, 548, 205, null);	        g.drawString("Hourly", 638, 255);	        g.drawString("Current", 633, 296);	        g.drawString(format(System.currentTimeMillis() - START_TIME), 615, 345);	        g.drawString(format(System.currentTimeMillis() - START_TIME), 615, 385);			g.drawString("State: ${state}", 10, 50);	        //g.drawString("Tokkul", 623, 433);    }	@Override	public void onStart() {		START_TIME = System.currentTimeMillis();		state = BotState.INITIALIZING;		log("Thanks for using a script powered by: XenoTools");	}	@Override	public	int onLoop() {		log("Attempting to handle");		state = setState();		try {			return handleState(state);		} catch (InterruptedException e) {			// TODO Auto-generated catch block			e.printStackTrace();		}		log("Didn't handle");		return 1000;			}	BotState setState() {		log("setting the state");		if(client.getMyPlayer().getPosition().getX() < 2800)			return BotState.GOING_TO_CAVE;		if(client.getMyPlayer().getPosition().getX() > 2800)			return BotState.AFK_IN_CAVE;		return BotState.ERROR;	}		int handleState(BotState state) throws InterruptedException {		switch(state) {		case BotState.GOING_TO_CAVE:			CAVE_ENTRANCE_OBJ = getClosestObject(CAVE_ENTRANCE);			if(CAVE_ENTRANCE_OBJ != null) {						selectEntityOption(CAVE_ENTRANCE_OBJ, "Enter");						return 1500;					}				return 500;					case BotState.AFK_IN_CAVE:			doAntiRandom(random(65));			return 5000;		case BotState.ERROR:			log("error");			return 5000;		}		return 1000;	}		void doAntiRandom(int id) throws InterruptedException {		switch(id) {			case 1:			case 4:			case 13:				log("Antiban: Move mouse");				moveMouseOutsideScreen();				break;			case 2:			case 27:			case 16:				log("Antiban: Open Skills tab");				if (currentTab() != Tab.SKILLS)					openTab(Tab.SKILLS);				break;			case 3:			case 19:			case 29:				log("Antiban: Open Friends tab");				if (currentTab() != Tab.FRIENDS)					openTab(Tab.FRIENDS);				break;		}	}		private RS2Object getClosestObject(int id) {        RS2Object o = null;        for (RS2Object obj : client.getCurrentRegion().getObjects())            if (obj != null && obj.getId() != null && obj.getId() == id)                if (o == null || distance(obj) < distance(o))                    o = obj;        return o;    }		String format(final long time) {        final StringBuilder t = new StringBuilder();        final long total_secs = time / 1000, total_mins = total_secs / 60, total_hrs = total_mins / 60;        final int secs = (int) total_secs % 60, mins = (int) total_mins % 60, hrs = (int) total_hrs % 24;        if (hrs < 10)             t.append("0");                t.append(hrs);        t.append(":");                if (mins < 10)             t.append("0");        t.append(mins);        t.append(":");                if (secs < 10)             t.append("0");                if (secs < 0)            t.append("0");         else        	 t.append(secs);                return t.toString();    }}

Do we set the file extension to .java or is it still the old one?

Enters caves fine but doesn't walk to the center clicks just inside the entrance and afks there. Also because of positioning monsters get stuck.

Xeno, can you attach the .class file please?

Can't compile them myself atm..

Edited by oh my gawd

  • Author

Updated, new features include:

  • Java based script
  • More stable
  • Fixed bug where you would get suck outside
  • Fixed bug where you would get stuck inside.
  • Added GUI for training a stat (Please note this only displays information, does not select training type for you, as of right now)
  • Added experience calculations

  • Author

Keep up the good work(y)!

 

If you run into any problems, let me know. We ran this for almost 6 hours without flaw, then... got Disconnected.

If you run into any problems, let me know. We ran this for almost 6 hours without flaw, then... got Disconnected.

Just started testing, going good so far smile.png.

 

Maybe an idea for the next update is attacking the NPC's instead of staying afk in the cave. Will increase xp/h too

 

Edit: Client froze after 10 minutes

 

Second Run, after 3 minutes got stuck outside the cave

2yP2Y

Edited by oh my gawd

the ne wupdate is awesome evrythign seems to be workign fine xd

  • Author

Just started testing, going good so far smile.png.

 

Maybe an idea for the next update is attacking the NPC's instead of staying afk in the cave. Will increase xp/h too

 

Edit: Client froze after 10 minutes

 

Second Run, after 3 minutes got stuck outside the cave

Make sure the script didn't just completely stop, if you look down underneath the client you will see a debug console, is it still updating? There's a bug with OSBot where the Paint will continue to do it's functions, although onLoop will just die.

 

EDIT: As forced attack seems to be a wanted feature, I'll work it in soon.

Edited by XenoTools

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.