Big Buddha 6 Posted July 1, 2016 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?
Cardozz 46 Posted July 1, 2016 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.
Big Buddha 6 Author Posted July 1, 2016 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
Cardozz 46 Posted July 1, 2016 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. }
Pandemic 2842 Posted July 1, 2016 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.
Mad 86 Posted July 1, 2016 We can't determine if a point is actually clickable, Interactable#getClickablePoint just returns a random point on the model. nice naming
Pandemic 2842 Posted July 1, 2016 nice naming Well it was either that or getModelPointForMouseThatYouMightNotBeAbleToClickIfItsBehindAWallButYouMightBeAbleTo()
Big Buddha 6 Author Posted July 1, 2016 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?
Pandemic 2842 Posted July 1, 2016 so I just rotate the camera everytime I get to a gate or trapdoor? Just check if it interacts, if not, rotate and try again
Recommended Posts
Archived
This topic is now archived and is closed to further replies.