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.

S3R0

Members
  • Joined

  • Last visited

Everything posted by S3R0

  1. Is there anything in the API which checks for object orientation? For example, a gate's orientation is set to 2, but when opened, is set to 3.
  2. S3R0 replied to visas's topic in Software Development
    Haven't really used bootstrap much, although I've heard pretty good things about it. As far as jQuery goes, it's been a little while since I last used it, but from what I remember, it's fairly easy. I'm assuming you're trying to put together some sort of website?
  3. Thank you guys very much for explaining this to me. I really appreciate it. Everything seems to be working perfectly!
  4. Hello, I was wondering if someone could explain a little more in-depth as to how showing/hiding paint works, as far as getting intractable buttons working. I've been trying to follow this tutorial/snippit (bottom of page): http://osbot.org/forum/topic/59574-interactable-paint-not-working-on-osbot-2/ I'm just not sure where to create the buttons, where to place them, etc. Is there an easier way to implement showing and hiding paint with intractable buttons? (as if it's already kinda easy as it is )
  5. That seemed to kinda work. Paint doesn't seem to overlay over anything though (inventory, minimap, chatbox, etc). Is there like a Z index that needs to be edited for that to happen? Or is it something different? EDIT: Script is working and paint is working as well. Please close topic.
  6. It literally does nothing. It won't interact with anything, paint won't load. The only thing that does load is getStart. Code has been updated to use getState instead of just state. UPDATE: It's starting to work now, I've found a huge issue that's been resolved. My only problem now really is getting the paint to show..
  7. package zulFisher; import java.awt.*; import java.awt.geom.AffineTransform; import java.awt.geom.Arc2D; import javax.imageio.ImageIO; import java.io.IOException; import java.net.URL; import java.util.LinkedList; //import java.util.List; //import org.osbot.rs07.api.NPCS; //import org.osbot.rs07.api.Players; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.ui.Skill; //import org.osbot.rs07.api.model.NPC; //import org.osbot.rs07.api.model.Player; //import org.osbot.rs07.api.ui.Option; import org.osbot.rs07.api.ui.Tab; //import org.osbot.rs07.input.mouse.EntityDestination; //import org.osbot.rs07.input.mouse.MouseDestination; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "S3R0", info = "A simple bot that fishes for Sacred Eels at Zul-Andra and cuts them for scales.", logo = "", name = "ZulFisher", version = 0.1) public class ZulFisher extends Script { //Enums enum State { CHECKINV, FISHSACREDEELS, GATHERSCALES; } //State State state; //Strings String botStatus = ""; //Ints int eelsCaught = 0; //Time long startTime; //Code to be executed on start public void onStart() { log("Starting ZulFisher by S3R0"); log("Current version is 1.0"); startTime = System.currentTimeMillis(); state = State.CHECKINV; } //Code to be executed on exit public void onExit() { log("Thank you for using my script!"); } //Stop Script public void exitScript(Boolean StopScript) { if(StopScript == true) { try { getBot().getScriptExecutor().stop(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } //Code for Main Loop @Override public int onLoop() throws InterruptedException { switch(state) { case CHECKINV: if(!inventory.isFull() & inventory.contains("Bait", "Fishing rod")) { state = State.FISHSACREDEELS; } else if (!inventory.contains("Bait")) { log("Fishing bait missing from inventory. Script shutting down..."); exitScript(true); } else if (!inventory.contains("Fishing rod")) { log("Fishing rod missing from inventory. Script shutting down..."); exitScript(true); } else if (inventory.isFull() & inventory.contains("Sacred eel")) { if(inventory.contains("Knife")) { state = State.GATHERSCALES; } else if (!inventory.contains("Knife")) { log("Knife missing from inventory. Script shutting down..."); exitScript(true); } } else { log("Unable to continue due to not having enough inventory space (too many items!). Script shutting down..."); exitScript(true); } break; case FISHSACREDEELS: Entity fishSpot = objects.closest("Fishing spot"); if(fishSpot != null) { if(fishSpot.isVisible()) { if(!myPlayer().isAnimating()) { fishSpot.interact("Fishing spot"); botStatus = "Fishing for Sacred Eels"; } else { state = State.CHECKINV; } } else { camera.toString().indexOf("Fishing spot"); botStatus = "Moving camera to fishing spot"; } } break; case GATHERSCALES: if(tabs.getOpen() != Tab.INVENTORY) { tabs.open(Tab.INVENTORY); botStatus = "Opening inventory tab"; } while (inventory.contains("Sacred eel")) { if(!myPlayer().isAnimating()) { inventory.interact("Use", "Knife"); botStatus = "Using knife on Sacred Eel"; sleep(random(200, 400)); inventory.interact("Use", "Sacred eel"); botStatus = "Gathering Zulrah Scales"; } } state = State.CHECKINV; break; default: log("Jet fuel can't melt Zulrah scales"); break; } return 100 * (random(50)); } //Code for Paint //Interface private final Color fontColor = new Color(58, 57, 46); private final Font fontInterface = new Font("Arial", 0, 9); private final Image imgInterface = getImage("http://i.imgur.com/IPbEQiw.jpg"); //Mouse private int mX, mY; private long angle; private BasicStroke cursorStroke = new BasicStroke(2); private Color cursorColor = Color.getColor("#8F8F6B"); private AffineTransform oldTransform; //Getting Interface Image private Image getImage(String url) { try { return ImageIO.read(new URL(url)); } catch(IOException e) { log("Error downloading image..."); return null; } } public void onMessage(String message) { if(message.contains("You catch a sacred eel")) { eelsCaught++; } } public void onPaint(Graphics grafix) { long timeElapsed = System.currentTimeMillis() - startTime; long sec = (timeElapsed / 1000) % 60; long min = (timeElapsed / (1000 * 60)) % 60; long hr = (timeElapsed / (1000 * 60 * 60)) % 24; //Code for interface paint Graphics2D g = (Graphics2D) grafix; g.drawImage(imgInterface, 1, 335, null); g.setFont(fontInterface); g.setColor(fontColor); g.drawString("Time Running: " + hr + ":" + min + ":" + sec, 301, 361); g.drawString("Status: " + botStatus, 301, 373); g.drawString("Current Fishing Level: " + getSkills().getStatic(Skill.FISHING), 301, 392); g.drawString("Exp Gained: N/A", 301, 404); g.drawString("Eels Collected: " + eelsCaught , 301, 416); g.drawString("Current Cooking Level: " + getSkills().getStatic(Skill.COOKING), 301, 436); g.drawString("Exp Gained: N/A", 301, 448); g.drawString("Scales Collected: N/A", 301, 460); //Code for mouse paint Point mP = getMouse().getPosition(); g.drawLine(mP.x - 5, mP.y + 5, mP.x + 5, mP.y - 5); g.drawLine(mP.x + 5, mP.y + 5, mP.x - 5, mP.y - 5); //Mouse Rotation oldTransform = g.getTransform(); mX = mouse.getPosition().x; mY = mouse.getPosition().y; LinkedList<MousePathPoint> mousePath = new LinkedList<>(); g.setRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); //MOUSE TRAIL while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = mouse.getPosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, 300); if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { g.setColor(new Color(160, 160, 120, a.getAlpha())); //trail color g.drawLine(a.x, a.y, lastPoint.x, lastPoint.y); } lastPoint = a; } if (mX != -1) { g.setStroke(cursorStroke); g.setColor(cursorColor); g.drawLine(mX-3, mY-3, mX+2, mY+2); g.drawLine(mX-3, mY+2, mX+2, mY-3); g.rotate(Math.toRadians(angle+=6), mX, mY); g.draw(new Arc2D.Double(mX-12, mY-12, 24, 24, 330, 60, Arc2D.OPEN)); g.draw(new Arc2D.Double(mX-12, mY-12, 24, 24, 151, 60, Arc2D.OPEN)); g.setTransform(oldTransform); } } /*private boolean hoverEntityOption(Entity entity, String option) throws InterruptedException { if(entity == null) return false; if(menu.isOpen()) { List<Option> options = menu.getMenu(); if(options != null) { Rectangle optionRec = null; for(int index = 0; index < options.size(); index++) { if(options.get(index).action.equals(option)) { optionRec = menu.getOptionRectangle(index); if(optionRec != null) { if(!optionRec.contains(mouse.getPosition())) { int x = menu.getX() + Script.random(10, 160); int y = menu.getY() + 23 + index * 15; Script.sleep(Script.random(200, 400)); return mouse.move(x, y); } } } } } } else { EntityDestination ed = new EntityDestination(bot, entity); mouse.click(ed, true); } return false; }*/ //AntiBan //@SuppressWarnings("unchecked") /*public void AntiBan() throws InterruptedException{ int rand = random(0,random(5000,10000)); if(rand == random(0,random(0,100))){ log("Rotating camera."); switch(random(0,4)%2){ case 0: getCamera().moveYaw(random(0, 3000)); break; case 1: getCamera().movePitch(random(60,400)); break; } } else if(rand == random(random(0,300), random(300,400))){ log("Varied sleep."); sleep(random(0,5000)); } else if(rand == 10000){ log("Idling to log out!"); sleep(random(310000,380000)); } }*/ } Sure thing. Before you say anything, the code may be bad? Might be okay? I don't know. I don't plan on releasing this. It's just for my own personal use, since no one has created a Sacred Eels bot, other than part of an AIO Fishing. That, and I'm learning some parts of the API as I go. Please be gentle...
  8. Hello, I have been working on a script and it seems as though onLoop doesn't want to function. Maybe it's just me, but I think this works just fine? @Override public int onLoop() throws InterruptedException { //SCRIPT CODE HERE } I know it's not much, but could there be other factors affecting how the script is running? I can post the rest of the code, if needed.

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.