Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • How to use camera.rotateto?


    xdanishgamerz

    Recommended Posts

    So i was about to make my first script for Dreambot. I'm making a cow killer script that should kill cows, pick up hide and then bank when inventory is full.

    The problem is that sometimes the cows is out of the screen, and because of that the bot won't attack them.

     

    I tried to do something like this

     

    NPC Cow = getNpcs().getClosest("Cow");

     

    if (Cow.isOnScreen()){

    blablabla

    }else{

    Camera.rotateTo(Cow);

    }

     

    Sadly This don't work. Can someone tell me how to fix this :)?

     

    Edit: I found out how to use the Camera Rotation.

    I had to use getCamera() instead of just Camera() for some reason >_> 

    Link to comment
    Share on other sites

    Edit: I found out how to use the Camera Rotation.

    I had to use getCamera() instead of just Camera() for some reason >_> 

     

    Oh the reason for this is the type of API we provide, which is a non-static, the reason being for getCamera(), since your grabbing a instance of Camera which was instantiated inside of the class your calling from. Some API's use static references, which then Camera.rotateTo() would probably work. Though long story short, we really don't like static API's, along with a few other performance reasons we chose to use a non-static based API.

    Link to comment
    Share on other sites

    Oh the reason for this is the type of API we provide, which is a non-static, the reason being for getCamera(), since your grabbing a instance of Camera which was instantiated inside of the class your calling from. Some API's use static references, which then Camera.rotateTo() would probably work. Though long story short, we really don't like static API's, along with a few other performance reasons we chose to use a non-static based API.

    Cool, cool. Just make a java noob like me confused.. I already got stuck again when it came to travel a path. ._.

    Link to comment
    Share on other sites

    Cool, cool. Just make a java noob like me confused.. I already got stuck again when it came to travel a path. ._.

     

    We do provide web walking, and all you have to do to use it is to call:

    getWalking().walk(new Tile(3300, 3300, 0)); // Tile is the end location

     

    It will take one step each time you call that method, so you can control how it loops!

    Link to comment
    Share on other sites

    We do provide web walking, and all you have to do to use it is to call:

    getWalking().walk(new Tile(3300, 3300, 0)); // Tile is the end location

     

    It will take one step each time you call that method, so you can control how it loops!

    Oh.. I've never used that before, why don't the client provide paths? Isnt it easier to use?

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.