Skip to content

Instantly share code, notes, and snippets.

@pxpc2
Created August 5, 2012 12:19
Show Gist options
  • Save pxpc2/3264261 to your computer and use it in GitHub Desktop.
Save pxpc2/3264261 to your computer and use it in GitHub Desktop.
// 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