Jump to content

Got banned, with this script. Tell me how I can improve it.


Floglet

Recommended Posts

Hi all. had two accounts running this script, I was a little bit surprised, considering I only ran it for 45 minutes, but soon realised that its probably due to the sleeps I had included, could anyone help me figure out a better way to write the part with the sleeps so I would be less likely to be banned?

Here is the code:

(what it does: - Have woad and coins in inventory, goes to aggie witch, interacts with her, uses woad on witch, in return for a blue dye, goes through two dialog windows then repeats till inventory full, banks, repeat.) 

 

package Main;

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.map.constants.Banks;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

import org.osbot.rs07.utility.ConditionalSleep;
import org.osbot.rs07.script.MethodProvider;

import java.awt.*;

@ScriptManifest(name = "BlueDyeMaker5", author = "Flog", version = 1.0, info = "", logo = "") 

public class Core extends Script {

    @Override
    public void onStart() {

    }


    @Override
    public void onExit() {

    }

    @Override

    public int onLoop() throws InterruptedException {
    	
    	goToBank();
    	getDye();

        return 100; //The amount of time in milliseconds before the loop starts over
    }
    

public void goToBank() throws InterruptedException {
		Area witchHouse = new Area(3084, 3260, 3087, 3257);
		
		
    	if(!Banks.DRAYNOR.contains(myPosition()) && getInventory().isFull()) { 
    		log("INV FULL!: Walking to bank");
    		getWalking().webWalk(Banks.DRAYNOR);
    		
	    	if(getBank().open()){
	    		log("Opening bank");
	    	    new ConditionalSleep(5000) {
	    	        @Override
	    	        public boolean condition() throws InterruptedException {
	    	            return getBank().isOpen();
	    	        }
	    	    }.sleep();
	    	}
    		getBank().depositAll("Blue Dye");
    		log("Deposited all blue dye");
    		getBank().close();
    		log("Closing bank");
			walking.webWalk(witchHouse);
			log("walking back to witchHouse");	
    	}
	}

public void getDye() throws InterruptedException {
	
	if(getInventory().getAmount("Woad Leaf") > 2 && getInventory().getAmount("Coins")> 500) {
		
    	if (getInventory().interact("Use", "Woad Leaf")) {
    		
    		NPC WitchNPC = getNpcs().closest("Aggie");
    		
    		
	    	if(WitchNPC.interact("use")){
	    		log("Using Woad on witch");
	    	    new ConditionalSleep(random(3800,6800)) {
	    	        @Override
	    	        public boolean condition() throws InterruptedException {
	    	            return getDialogues().isPendingContinuation(); //it clicks 
	    	        }
	    	    }.sleep();
	    	}

	    	log("pending continuation...");
	    	long startAmt;
	    	startAmt = getInventory().getAmount("Blue Dye");  // <- save amount of dye, then check its more than after itneract
	    	if(getDialogues().clickContinue()){
	    		log("waiting for next blue dye in inv");
	    	    new ConditionalSleep(random(5000,8000)) {
	    	        @Override
	    	        public boolean condition() throws InterruptedException {
	    	            return startAmt < (getInventory().getAmount("Blue Dye")); //wait till inv amount is more than start amount +1
	    	        }
	    	    }.sleep();	    		
	    		
	    	}
	    	sleep(random(75,360));
	    	getDialogues().clickContinue(); // Click continue on 2nd dialoug box that comes up, recieved.
	    	sleep(random(80,410));
    	}
	}
	
	else {
		log("RAN OUT OF Woads or coins! EXITING!");
		stop();
	}
}
    
    
    @Override

    public void onPaint(Graphics2D g) {

        //This is where you will put your code for paint(s)
    }

}

 

Accounts were old, had not botted on them before, only low level (20), 

The only conclusion I can come to is my use of static sleeps, rather than conditional sleeps (I wrongly assumed it would be ok for me to run it for a short while without getting banned, before I worked out a conditional sleep method that would work). <- I'm still struggling to work out how I would get a conditional wait to work in this situation.

Also, another thing which might have caused it is the GetDialouges.ClickContinue(); - seemed to react quite quickly to the dialogues, i guess this could have also seemed bot like. 

Anyone else have any comments onto why I was likely banned so quickly?

 

PS. I'm thinking of getting a members account to bot on next, fresh level 3 member. I've heard that members are less likely to be banned, is this equally true for members which have used bonds to gain members or only $ paying members? 

Edited by Floglet
Link to comment
Share on other sites

To answer your question for better sleeps:

 

Conditional sleeps are used to stop sleeping whenever your condition is true, so putting a random in the time-out isn't that useful since you'll almost never reach that.

Your onLoop is at 100ms now so you're reacting insanely quick. I read somewhere that a human reacts on average at 215ms. The best way would be using gRandom(215,80), but the method is deprecated in OSBot because it wasn't working correctly. I'm sure you'll find how to do this if you google it but that's probably not a priority right now. Start by upping that onLoop time a bit so it's more human-like.

F2P does gets higher bans than P2P & as far as I know Twitch Primes get a higher banrate than other membership methods.

It's not even sure if Jagex can see the mouse movements, some people say it matters, other people say it doesn't. The truth is there isn't enough data for us to know & sadly none of us work at Jagex.

Lastly: You are botting so you WILL get banned. It can take minutes, it can take weeks. The quality of your script is important & so is your IP (whether it's flagged and/or residential), but in the end the risk is high & if you keep botting, you will get banned eventually.

 

- Hybris

  • Like 2
Link to comment
Share on other sites

Not even worth trying to improve this tbh. The main draw of private scripts is uniqueness, which is meant to help against profiling and thus bans. You'll be hard-pressed to make a script on simple methods that have been written a thousand times before unique. Just to save you some headache, sleeps are not enough.

  • Like 1
Link to comment
Share on other sites

2 hours ago, caketeaparty said:

Not even worth trying to improve this tbh. The main draw of private scripts is uniqueness, which is meant to help against profiling and thus bans. You'll be hard-pressed to make a script on simple methods that have been written a thousand times before unique. Just to save you some headache, sleeps are not enough.

I disagree, any script written by yourself is in one way or another unique which would make it harder to detect, even if it's just a little bit.

+ I think he's mostly practicing by writing this script.

  • Like 1
Link to comment
Share on other sites

12 hours ago, Hybris said:

Your onLoop is at 100ms now so you're reacting insanely quick. I read somewhere that a human reacts on average at 215ms. The best way would be using gRandom(215,80), but the method is deprecated in OSBot because it wasn't working correctly. I'm sure you'll find how to do this if you google it but that's probably not a priority right now. Start by upping that onLoop time a bit so it's more human-like.

There's a lot of code that is blocking so in reality, the onLoop isn't actually running 1/10th of a second.

Gaussian random is also nothing special, you can use it freely but in terms of a reduction in bans, it probably is insignificant.

nextGaussian() is the method you would be looking for in the Random class (Java lib). And if someone is not familiar, you would have to actually learn what it is and then learn how to use it in terms of setting the standard deviation and average.

Link to comment
Share on other sites

Change this -

getDialogues().clickContinue();

Use spacebar to skip dialogues instead, I genuinely don't know of any player who clicks 'continue'

 

Not 100% on the current state of webalking, but I know previously it was considered to be a factor behind flagging

 

getWalking().webWalk(Banks.DRAYNOR);
walking.webWalk(witchHouse);

Create your own custom walking/path with tile radius, breaks and such

 

I mean overall your script is very simplistic, so it's hard to be creative but overall add more randomization. Things such as breaks between trips on occasion would do justice, humans become less motivated with repetition and tend to slack to some degree.. but using space instead of click for dialogues, custom walk ( depending on the current state of webwalking ) and randomization/breaks during tasks would potentially see a better outcome. ( By breaks I don't mean logout for 30mins and return - that would be ideal over a long period though - but I mean occasionally after say 10-15 trips, pause after clicking a tile/map coord for 20-30 seconds then continue ( as if you were distracted by something else ) )

 

Also now you've been banned twice/flagged for that task, use a different IP when changes have been made + clear cache.

  • Like 1
Link to comment
Share on other sites

Thanks all, yes mainly just learning how to write scripts at this stage, I agree with the more complex the task the more unique the actions will be, that may explain partially why I was banned so quickly. 

 

@Hybris Thanks for the info, I had totally passed over the onloop ms timer, didn't even realise that was a thing (obvious I know, but I seemed to have missed it :P)

 

@SyntaxRSI was a little confused about the ClickContinue, but it turns out even though it says "click" it actually does use the keyboard spacebar to continue dialogue, :) 

I'll have to learn how to make my own walk paths, I feel like webwalking would be a flag in some cases, I've noticed it consistently miss-clicking the ladder on the ground floor outside the lumbridge castle when walking to the bank. 

  • Like 1
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...