Jump to content

Picking up arrows [code]


scape

Recommended Posts

final int[] arrowids = { 882, 884, 886, 888, 890, 892, 863, 864, 865 };public int arrowid;	void findarrowid() {        Player player = client.getMyPlayer();			if (arrowid < 800) {				List<GroundItem> list = client.getCurrentRegion().getItems();				Player player = client.getMyPlayer();				NPC attackables = closestNPC(attackable);				for (GroundItem g : list) {					for (int i : arrowids) {						if (attackables != null) {							if (player.isUnderAttack()									&& g.getPosition().distance(											player.getPosition()) == 1									&& i == g.getId()) {								arrowid = g.getId();								log("Arrow id is now " + arrowid + "!");						}					}				}			}		}	}

 

Pickup method:

void pickup() {		List<GroundItem> list = client.getCurrentRegion().getItems();		Player player = client.getMyPlayer();		for (GroundItem g : list) {			if (g.getId() == arrowid) {				try {					if (g.getPosition().distance(player.getPosition()) <= 2							&& !player.isMoving()) {						selectEntityOption(g, "Take");						sleep(random(3000));					}				} catch (Exception e) {				}			}		}	}

 

 

Edited by scape
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...