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.

Request: Flax Spinner

Featured Replies

not a single working spinner on osbot. i can donate if its allowed biggrin.png ty

You'd have to compile it yourself... 
 

package org.flamezzz;

import org.osbot.rs07.antiban.AntiBan;
import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.api.ui.RS2Widget;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;

import java.awt.*;

/**
 * Created by Flamezzz on 16/07/2015.
 */
@ScriptManifest(
        name = "FFlaxSpinner",
        author = "Flamezzz",
        version = 2.1,
        info = "Spins flax in lumby.",
        logo = ""
)
public class FFlaxSpinner extends Script {


    private long lastDeposit = 0;
    private int made = 0;
    private long start;
    private int total_flax = 0;
    private int total_bs = 0;

    public void onStart() {
        start = System.currentTimeMillis();

        antiBan.unregisterBehavior(AntiBan.BehaviorType.RANDOM_MOUSE_MOVEMENT);
    }


    @Override
    public int onLoop() throws InterruptedException {

        log("Loop");

        if(widgets.get(402,2,11) != null && widgets.get(402,2,11).isVisible()) {
            widgets.get(402,2,11).hover();
            mouse.click(false);
            sleep(1000);
        }

        if(settings.getRunEnergy() >= random(20,40))
            settings.setRunning(true);

        RS2Widget enterAmount = widgets.get(162,32);
        RS2Widget spinWidget;

        if(enterAmount != null && enterAmount.isVisible()) {
            log("Entering amount");

            int rnd = random(3,9);
            keyboard.typeString(Integer.toString(rnd) + Integer.toString(rnd), true);
            sleep(random(600,900));

            log("Waiting until done spinning");
            int level = skills.getStatic(Skill.CRAFTING);

            int loops = 0;
            while(inventory.getAmount("Flax") > 0 && level == skills.getStatic(Skill.CRAFTING)
                    && loops < 200) {
                sleep(random(300,600));
                loops++;
            }
            sleep(random(400,700));


        } else if( (spinWidget = widgets.get(459,93)) != null && spinWidget.isVisible()) {
            log("Make X");
            spinWidget.interact("Make X");
            sleep(random(200, 600));
        }

        else if(myPosition().getZ() == 0) {
            objects.closest("Staircase").interact("Climb-up");
        } else if(myPosition().getZ() == 2) {
            if(inventory.getAmount("Flax") > 0) {
                if(objects.get(3205,3208).get(0).interact("Climb-down")) {
                    new ConditionalSleep(7000) {
                        public boolean condition() throws InterruptedException {
                            return myPosition().getZ() == 1;
                        }
                    }.sleep();
                }
            } else {
                if(bank.isOpen()) {
                    if(inventory.getAmount("Bow string") > 0) {
                        bank.depositAll();
                        sleep(random(200,400));

                        if(System.currentTimeMillis() - lastDeposit > 20000) {
                            made += 28;
                            lastDeposit = System.currentTimeMillis();
                        }

                    } else {
                        if(bank.getAmount("Flax") <= 28) {
                            log("Out of flax!");
                            bank.close();
                            stop();
                        } else {
                            bank.withdrawAll("Flax");
                        }

                        total_bs = (int) bank.getAmount("Bow string");
                        total_flax = (int) bank.getAmount("Flax");
                    }
                } else {
                    if(map.getDestination() == null || map.getDestination().distance(myPosition()) < 6) {
                        if(myPosition().distance(new Position(3208, 3218, 1)) > 6) {
                            localWalker.walk(new Position(3208, 3218, 1));
                        } else {
                            bank.open();
                        }
                    }
                    sleep(random(300,700));
                }
            }
        } else if(myPosition().getZ() == 1) {

            if(inventory.getAmount("Flax") > 0) {

                if(myPlayer().isAnimating() && !myPlayer().isMoving()) {


                } else {

                    RS2Object wheel = objects.closest("Spinning wheel");
                    if(map.canReach(wheel)) {
                        if(wheel.interact("Spin")) {
                            log("Interacted with wheel sleeping...");
                            new ConditionalSleep(7000) {
                                public boolean condition() throws InterruptedException {
                                    return widgets.get(459,93) != null && widgets.get(459,93).isVisible();
                                }
                            }.sleep();
                            log("Done");
                        }

                    } else {
                        doorHandler.handleNextObstacle(wheel);
                    }

                }

            } else {
                RS2Object stairs = objects.get(3204, 3207).get(0);
                if(map.canReach(stairs)) {
                    if(stairs.interact("Climb-up"))
                        new ConditionalSleep(7000) {
                            public boolean condition() throws InterruptedException {
                                return myPosition().getZ() == 2;
                            }
                        }.sleep();
                } else {
                    doorHandler.handleNextObstacle(stairs);
                }
            }



        }





        return random(300,500);
    }


    public void onPaint(Graphics2D g) {

        g.setColor(Color.ORANGE);

        g.drawString("Running: " + format(start), 300, 100);

        g.drawString("Made: " + made, 300, 130);
        g.drawString("Total flax: " + total_flax, 300, 160);
        g.drawString("Total bowstring: " + total_bs, 300, 190);
        g.drawString("World: " + worlds.getCurrentWorld(), 300, 220);


    }

    public String format(long starttime)
    {
        long time = System.currentTimeMillis() - starttime;
        StringBuilder string = new StringBuilder();
        long totalSeconds = time / 1000L;
        long totalMinutes = totalSeconds / 60L;
        long totalHours = totalMinutes / 60L;
        int seconds = (int)totalSeconds % 60;
        int minutes = (int)totalMinutes % 60;
        int hours = (int)totalHours % 24;
        if (hours > 0) {
            string.append(hours + "h ");
        }
        if (minutes > 0) {
            string.append(minutes + "m ");
        }
        string.append(seconds + "s");
        return string.toString();
    }
}

  • Author

the script is working but the cpu usage is 5x times higher than any script biggrin.png something is broken most def.  cpu usage with 18bots 20-30% and ur script 100%

Edited by Eko

ill finish my spinner and put it on the sdn. i thought the other spinner was working

 

the script is working but the cpu usage is 5x times higher than any script biggrin.png something is broken most def.  cpu usage with 18bots 20-30% and ur script 100%

 

Don't complain considering it's completely free to you...

how is he complaining bruh he merely explained the situation...

  • Author

ill finish my spinner and put it on the sdn. i thought the other spinner was working

hi, still not finished ? i plan on running 50+ spinners this weekend(must be flawless) biggrin.png bump

Edited by Eko

hi, still not finished ? i plan on running 50+ spinners this weekend(must be flawless) :D bump

I'll work on it today ;)

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.