Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.powerbot.concurrent.Task;
- import org.powerbot.game.api.ActiveScript;
- import org.powerbot.game.api.Manifest;
- import org.powerbot.game.api.methods.node.GroundItems;
- import org.powerbot.game.api.methods.tab.Inventory;
- import org.powerbot.game.api.util.Filter;
- import org.powerbot.game.api.util.Time;
- import org.powerbot.game.api.util.Timer;
- import org.powerbot.game.api.wrappers.node.GroundItem;
- import org.powerbot.game.api.wrappers.node.Item;
- @Manifest(name = "WiKAi 1st script", description = "trololol", version = 1.0d, authors = {"Midgets in hotpants"})
- public class bonepicker extends ActiveScript implements Task
- {
- private static final int BigBonesID = 532;
- @Override
- protected void setup()
- {
- log.info("trololol");
- }
- public void run() {
- log.info("trololol2");
- final GroundItem Bones = GroundItems.getNearest(new Filter<GroundItem>()
- {public boolean accept(final GroundItem Bones)
- {return Bones.isOnScreen() && Bones.getGroundItem().getId() == BigBonesID;
- }
- });
- log.info("trololol3");
- if (Bones != null) {
- final int count = boneCount();
- if (Bones.interact("Take", "Big bones")) {
- final Timer timer = new Timer(1800);
- while (timer.isRunning() && boneCount() == count) {
- Time.sleep(150);
- }
- }
- return;
- }
- }
- private int boneCount() {
- log.info("trololol5");
- final Filter<Item> featherFilter = new Filter<Item>() {
- public boolean accept(final Item item) {
- return item.getId() == BigBonesID;
- }
- };
- return Inventory.getCount(true, featherFilter);
- }
- }
Add Comment
Please, Sign In to add comment