Jump to content

Banned after a few days, need some more experienced eyes on this.


beardedwhispers

Recommended Posts

Hey everyone, 

I've been botting with OSBot for a while, decided to try my hand at making my own bot. Specifically a few bots all connected, a wood cutter and a fletching/alcher.
I haven't added in the trading or wood cutting section yet, just wanted to work on the actual fletching/alchings steps first. 
It's supposed to sit at the GE and pull out the items from the bank, combine them, then alch the results, the issue i'm seeing is that occasionally it'll click on the banker by accident and they script will close from there. Also, after using it for less than a week while i was sitting here testing it, my account got banned. I've spoken to a few people and was advised that it doesn't seem to be moving the moues at all, rather just teleport clicking on the options, however i was under the impression that the item().interact() functions moved the mouse automatically to the item in question.

 

Anyone have any thoughts on  this? i've included the snippet of the fletching alcher below, any suggestions would be appreciated.
EDIT: Mainly look for help with making the mouse more closely emulate human movement and also click on the items properly, rather than what it's currently doing.

 

import java.awt.Graphics2D;

import org.osbot.rs07.api.ui.RS2Widget;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.api.ui.Spells;
import org.osbot.rs07.api.ui.Tab;
import org.osbot.rs07.input.mouse.MouseDestination;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;
import org.osbot.rs07.api.Mouse;


@ScriptManifest(author = "ME", info = "Bracelets", name = "AlchBot-1.1", version = 1, logo = "")
public class main extends Script {
  
    @Override
    public void onStart() {
        log("Let's get started!");
    }

    @Override
    public int onLoop() throws InterruptedException { 
        MouesDestination == 
getMouse().move((MouseDestination)        
getObjects().closest("Grand Exchange booth");
        getBank().open();
        new ConditionalSleep(5000) { public boolean condition() {return getBank().isOpen();}}.sleep();
        getBank().depositAllExcept("Nature rune");
        if (getBank().contains("Yew longbow") || getBank().contains("Yew longbow (u)")) {
            getBank().depositAllExcept("Nature rune");
            if (getBank().contains("Yew longbow")) {
                getBank().withdrawAll("Yew longbow");
                getBank().close();
                new ConditionalSleep(5000) { 
                     public boolean condition() {
                                 return getBank().isOpen();}
                }.sleep();
                new ConditionalSleep(3000) { public boolean condition() {return !getBank().isOpen();}}.sleep();
            }
            else if (getBank().contains("Bow string") && getBank().contains("Yew longbow (u)")) {
                getBank().withdraw("Bow string", 1);
                getBank().withdrawAll("Yew longbow (u)");
                getBank().close();
                new ConditionalSleep(3000) { 
                     public boolean condition() {
                                 return !getBank().isOpen();}
                }.sleep();;
        }
        }
        else {

            getBot().getScriptExecutor().stop(false);}
            
    
    
    
    
    
    //    }
        
    // add string
        while (getInventory().contains("Nature rune") && getInventory().contains("Yew longbow (u)")) {
            int bracelets = (int) getInventory().getAmount("Yew longbow (u)");
            if (getInventory().contains("Bow string")) {
                inventory.interact("Use", "Bow string");
                new ConditionalSleep(1000) { 
                     public boolean condition() {
                                 return getInventory().isItemSelected(); }
                }.sleep();
                
                inventory.interact("Use", "Yew longbow (u)");
                new ConditionalSleep(1000) {
                    @Override
                    public boolean condition() throws InterruptedException {
                        long braceletsNew = getInventory().getAmount("Yew longbow (u)");
                        if (bracelets != braceletsNew) {
                            return true;
                        }
                        return false;
                    }
                }.sleep();
                }
            else if (!getInventory().contains("Bow string")) {
                getBank().open();
                
                new ConditionalSleep(5000) { 
                     public boolean condition() {
                                 return getBank().isOpen();}
                }.sleep();
                
                if (!getInventory().isFull()) {
                    if (getBank().contains("Bow string")) {
                        getBank().withdraw("Bow string", 1);
                        getBank().close();
                        new ConditionalSleep(5000) { 
                             public boolean condition() {
                                         return !getBank().isOpen();}
                        }.sleep();
                    }
                    else {
                        getBot().getScriptExecutor().stop(false);
                    ;
                        }
                    }
                else {
                    getBank().depositAll();
                    if (getBank().contains("Bow string")) {
                        getBank().withdrawAll("Nature rune");
                        getBank().withdraw("Bow string", 1);
                        getBank().withdrawAll("Yew longbow (u)");
                        getBank().close();
                        new ConditionalSleep(3000) { 
                             public boolean condition() {
                                         return !getBank().isOpen();}
                        }.sleep();
                    }
                    else {
                        
                        getBot().getScriptExecutor().stop(false);
                    }
                }
            }
        }
// alch
        RS2Widget alchWarn = getWidgets().getWidgetContainingText("Click here to continue");
        getTabs().open(Tab.MAGIC);
        while (getInventory().contains("Nature rune") && getInventory().contains("Yew longbow")) {
            skills.getExperience(Skill.MAGIC);
            if (getTabs().getOpen().equals(Tab.MAGIC)) {
                magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY);
                sleep(random(250,750));
            }
            inventory.interact("Cast", "Yew longbow");
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() throws InterruptedException {
                    long magicNew = skills.getExperience(Skill.MAGIC);
                    long magicOld = 0;
                    if ((magicNew != magicOld) || (alchWarn != null && alchWarn.isVisible()) && getTabs().getOpen().equals(Tab.MAGIC)) {
                        return true;
                    }
                    return false;
                }
            }.sleep();
            new ConditionalSleep(5000) {
                @Override
                public boolean condition() throws InterruptedException {
                    if (getTabs().getOpen().equals(Tab.MAGIC)) {
                        return true;
                    }
                    return false;
                }
            }.sleep();
            if (alchWarn != null && alchWarn.isVisible()) {
                break;
            }
            if(getInventory().contains("Yew longbow") && getInventory().contains("Nature rune")) {
                sleep(random(250,750));
                magic.castSpell(Spells.NormalSpells.HIGH_LEVEL_ALCHEMY);
            }
            else {
                break;
            }
        }
        return 0;
    } // EoL
    
    
        
    @Override
    public void onExit() {
    
    }

    @Override
    public void onPaint(Graphics2D g) {

    }

}

