Guest User

Untitled

a guest
Jul 22nd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. import com.quirlion.script.*;
  2.  
  3. public class TestBank extends Script {
  4. private final java.util.Random random = new java.util.Random();
  5.  
  6. public static String scriptDescription = "<html><i>Bank Test</i><br><br>"
  7.  
  8. + "Test Subject #1</html>";
  9.  
  10. @Override
  11. public int loop() {
  12. if (needtobank()){
  13. return random(200,500);
  14. }
  15. return 0;
  16. }
  17.  
  18. public boolean needtobank(){
  19. if (inventory.getCount()!=0){
  20. if (players.getCurrent().getLocation()!=npcs.getNearestByID(7605).getLocation()){
  21. players.getCurrent().walkTileMM(npcs.getNearestByID(7605).getLocation());
  22. Input.wait(random(200,500));
  23. }
  24. }
  25. for (int i=0;i<npcs.getNearestByID(7605).getActions().length; i++){
  26. log(npcs.getNearestByID(7605).getActions()[i]);
  27. }
  28. try {
  29. npcs.getNearestByID(7605).click("Bank Banker"); } catch (Exception e){log(""+e);}
  30. Input.wait(random(700,900));
  31. bank.close();
  32. isStopped=true;
  33. return true;
  34. }
  35.  
  36. public int random(final int min, final int max) {
  37. final int n = Math.abs(max - min);
  38. return Math.min(min, max) + (n == 0 ? 0 : random.nextInt(n));
  39. }
  40.  
  41. }
Add Comment
Please, Sign In to add comment