Advertisement
Guest User

Untitled

a guest
Nov 20th, 2015
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. package woodcutter;
  2.  
  3. import java.awt.Graphics;
  4.  
  5. import org.osbot.rs07.api.Bank;
  6. import org.osbot.rs07.api.Inventory;
  7. import org.osbot.rs07.api.map.Area;
  8. import org.osbot.rs07.api.model.Entity;
  9. import org.osbot.rs07.script.Script;
  10. import org.osbot.rs07.script.ScriptManifest;
  11.  
  12. @ScriptManifest(author = "Em0re", info = "WoodCuts Logs at G.E", logo = "", name = "WoodCutter", version = 0.1)
  13. public class Woodcutter extends Script {
  14.  
  15. final Area BANK_AREA = new Area(3170, 3485, 3160, 3494);
  16. final Area YEW_AREA = new Area(3202, 3506, 3224, 3499);
  17. final int BANKER_ID = 5455;
  18.  
  19. // code used at start.
  20. public void onStart() {
  21.  
  22. }
  23.  
  24. // Code to be excuted at the end
  25. public void onExit() {
  26.  
  27. }
  28.  
  29. // code in loop
  30. public int onLoop() throws InterruptedException {
  31.  
  32. Inventory inven = getInventory();
  33. Bank bank = getBank();
  34.  
  35. if (!inven.isFull()) {
  36. // chop
  37.  
  38. if(YEW_AREA.contains(myPlayer())){
  39.  
  40.  
  41.  
  42. Entity yew = getObjects().closest("Yew");
  43.  
  44. if (yew != null) {
  45. if (yew.isVisible()) {
  46. log("Yew is visible");
  47. if (!myPlayer().isAnimating()) {
  48. if (!myPlayer().isMoving()) {
  49. yew.interact("Chop down");
  50. sleep(random(700, 800));
  51. }
  52. }
  53. } else {
  54. getCamera().toEntity(yew);
  55. log("camera moving to yew");
  56. }
  57. }
  58. }else{
  59. // walk yew area
  60. }
  61. } else {
  62.  
  63. // bank
  64. if (BANK_AREA.contains(myPlayer())) {
  65. Entity banker = getObjects().closest(BANKER_ID);
  66.  
  67. if (bank.isOpen()) {
  68. bank.depositAll();
  69.  
  70. } else {
  71.  
  72. }
  73.  
  74. if (banker != null) {
  75. if (banker.isVisible()) {
  76. banker.interact("Bank");
  77. sleep(random(700, 800));
  78.  
  79. }else{
  80. getCamera().toEntity(banker);
  81. }
  82. }
  83.  
  84. } else {
  85. //walk to the bank area
  86. }
  87. }
  88. return 50;
  89.  
  90. }
  91.  
  92. // Paint
  93. public void onPaint(Graphics g) {
  94.  
  95. }
  96.  
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement