Skip to content

Instantly share code, notes, and snippets.

@phl0w
Created September 29, 2012 12:00
Show Gist options
  • Select an option

  • Save phl0w/3803800 to your computer and use it in GitHub Desktop.

Select an option

Save phl0w/3803800 to your computer and use it in GitHub Desktop.
private final int[] path = {0, 4, 8, 12, 16, 20, 24, 1, 5, 9, 13, 17, 21, 25, 2, 6, 10, 14, 18, 22, 26, 3, 7, 11, 15, 19, 23, 27};
@Override
public void execute() {
for (int slot = 0; slot < path.length; slot++) {
Item item = Inventory.getItemAt(path[slot]);
if (item.getId() == Variables.primary) {
if (Variables.quick) {
int xPos = item.getWidgetChild().getAbsoluteX() + Random.nextInt(0, 10);
int yPos = item.getWidgetChild().getAbsoluteY() + Random.nextInt(0, 10);
if (path[slot] == 1 || path[slot] == 2 || path[slot] == 3) {
Mouse.move(xPos, yPos);
} else {
Mouse.hop(xPos, yPos);
}
Mouse.click(true);
} else {
item.getWidgetChild().click(true);
}
}
}
Task.sleep(400);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment