Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. import java.awt.Point;
  2. import java.util.Random;
  3.  
  4. import org.osbot.rs07.api.ui.Skill;
  5. import org.osbot.rs07.api.ui.Tab;
  6. import org.osbot.rs07.script.MethodProvider;
  7.  
  8. public class Antiban extends MethodProvider {
  9.  
  10. private MethodProvider mp;
  11. private Random random;
  12.  
  13. public void randomInputEvent()
  14. {
  15. try
  16. {
  17. int rN = this.random.nextInt(3);
  18. switch (rN)
  19. {
  20. case 0:
  21. this.mp.getCamera().movePitch(this.random.nextInt(360));
  22. this.mp.getCamera().moveYaw(
  23. 22 + this.random.nextInt(22 + this.random.nextInt(45)));
  24. break;
  25. case 1:
  26. this.mp.getCamera().movePitch(this.random.nextInt(360));
  27. break;
  28. case 2:
  29. this.mp.getMouse().move(this.random.nextInt(760), this.random.nextInt(500));
  30. break;
  31. case 3:
  32. moveMouseRandomly(1 + this.random.nextInt(6));
  33. }
  34. }
  35. catch (Exception localException) {}
  36. }
  37.  
  38. public void randomInterfaceEvent(Skill currentSkill)
  39. {
  40. try
  41. {
  42. int rN = this.random.nextInt(3);
  43. switch (rN)
  44. {
  45. case 0:
  46. this.mp.getSkills().hoverSkill(currentSkill);
  47. break;
  48. case 1:
  49. this.mp.getTabs().open(Tab.ATTACK);
  50. break;
  51. case 2:
  52. this.mp.getTabs().open(Tab.FRIENDS);
  53. break;
  54. case 3:
  55. this.mp.getTabs().open(Tab.SKILLS);
  56. }
  57. }
  58. catch (Exception localException) {}
  59. }
  60.  
  61. public void moveMouseRandomly(int numberOfPositions) throws InterruptedException
  62. {
  63. Point[] pointArray = new Point[numberOfPositions];
  64. for (int i = 0; i < pointArray.length; i++) {
  65. pointArray[i] = new Point(-10 + this.random.nextInt(850), -10 +
  66. this.random.nextInt(550));
  67. }
  68. for (int i = 0; i < pointArray.length; i++)
  69. {
  70. this.mp.getMouse().move(pointArray[i].x, pointArray[i].y);
  71. sleep(random(200,500));
  72. }
  73. }
  74.  
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement