Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.13 KB | None | 0 0
  1. package Yews;
  2.  
  3. import java.awt.Graphics2D;
  4. import java.util.Timer;
  5.  
  6. import org.osbot.rs07.api.Bank;
  7. import org.osbot.rs07.api.map.PolygonArea;
  8. import org.osbot.rs07.api.map.Position;
  9. import org.osbot.rs07.api.map.constants.Banks;
  10. import org.osbot.rs07.api.model.Entity;
  11. import org.osbot.rs07.api.model.Vector3D;
  12. import org.osbot.rs07.api.ui.Skill;
  13. import org.osbot.rs07.event.WalkingEvent;
  14. import org.osbot.rs07.script.Script;
  15. import org.osbot.rs07.script.ScriptManifest;
  16. import org.osbot.rs07.utility.Area;
  17. @ScriptManifest(author = "Malachi", info = "", logo = "", name = "Yews", version = 0.1)
  18. public class Yews extends Script{
  19.  
  20. Position destination = Banks.VARROCK_WEST.getClosest(myPosition());
  21. String[] ids = {"Bronze axe", "Iron axe", "Steel axe", "Black axe", "Mithril axe", "Adamant axe", "Rune axe", "Dragon axe"};
  22. boolean flag = false;
  23. WalkingEvent we = new WalkingEvent(destination);
  24. final Area YEW_AREA_VARROCK = new Area(3202, 3506,3224, 3499);
  25. final Area GE_AREA = new Area(3160, 3493, 3169, 3486);
  26. int logsChopped = 0;
  27. static Timer runTime;
  28. private int beginningXP, currentXP, xpGained;
  29. final String YEW_NAME = "Yew";
  30. final int BANK_BOOTH_ID = 10060;
  31. String currentAxe;
  32.  
  33.  
  34. public void onStart(){
  35. Timer time = new Timer();
  36. beginningXP = skills.getExperience(Skill.WOODCUTTING);
  37. }
  38.  
  39. public void onExit(){
  40.  
  41. }
  42.  
  43. @Override
  44. public int onLoop() throws InterruptedException {
  45. // TODO Auto-generated method stub
  46.  
  47. if(getInventory().isFull()){
  48. //bank
  49. if(YEW_AREA_VARROCK.contains(myPlayer())){
  50. this.execute(we);
  51. if(getBank().open()){
  52. Entity bankbooth = getObjects().closest(BANK_BOOTH_ID);
  53. if(bank.isOpen()){
  54. sleep(random(62, 103));
  55. bank.depositAll();
  56. }
  57. else{
  58. if(getBank().open()){
  59. bankbooth.interact("Bank");
  60. sleep(random(700,801));
  61. }
  62. else{
  63. camera.toEntity(bankbooth);
  64. }
  65. }
  66. }
  67. }
  68. else{
  69. this.localWalker.walk(GE_AREA, true);
  70. if(getBank().open()){
  71. Entity bankbooth = getObjects().closest(BANK_BOOTH_ID);
  72. if(bank.isOpen()){
  73. sleep(random(62, 103));
  74. bank.depositAll();
  75. }
  76. else{
  77. if(getBank().open()){
  78. bankbooth.interact("Bank");
  79. sleep(random(700,801));
  80. }
  81. else{
  82. camera.toEntity(bankbooth);
  83. }
  84. }
  85. }
  86. }
  87.  
  88. }
  89. else{
  90. for(int i = 0; i<ids.length-1; i++){
  91. if(inventory.contains(ids[i])){
  92. flag = true;
  93. currentAxe = ids[i];
  94. }
  95. //else if(this.isWieldingItem(2));
  96. }
  97. //if(flag == true){
  98. if(YEW_AREA_VARROCK.contains(myPlayer())){
  99. Entity yew = getObjects().closest(YEW_NAME);
  100. if(yew!= null){
  101. if(yew.isVisible()){
  102. if(!myPlayer().isAnimating()){
  103. yew.interact("Chop down");
  104. sleep(random(503, 775));
  105. }
  106. else{
  107. sleep(random(400, 533));
  108. }
  109. }
  110. else{
  111. camera.toEntity(yew);
  112. }
  113. }
  114. }
  115. else{
  116. this.localWalker.walk(YEW_AREA_VARROCK, true);
  117. }
  118.  
  119. //}
  120.  
  121. }
  122.  
  123. return 0;
  124. }
  125. public void onPaint(Graphics2D g){
  126.  
  127. }
  128.  
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement