Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public final int RAW_SALMON = 331;
- public final int RAW_TROUT = 335;
- public final int COOKED_TROUT = 333;
- public final int COOKED_SALMON = 329;
- public final int BURNT_FISH = 343;
- public final int FIRE = 26185;
- public void gatherSalmon(){
- // navigate to fishing spot
- // gather fish
- // while inv is not full (should only work near the barb fishing area)
- while(!ctx.inventory.isFull()){
- System.out.println("Querying ground items...");
- GroundItem groundItems = null;
- if(!groundItems.valid()){
- groundItems = ctx.groundItems.select().nearest().poll();
- }
- int queriedGroundItems = groundItems.id();
- switch (queriedGroundItems){
- case RAW_SALMON:
- groundItems.interact("Take", "Raw salmon");
- break;
- case RAW_TROUT:
- groundItems.interact("Take", "Raw trout");
- break;
- case COOKED_SALMON:
- groundItems.interact("Take", "Salmon");
- break;
- case COOKED_TROUT:
- groundItems.interact("Take", "Trout");
- break;
- }
- }
- // check for any raw food in the inv
- while(ctx.inventory.select().id(RAW_TROUT, RAW_SALMON, BURNT_FISH).poll().valid()){
- System.out.println("Player inv contains raw salmon | raw trout...");
- Condition.sleep(3500);
- // player not animating
- if(ctx.players.local().animation() == -1 && ctx.players.local().inMotion()) {
- // using the food and clicking the fire
- System.out.println("Player not animating ... attempting to cooking food..");
- ctx.inventory.select().id(RAW_TROUT, RAW_SALMON).poll().interact("Use");
- ctx.objects.select().id(FIRE).nearest().poll().interact("Use", "Fire");
- ctx.widgets.component(270,14).click();
- } else {
- System.out.println("Player is animating and cooking");
- }
- // dropping burnt fish if any
- if(ctx.players.local().animation() == -1 && ctx.inventory.select().id(BURNT_FISH).poll().valid()){
- System.out.println("Found burnt fish in the inv... dropping burnt fish... ");
- ctx.inventory.select().id(BURNT_FISH).poll().interact("Drop", "Burnt fish");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement