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

This patch doesn't work, it just stands there, however if you patch it like this it does work (I believe this is because there is a problem with the cameraentitiy):

 

if(distance(CAVE_ENTRANCE_OBJ) > 3) {                        walk(fix);                        return 1000;                    } else {                        client.moveCameraToEntity(CAVE_ENTRANCE_OBJ);                        sleep(1500);                        selectEntityOption(CAVE_ENTRANCE_OBJ, "Enter");                        return 750;                    }

replace with

 

selectEntityOption(CAVE_ENTRANCE_OBJ, "Enter");                  return 750;

This pretty safe because you respawn with the entrance in sight, so there is really no need for the extra code ensuring you walk within 3 squares of the entrance.

 

 

thxxx for this fix, have been running the script for more than 1 hour after I changed the code to this :)

The bot keeps crashing at same bot along with everyone else.. thus I suggested to make it so the bot checks that it runs to the middle every time it enters within 15 seconds or something..

Any idea why when I add the script, it won't show up on my script list? My other scripts do though. & It indeed is a groovy file..

  • Author

Any idea why when I add the script, it won't show up on my script list? My other scripts do though. & It indeed is a groovy file..

 

Get the new source, forum was bugging and it didn't update the post correctly. Re-edited it.

hey man, i keep getting an osbot error everytime i have the script in the scripts folder, but when i remove it, osbot works fine.. any fix for this? thanks!

  • Author

Like i said, grab the new source, forum was lagging real bad and left out characters

Same thing.. I just got the new soure... it's 178 lines of code right? try to re update it or something?

  • Author

update:

 

 

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

Edited by XenoTools


It is now working. Will post progress soon.

 

 

 

Edit: As soon as I start the bot outside of caves it just get stuck & in the black box underneath it continues to say:

 

INFO ][04/09/13 10:35:41 PM]: setting the state
[ERROR][04/09/13 10:35:42 PM]: Error while executing script!
[iNFO ][04/09/13 10:35:43 PM]: Attempting to handle
[iNFO ][04/09/13 10:35:43 PM]: setting the state
[ERROR][04/09/13 10:35:43 PM]: Error while executing script!
[iNFO ][04/09/13 10:35:43 PM]: Attempting to handle
[iNFO ][04/09/13 10:35:43 PM]: setting the state

Edited by ThisIsITT

Great to hear

 

As soon as I start the bot outside of caves it just get stuck & in the black box underneath it continues to say:

 

INFO ][04/09/13 10:35:41 PM]: setting the state
[ERROR][04/09/13 10:35:42 PM]: Error while executing script!
[iNFO ][04/09/13 10:35:43 PM]: Attempting to handle
[iNFO ][04/09/13 10:35:43 PM]: setting the state
[ERROR][04/09/13 10:35:43 PM]: Error while executing script!
[iNFO ][04/09/13 10:35:43 PM]: Attempting to handle
[iNFO ][04/09/13 10:35:43 PM]: setting the state
 
 
Any ideas? Really would love to leave this bot on while I go to sleep.. :s
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.