Edited by beardedwhispers
clarification
Link to comment
Share on other sites

Please next time just put it in a paste bin like this https://pastebin.com/cwqfW560 so it's easier to read. Or use the code function built into OSBot's page
kjansdkjnakwj.PNG.b7767761050bce7a68929902e4817452.PNG

Also you can see if the mouse is teleporting or not if you go to Settings, Options, Debug, Then check mouse trail. It will put a red X where the mouse is. The interaction method should be moving the mouse and not teleporting it like a touch pad.

I didn't look through it much, like at all honestly.... But I would suggest making the script use one action per loop of the onloop. Like how Explv does in his tutorial here at 15. My guess of why it breaks is because of lag or something and it just collapses the whole script into like a NPE and stops it or something. Doing this would probably fix it or help at least.

 

Link to comment
Share on other sites

10 minutes ago, Naked said:

It does move the mouse. 

I'd look at trying to prevent making a pattern.

Do you mean prevent the mouse from making a pattern? or randomize the order of steps it takes while doing the alching process? like withdraw 26 unstrung bows, then 1 bowstring, then the next rotation doing 1 bowstring then all unstrung bows? i'm not sure what you mean or even how to go about preventing a pattern..

Link to comment
Share on other sites

Just now, beardedwhispers said:

Do you mean prevent the mouse from making a pattern? or randomize the order of steps it takes while doing the alching process? like withdraw 26 unstrung bows, then 1 bowstring, then the next rotation doing 1 bowstring then all unstrung bows? i'm not sure what you mean or even how to go about preventing a pattern..

Kind of. Interact with a bowstring and a bow in a random slot. Make your own banking that utilizes "Withdraw x". Sometimes click "withdraw all" when it won't break shit. Open some random tabs. 

Link to comment
Share on other sites

What i don't understand is how would this script get me banned, yet i know of other people who use an AutoHotKey script to do essentially this same thing for hours a day, for weeks at a time, and they have yet to get banned. Their AHK script move the mouse in straight lines and runs the exact same pattern each and every time. How is this any different?

 

Just confusing to me is all.

Link to comment
Share on other sites

On 12/23/2019 at 10:32 PM, beardedwhispers said:

What i don't understand is how would this script get me banned, yet i know of other people who use an AutoHotKey script to do essentially this same thing for hours a day, for weeks at a time, and they have yet to get banned. Their AHK script move the mouse in straight lines and runs the exact same pattern each and every time. How is this any different?

 

Just confusing to me is all.

Combination of your script and the OSBot client.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...