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
  • Camera Rotating


    Big Buddha

    Recommended Posts

    So with this edgeville trapdoor sometimes my script gets stuck on entering the trapdoor because the screen is covered with a brick wall.

    I've been trying to rotate the camera whenever this happens but things seem a bit odd.

     

    I've tried:

    GameObject trapdoor = getGameObjects.closest("Trapdoor");
    if(!trapdoor.isOnScreen){
    getCamera().mouseRotateToEntity(trapdoor);

    No succes because apparently it's already on my screen?

    So that means it doesn't have to rotate either.

     

    Another option was that I just added a

    getCamera().mouseRotateTo(int, int)

    to my loop.

    It seems very sketchy to me though and I fear for the ban rate of my script if I'd implement this.

    I also tried changing the int to a andom number with:

    int + Math.random()*1000

     

    My script is running atm, it's just that it gets stuck sometimes with the camera angle.

     

     

    If anybody knows how to fix this or has any ideas?

    Link to comment
    Share on other sites

    So with this edgeville trapdoor sometimes my script gets stuck on entering the trapdoor because the screen is covered with a brick wall.

    I've been trying to rotate the camera whenever this happens but things seem a bit odd.

     

    First of all, i see many people having trouble with "isOnScreen". It's not that hard.. Even if it's behind a wall, but inside the dreambot's viewport (actual game screen), it is on screen.

     

    You are talking about if it's visible. These two things are completely different.

     

    For the following:

     

    Another option was that I just added a

     

    getCamera().mouseRotateTo(int, int)

     

    to my loop.

     

    It seems very sketchy to me though and I fear for the ban rate of my script if I'd implement this.

     

    I also tried changing the int to a andom number with:

     

    int + Math.random()*1000

     

     

    you can do this:

    getCamera().mouseRotateTo(Calculations.random(int,int), Calculations.random(int,int));
    
    //Calculations.random(intA,intB) --- intA = min int, intB = max int --- it will pick a 
    //number between intA and intB.
    

    Solution

    The solution lays in the fact of actually clicking the trapdoor. If it's clickable, then continue. If it's not, then rotate camera.

    I'm in a hurry so can't help you at the moment, will help you later.

    Link to comment
    Share on other sites

    ya, walk to trap door before you click it

    I've already walked within distance < 3 of the trapdoor.

    First of all, i see many people having trouble with "isOnScreen". It's not that hard.. Even if it's behind a wall, but inside the dreambot's viewport (actual game screen), it is on screen.

     

    You are talking about if it's visible. These two things are completely different.

     

    For the following:

     

    Another option was that I just added a

     

    getCamera().mouseRotateTo(int, int)

     

    to my loop.

     

    It seems very sketchy to me though and I fear for the ban rate of my script if I'd implement this.

     

    I also tried changing the int to a andom number with:

     

    int + Math.random()*1000

     

     

    you can do this:

    getCamera().mouseRotateTo(Calculations.random(int,int), Calculations.random(int,int));
    
    //Calculations.random(intA,intB) --- intA = min int, intB = max int --- it will pick a 
    //number between intA and intB.
    

    Solution

    The solution lays in the fact of actually clicking the trapdoor. If it's clickable, then continue. If it's not, then rotate camera.

    I'm in a hurry so can't help you at the moment, will help you later.

    Cool, I'll check out the API for clickable classes

    Link to comment
    Share on other sites

    I've already walked within distance < 3 of the trapdoor.

    Cool, I'll check out the API for clickable classes

    As far as i'm concerned of, there is nothing like a method to check if it's actually clicked besides just boolean returns.

     

    Maybe the class Interactable with method getClickablePoint() will return you any actual clickable points, and if there aren't it should return null. @Pandemic?

     

    if so:

    GameObject trapdoor = getGameObjects.closest("Trapdoor");
    
    if(trapdoor.isOnScreen){ //Notice that i removed the "!", because there will only be a clickable point if the entity is visible.
       if(trapdoor.getClickablePoint() != null){
          getMouse().click(trapdoor.getClickablePoint());
       } else {
          getCamera().mouseRotateTo(Calculations.random(int,int), Calculations.random(int,int));
          //Find the bounds of the X and Y rotation manually when it gets stuck.
    }
    

    :)

    Link to comment
    Share on other sites

    As far as i'm concerned of, there is nothing like a method to check if it's actually clicked besides just boolean returns.

     

    Maybe the class Interactable with method getClickablePoint() will return you any actual clickable points, and if there aren't it should return null. @Pandemic?

     

    if so:

    GameObject trapdoor = getGameObjects.closest("Trapdoor");
    
    if(trapdoor.isOnScreen){ //Notice that i removed the "!", because there will only be a clickable point if the entity is visible.
       if(trapdoor.getClickablePoint() != null){
          getMouse().click(trapdoor.getClickablePoint());
       } else {
          getCamera().mouseRotateTo(Calculations.random(int,int), Calculations.random(int,int));
          //Find the bounds of the X and Y rotation manually when it gets stuck.
    }
    

    :)

     

     

    We can't determine if a point is actually clickable, Interactable#getClickablePoint just returns a random point on the model.

    Link to comment
    Share on other sites

    We can't determine if a point is actually clickable, Interactable#getClickablePoint just returns a random point on the model.

    nice naming :D

    Link to comment
    Share on other sites

    We can't determine if a point is actually clickable, Interactable#getClickablePoint just returns a random point on the model.

    so I just rotate the camera everytime I get to a gate or trapdoor?

    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.