Created
August 5, 2012 12:19
-
-
Save pxpc2/3264261 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// with bonus: | |
private void chop(int waitTime, int...ids) | |
{ | |
for (int id : ids) | |
{ | |
SceneObject tree = SceneEntities.getNearest(id); | |
if (tree != null && tree.isOnScreen()) | |
{ | |
Timer timer = new Timer(waitTime); | |
if (tree.interact("Chop")) | |
{ | |
while (timer.isRunning() && Players.getLocal().getAnimation() != -1) | |
Time.sleep(300); | |
} | |
} | |
} | |
} | |
// without bonus: | |
private void chop(int id) | |
{ | |
SceneObject tree = SceneEntities.getNearest(id); | |
if (tree != null && tree.isOnScreen()) | |
{ | |
Timer timer = new Timer(3000); // or an specified time (to get bonus must have both multiple id's and specified timer) | |
if (tree.interact("Chop")) | |
{ | |
while (timer.isRunning() && Players.getLocal().getAnimation() != -1) | |
Time.sleep(300); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment