Skip to content

Instantly share code, notes, and snippets.

@pxpc2
Created July 31, 2012 14:17
Show Gist options
  • Save pxpc2/3217333 to your computer and use it in GitHub Desktop.
Save pxpc2/3217333 to your computer and use it in GitHub Desktop.
public class LootTrap extends Strategy implements Task
{
SceneObject trap;
SceneObject[] traps;
public void run()
{
for (SceneObject t : traps)
{
trap = t;
if (trap != null && trap.isOnScreen())
{
SMethods.deactivateTrap(trap);
Time.sleep(300);
}
else
{
Walking.walk(trap);
while (Players.getLocal().getAnimation() != -1)
Time.sleep(200);
}
}
}
public boolean validate()
{
for (Tile t : SFields.trapTiles)
{
traps = SceneEntities.getLoaded(t);
}
return (Inventory.getCount() < 27 && traps != null);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment