Jump to content

Bobrocket

Members
  • Posts

    1664
  • Joined

  • Last visited

  • Days Won

    4
  • Feedback

    100%

Posts posted by Bobrocket

  1. Focus can play a very important factor in your script; it could be the difference between a ban or not. As a result, I have found a way to simulate the idea of focus.

    Take this graph as an example:

    f6c9b8f419bb81abe4383e7aee138ab3.png

    This graph shows the distributions of 3 response profiles: focused (in red), playing normally (in orange), and unfocused (in blue)

    Please note that this graph is not based on any statistical evidence.

    If you are focused (for example you're being PK'd), you are more likely to click faster and respond faster. If you are playing the game normally, you will click at an average-ish time. If you aren't focused (for example watching TV), you are more likely to click slower.

     

    This graph shows that the graph for being focused is a positive distribution. This means that the majority of the data will be clustered towards the negative end (closer to 0) than the positive end. It also shows that not being focused has a negative distribution, which means that the majority of the data is clustered towards the positive end (closer to 100 or wherever the graph ends) than 0. Playing normally has a normal distribution, which means that the data clusters around the midpoint of the data (in this scenario it would likely be symmetrical too, meaning that mean = mode = median)

     

    Below is some code that I found on Stackoverflow and slightly modified it.

    public int positiveSkewedRandom(int min, int max) {
    	return skewedRandom((double) min, (double) max, 2.55, -1.68);
    }
    
    public int negativeSkewedRandom(int min, int max) {
    	return skewedRandom((double) min, (double) max, 2.55, 1.68);
    }
    
    public int skewedRandom(double min, double max, double skew, double bias) {
    	Random r = new Random(System.currentTimeMillis());
    	double range = max - min;
    	double mid = min + range / 2.0;
    	double unitGaussian = r.nextGaussian();
    	double biasFactor = Math.exp(bias);
    	double retval = mid + (range * (biasFactor / (biasFactor + Math.exp(-unitGaussian / skew)) - 0.5));
    	return (int) retval;
    }
    

    The params for skewedRandom:

    • min - the minimum possible value
    • max - the maximum possible value
    • skew - how close the data would be clustered together (higher = tighter clustering)
    • bias - the tendency for the mode to approach the min/max/midpoint of the data; negative = positive bias, positive = negative bias

    Usage:

    boolean focused = true;
    if (focused) {
        sleep(positiveSkewedRandom(100, 750));
    }
    else {
        sleep(negativeSkewedRandom(100, 750));
    }
    

    If the data is not skewed enough, you can change the skew and bias settings in the respective method.

     

    Good luck, and happy botting! smile.png

    • Like 3
  2. Maybe have two tiers of mules:

     

    Tier 2 mule - trades with your bots (random items/gp on both sides + the items you want)

    Tier 1 mule - trades with tier 2 mule (random items/gp on both sides + items wanted) then sells the items and trades with your main for the gp and some random items

     

  3. This doesn't really solve the main misclick issues, though.

    Just like the method in the API, it lacks a check for whether or not the menu is still open before clicking (At least the API method used to lack it. I am not 100% certain that it still does). Due to the nature of the mouse algo, the path taken to the option can sometimes lead to the mouse getting too far away from the menu, closing it on the way.

     

    I made some API methods for interaction with this last check about a year ago, will probs post in snipper section when I get home

     

    Offtopic, using while loops without any form of timeout is generally a bad idea

     

    There is a check to make sure the mouse is at the random position (which is within the bounding box). There is also a check to see if the menu is open before it clicks.

  4. I love the missclicks smile.png You know your script is well written once it can handle missclicks. imo it doesn't missclick that often.

    Just look up the current implementation and try to 'improve' it, no need to do fancy stuff with fonts you got all the widget sizes.

    My script can handle misclicks just fine, but it does it and that doesn't help (+ it sometimes is way too fast imo)

     

    To get the rectangle for a menu item (Eg. "Walk here"), you can do something like this:

     

    getMenuAPI().getOptionRectangle(getMenuAPI().getMenuIndex(null, new String[]{"Walk here"});

    I don't remember if it allows null for entity names, though. If not you can just iterate the Option list to find the index of whatever option you want.

     

    Here's the implementation I thought of:

    public boolean interactWith(Entity e, String action) throws InterruptedException {
    		if (e == null) {
    			return false;
    		}
    		
    		while (!getMouse().isOnCursor(e)) { e.hover(); sleep(rand(450, 750)); } //hover
    		while (!getMenuAPI().isOpen()) { getMouse().click(true); sleep(rand(150, 450)); } //open interface
    		sleep(rand(150, 450));
    		
    		List<Option> options = getMenuAPI().getMenu();
    		int rectIndex = -1;
    		
    		for (int i = 0; i < options.size(); i++) {
    			Option o = options.get(i);
    			String s = o.action;
    			if (s.equals(action)) {
    				rectIndex = i;
    				break;
    			}
    		}
    		
    		if (rectIndex == -1) {
    			return false;
    		}
    		
    		Rectangle optionRect = getMenuAPI().getOptionRectangle(rectIndex);
    		
    		int height = optionRect.height;
    		int startX = optionRect.x;
    		int startY = optionRect.y;
    		int width = optionRect.width;
    		int endX = startX + width;
    		int endY = startY + height;
    		
    		//2px bounds incase the bounding boxes are fucked
    		int randX = getRandom(startX + 1, endX - 1);
    		int randY = getRandom(startY + 1, endY - 1);
    		
    		while (!(getMouse().getPosition() == new Point(randX, randY))) { getMouse().move(randX, randY); sleep(rand(450, 750)); } //move to option
    		sleep(rand(150, 450));
    		while (getMenuAPI().isOpen()) { getMouse().click(false); sleep(rand(750, 1150)); } //click
    		
    		return true;
    	}
    

    Could definitely be improved, however I cannot test and currently this seems like the best way.

  5. hmm I never tried this before. 

    For what purpose would you need this ?

     

    Khaleesi

    I would like to write my own right click - interact method using this as the one in OSBot seems to be too fast and misclicks a lot.

     

    If you have the actual font file, it would be easy to determine the dimensions of any given string, using fontmetrics og glyph vectors. A Graphics object should provide access to these.

     

    If you just want to calculate an area in the rs right-click menu, you can easily do so by using the MenuAPI class

    Thank you, will use MenuAPI. I know how to measure font widths/heights, that's why I was asking how to get the font :P

     

  6. What I have found that works best is to have a web portal that automatically updates when they get more money, and that they can cash out whenever (within reason ofc). This will mean that they can quit whenever they want but of course they wont get any money for stuff they don't do. It also gives the idea that you are flexible as their job is.

    You should also have a "pending" balance where it shows the amount that is waiting for confirmation (eg the guy actually confirming that he received it and was not scammed etc)

  7. I always found OBS complicated to use. I much prefer Fraps as no set up is actually required (and I like that). It also records lossless HD perfectly on my computer, including 60fps on cs:go (high settings, full resolution; surprised me)

    When I'm recording RuneScape, I actually use Hypercam 2 as it is super lightweight and allows me to change the resolution easily for OSBuddy (and it has super small file sizes) + the "Unregistered Hypercam 2" isn't there anymore!

  8. Probably god awful with all the additional crapware they loaded like cortana and apps built into the startbar. I wish Microsoft would stop trying to appease hipsters that need fancy gadgets to justify a purchase, the hipsters will just flock to Apple.

    Windows 7 comes with a lot of additional crapware too, and you can just disable it. I imagine it would be the same for Cortana and everything else.

    I'm considering upgrading as I have a Windows tablet and would love to try out Win10 to see if it really is better than 7. If not, I'll just downgrade.

    The only problem I am going to face is the fact that my processor is a tad old, so there may not be any drivers on Win10 for it. Hopefully there will be some and all runs well, as the rest of my hardware is fairly new.

  9. It may be mirror related, I'll talk with MGI.

    As of this update (2.3.71), it doesn't dismiss randoms on injection mode either.

    Before the update (2.3.70), it didn't dismiss randoms on mirror mode (but did perfectly fine on injection)

     

  10. Been a few days since an update:

    -Account 3 is a member, and is currently thieving with a private script.

    -Account 2 is on holiday, as I am running low-ish on resources as of now.

    No bans as of yet, although I feel Account 3 may be flagged. That same sort of feeling that someone is watching you, except instead of a pedo it's a jmod (same thing really, but who am I to judge?)

  11. Glad to see this new update, I have a feeling that ban rates will be reduced with this new entity interaction.

    Alek, do you think you could implement a font API of sorts somehow? For example, being able to call something like (getFonts().RS_DIALOGUE) may help a lot of scripters make custom methods for interaction with dialogue and interfaces. If this is already included somewhere, ignore this. Just a suggestion :)

  12. yes it will, it only grabs the options for that specific object

    I fixed it a different way:

    if (getMouse().getOnCursorCount() > 1) {
    	if (lock == 0) stall.interact("Steal-from");
    	else log("Locked!!");
    }
    else {
    	if (lock == 0) getMouse().click(false);
    	else log("Locked!!");
    }
    

    Seems to work better for me. No idea why :/

     

    Another problem I'm having: both localWalker and getMap() refuse to move my character one square to the left..

    while (!getMap().walk(p)) { }
    log("trying to walk " + myPlayer().getPosition() + " " + p);
    

    It will log, so it shows that the while loop ends (indicating that the walk has executed) although the mouse doesn't move and the neither does the player; it's stuck there forever.

     

  13. object.getActions()[0] for the first option in the index*

     

    careful though, some objects have null options, so you may want to make a small method to filter out all the null options

     

    e.g. I tried doing this for my bank method, (bank chests have 'use', bank booths have 'bank') however the bank booth's first hidden option was null, then it was 'Bank'

    Thank you :)

    Will this still work if there are things in the way? For example, if there is a guard in the way the first option would be "Pickpocket" for the guard, but the first option for the stall is always "Steal-from".

     

  14. I did for 10 minutes. Couldn't find it. Anyways though, I know it checks if it's attackable but does it check if the npc has the option to be attacked or if you can now attack it.

     

    Edit: Never knew there was an index to search in. My bad.

    //Quick way
    if (<npc>.hasAction("Attack")) {
        //Can be attacked
    }
    
    //Slower way (requires mouse to hover over)
    <npc>.hover();
    while (!getMenuAPI().isOpen()) { getMouse().click(true); sleep(250); } //right click
    boolean hasAttack = false;
    for (Option o : getMenuAPI().getMenu()) {
    	log(o.action);
    	if (o.action.equals("Attack")) {
    		hasAttack = true;
    		break;
    	}
    }
    
    if (hasAttack) {
        //Can be attacked
    }
    
    • Like 1
×
×
  • Create New...