Advertisement
Leffen

Untitled

Jul 31st, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.05 KB | None | 0 0
  1. import org.dreambot.api.methods.container.impl.bank.BankLocation;
  2. import org.dreambot.api.methods.map.Tile;
  3. import org.dreambot.api.script.AbstractScript;
  4. import org.dreambot.api.script.Category;
  5. import org.dreambot.api.script.ScriptManifest;
  6. import org.dreambot.api.wrappers.interactive.GameObject;
  7. import org.dreambot.api.wrappers.widgets.WidgetChild;
  8.  
  9. import java.awt.event.KeyEvent;
  10.  
  11.  
  12. @ScriptManifest(
  13.         author = "ZeddyBoi",
  14.         description = "Crafting",
  15.         category = Category.CRAFTING,
  16.         version = 0.1,
  17.         name = "Gold Ammy Crafter"
  18. )
  19. public class Main extends AbstractScript {
  20.  
  21.     public static int AMULET_MOULD = 1595;
  22.     public static int GOLD_BAR = 2357;
  23.  
  24.     private static final Tile FURNACE_TILE = new Tile(3109,3499);
  25.     @Override
  26.     public int onLoop() {
  27.         if (getInventory().contains(GOLD_BAR)){
  28.             if (FURNACE_TILE.distance() >7 ){
  29.                 getWalking().walk(FURNACE_TILE);
  30.                 sleep(4000);
  31.             } else if (getInventory().isItemSelected()){
  32.                 getInventory().deselect();
  33.             }else {
  34.                 WidgetChild makeAllWidg = getWidgets().getWidgetChild(446,34);
  35.                 if (makeAllWidg != null && makeAllWidg.isVisible()){
  36.                     makeAllWidg.interact();
  37.                 }
  38.                 GameObject Furnace = getGameObjects().closest("Furnace");
  39.                 if (Furnace != null){
  40.                     Furnace.interact("Smelt");
  41.                 }
  42.  
  43.             }
  44.     } else if (getBank().isOpen()){
  45.             if (getInventory().isFull()){
  46.                 getBank().depositAllExcept(AMULET_MOULD);
  47.             } else if (getInventory().contains(AMULET_MOULD)){
  48.                 getBank().withdrawAll(GOLD_BAR);
  49.                 sleep(1000);
  50.                 getKeyboard().typeSpecialKey(KeyEvent.VK_ESCAPE);
  51.  
  52.             }else {
  53.                 getBank().withdraw(AMULET_MOULD);
  54.             }
  55.         } else {
  56.             getBank().openClosest();
  57.             sleep(4000);
  58.         }
  59.         return 1000;
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement