Guest User

Untitled

a guest
Dec 11th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.53 KB | None | 0 0
  1. import com.rsbuddy.event.events.MessageEvent;
  2. import com.rsbuddy.event.listeners.MessageListener;
  3. import com.rsbuddy.event.listeners.PaintListener;
  4. import com.rsbuddy.script.ActiveScript;
  5. import com.rsbuddy.script.Manifest;
  6. import com.rsbuddy.script.methods.Inventory;
  7. import com.rsbuddy.script.methods.Objects;
  8. import com.rsbuddy.script.methods.Players;
  9. import com.rsbuddy.script.methods.Walking;
  10. import com.rsbuddy.script.util.Random;
  11. import com.rsbuddy.script.util.Timer;
  12. import com.rsbuddy.script.wrappers.GameObject;
  13.  
  14. import java.awt.*;
  15. import java.awt.event.MouseEvent;
  16. import java.awt.event.MouseListener;
  17. import java.awt.event.MouseMotionListener;
  18.  
  19. @Manifest(name = "TutorialChampion", version = 0.01, authors = "iCyrus")
  20. public class TutorialChampion extends ActiveScript implements PaintListener, MessageListener, MouseListener, MouseMotionListener {
  21.  
  22. private static final int TREE_ID = 1278;
  23.  
  24. private int random(int min, int max) {
  25. return Random.nextInt(min, (max + 1));
  26. }
  27.  
  28. public boolean onStart() {
  29. return true;
  30. }
  31.  
  32. public int loop() {
  33. if (!Inventory.isFull()) {
  34. GameObject tree = Objects.getNearest(TREE_ID);
  35. if (tree != null) {
  36. if (!tree.isOnScreen()) {
  37. Walking.findPath(tree.getLocation()).traverse();
  38. return random(800, 1000);
  39. } else {
  40. tree.interact("Chop down Tree");
  41. sleep(600, 800);
  42. Timer t = new Timer(random(800, 1000));
  43. while (t.isRunning() && tree != null && Objects.getTopAt(tree.getLocation()).getId() == TREE_ID) {
  44. if (Players.getLocal().getAnimation() != -1 || Players.getLocal().isMoving()) {
  45. t.reset();
  46. }
  47. sleep(30);
  48. }
  49. }
  50. }
  51. }
  52. return 0;
  53. }
  54.  
  55. public void messageReceived(MessageEvent e) {
  56. String s = e.getMessage();
  57. }
  58.  
  59. public void onRepaint(Graphics g1) {
  60. }
  61.  
  62. public void mouseClicked(MouseEvent e) {
  63. int x = e.getX();
  64. int y = e.getY();
  65. }
  66.  
  67. public void mousePressed(MouseEvent e) {
  68. }
  69.  
  70. public void mouseReleased(MouseEvent e) {
  71. }
  72.  
  73. public void mouseEntered(MouseEvent e) {
  74. }
  75.  
  76. public void mouseExited(MouseEvent e) {
  77. }
  78.  
  79. public void mouseDragged(MouseEvent e) {
  80. }
  81.  
  82. public void mouseMoved(MouseEvent e) {
  83. }
  84. }
Add Comment
Please, Sign In to add comment