Advertisement
Guest User

Untitled

a guest
Nov 9th, 2016
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. /**
  2. * Created by Gundyr on 9-11-2016.
  3. */
  4. import java.awt.Color;
  5. import java.awt.Font;
  6. import java.awt.Graphics2D;
  7.  
  8. import org.dreambot.api.methods.Calculations;
  9. import org.dreambot.api.methods.map.Area;
  10. import org.dreambot.api.methods.map.Tile;
  11. import org.dreambot.api.script.AbstractScript;
  12. import org.dreambot.api.script.Category;
  13. import org.dreambot.api.script.ScriptManifest;
  14. import org.dreambot.api.utilities.Timer;
  15. import org.dreambot.api.wrappers.interactive.GameObject;
  16.  
  17.  
  18.  
  19. @ScriptManifest(name = "ashpicker", description = "Dem ashes", author = "Grundyr", version = 1.0, category = Category.OTHERS)
  20. public class main extends AbstractScript {
  21.  
  22. Area GE = new Area(3044, 3283, 3067, 3297); // defining an area called cabbagearea
  23. Tile Banktile = new Tile(3045, 3234); // tile of the depositbox
  24. Grounditem Ashes; // cabbage
  25. GameObject Bank; // depositbox
  26.  
  27. public int onLoop()
  28. {
  29. if(!getInventory().isFull()) {
  30. if(GE.contains(getLocalPlayer())) {
  31. Ashes = getGroundItems().closest(a -> a != null && a.getName().equals("Ashes") && c.hasAction("Take")); // defining cabbage by using a filter
  32. Ashes.interact("Take");
  33. sleepUntil(() -> Calculations.random(1312, 1939)); // example of conditional sleep, very helpful and should be saved
  34. sleep(Calculations.random(245, 531));
  35. } else {
  36. getWalking().walk(GE.getRandomTile());
  37. sleep(Calculations.random(1916,2931));
  38. }
  39. } else {
  40. if(Bank.distance(getLocalPlayer()) <= 6) {
  41. if(getBank().isOpen()) {
  42. getBank().depositAllItems();
  43. } else {
  44. Bank = getGameObjects().closest(b -> b != null && b.getName().equals("Banker") && b.hasAction("Bank"));
  45. Bank.interact("Bank");
  46. sleepUntil(() -> getBank().isOpen(), Calculations.random(1074, 1676));
  47. }
  48. } else {
  49. getWalking().walk(Banktile);
  50. sleep(Calculations.random(1483,2847));
  51. }
  52. }
  53.  
  54. return Calculations.random(598, 857);
  55. }
  56.  
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement