Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 12 additions & 32 deletions BSCombatKiller.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,62 +20,49 @@ public class BSCombatKiller extends Script{

private final ArrayList<Strategy> strategy = new ArrayList<Strategy>();


@Override
public boolean onExecute() {
strategy.add(new Scroll());
strategy.add(new PickUp());
strategy.add(new Attack());


strategy.add(new Scroll());
strategy.add(new PickUp());
strategy.add(new Attack());
provide(strategy);


return (true);
return (true);
}

private static Item e;
public class Scroll implements Strategy {

@Override
public boolean activate() {

for(Item d : Inventory.getItems(2774, 2775)){
e = d;

return d != null;
}

return false;
}

@Override
public void execute() {


Menu.sendAction(961, 2774, e.getSlot(), 4521985); // Send actions (Change the actions,except for getSlot)
Time.sleep(500);
Menu.sendAction(961, 2773, e.getSlot(), 4521985); // Send actions (Change the actions,except for getSlot)
Time.sleep(500);

}


}

private static GroundItem f;
public class PickUp implements Strategy {

@Override
public boolean activate() {
try{
for(GroundItem n : GroundItems.getNearest(2774, 2775)){ // Got to change id here if you want more pickup.
@Override
public boolean activate() {
try{
for(GroundItem n : GroundItems.getNearest(2774, 2775)){ // Got to change id here if you want more pickup.
f = n;

return n != null;

}
}catch(NullPointerException e){}
}
}catch(NullPointerException e){

}
return false;
}

Expand All @@ -84,7 +71,6 @@ public void execute() {
f.interact(0);
Time.sleep(500);
}

}
private static Npc q;
public class Attack implements Strategy {
Expand All @@ -95,7 +81,6 @@ public boolean activate() {
q = n;
return n != null && !Players.getMyPlayer().isInCombat() && !n.isInCombat();
}

return false;
}

Expand All @@ -104,12 +89,7 @@ public void execute() {
if(q != null){
q.interact(0); // Change to 1 if 0 doesn't work.
Time.sleep(500);

}

}


}

}