Jump to content

Bobrocket

Members
  • Posts

    1664
  • Joined

  • Last visited

  • Days Won

    4
  • Feedback

    100%

Posts posted by Bobrocket

  1. I completely agree with that statement. I'm shopping for phones atm, any good android/galaxy recommendations?

     

     

    I have the Moto G 2nd gen, dual sim, unlocked, works amazingly and I got mine for £80 through a friend.

  2. You really don't like this kid don'tcha OP.

    At least the kid is making bank out of a career that I'm assuming he enjoys. Give him a couple of years with a dash of puberty and he'll be collecting all the dropped panties from the floor.

    So does every scripter here. What's your point?

  3. You could have something like this:

    import org.osbot.rs07.script.MethodProvider;
    
    public class ConditionalTimer {
    
    	private int time, step, elapsed;
    	private TimerCondition condition;
    	
    	public ConditionalTimer(int t, TimerCondition cond, int s) {
    		time = t;
    		condition = cond;
    		step = s;
    	}
    	
    	public boolean run() throws InterruptedException {
    		elapsed = 0;
    		while (time <= elapsed) {
    			if (condition.condition()) return true;
    			MethodProvider.sleep(step);
    		}
    		return false;
    	}
    	
    	public int getElapsed() {
    		return elapsed;
    	}
    }
    
    interface TimerCondition {
    	public boolean condition();
    }
    

    Example:

    if (new ConditionalTimer(3000, () -> (myPlayer().isAnimating()), 50).run()) {
        //we're animating
    }
    else {
        //we're not animating (we haven't been animating for 3000 ms)
    }
    
  4. Well, onPaint is called 60 times per second (or 30, I don't remember).

     

    The bot holds a collection of MouseListeners. Each time you register a listener, it's added to this collection. Registering 60 new mouse listeners per second is not only a fairly critical memory leak; but will increase your CPU usage over time, since every single mouse event has to be processed by the constantly growing number of listeners ;o.

     

    I'm fairly surprised if you've been able to run it for ~30 minutes without seeing poor performance

     

     

    I think onPaint (in this context) would be called 50 times per second (syncing with the RS client).

    The reason we add our listeners in onStart is because otherwise we're creating a new listener 50 times per second (every 20ms), as well as assigning it to the bot to listen. When we click then, something along this would occur:

    //when clicked
    for (MouseListener ml : listeners) ml.onClick(mouseArgs);
    

    So that means your mouse listeners will also be executing many times in tandem.

  5. The username is directly entered by your script using their osbot username, so unless someone has the URL and knows the php parameters, they aren't going to have the ability to do anything

     

    Why don't you understand that if someone wants to get all of your data, they will. All I need to do is just turn on wireshark, look at my connections, and grab the data. You don't sanitise any data in the update page, you use deprecated MySQL in signature.php, you rely solely on mysql_real_escape_string (which will not escape certain characters like \ and \x00). At least you mask errors, that's a start.

    • Like 2
  6. For the record, there is SQL injection protection

     

     

    $setResult = mysqli_query ( $conn, "SELECT * FROM Data WHERE Username='$nametemp'" ); // Selects all fields from the Data table, based on the username supplied
    

    What happens when $nametemp is ' OR '1'='1'? Look into parametised queries or sanitise your input properly :/ :/

  7. To understand why this fully works, you need to (somewhat) understand how OSRS works as well as how the OSBot API works. I'll explain both the theory and the solution, but I'll put the theory in a spoiler so you don't have to read it.

     

    Theory:

    In RS, actions work on a tick-based system. Each tick lasts approximately 2/3 of a second (let's just call it 0.6 seconds), which means that if you click, it wont actually run until the next game tick (anywhere between 0.001 and 0.6 seconds if you think about it). In the perspective of a game tick, you'd be clicking this tree 2-3 times per game tick.

     

    Lastly, as far as OSBot goes, the #closest() method works by counting the amount of tiles between you and the object, not the actual distance. This means that an object that is technically further away from you (diagonal vs pure horizontal; our main man Pythagoras proves this) is counted as the same distance.

     

    Your solution would be to tag your tree in a variable, like so:

    //Global var
    Entity tree;
    
    //onLoop
    if (tree == null || !tree.exists()) {
        tree = getObjects().closest("Tree");
        if (!tree.isVisible()) getCamera().toEntity(tree);
        tree.interact("Chop down");
    }
    
    • Like 1
  8. If you're on a VPN, your entire IP and anything you do will be on that VPN's IP. If you want to do what you are describing, get a proxy.

     

    This is (somewhat) wrong. It is possible to route to disallow your VPN for certain IPs, however it is extremely tricky and going to be a huge pain for everything non-RS.

    A better solution would be to use the VPN on your router, that way you can allow certain ports/IPs/pcs to use the vpn.

    • Like 1
  9. what i dont get is, its saying that  these are giving npe's

    88d3831155.png

     

    even if im not using any of those methods, i can't nullcheck these right? its so confusing wow lol didn't do this in a looooong time

     

     

    String abbysorby = (Absorbpts == null ? "-1" : Absorbpts.getMessage());
    
    • Like 2
  10. I'd prefer not going on a wild witch hunt; I would prefer if the OP gave something specific for me to test that pertains to his specific issue (which I don't think is large models).

     

    @Apaec mentioned wall-mounted amulets of glory as being a bitch to interact with.

×
×
  • Create New...