Skip to content

Instantly share code, notes, and snippets.

@pxpc2
Created July 30, 2012 02:16
Show Gist options
  • Save pxpc2/3203434 to your computer and use it in GitHub Desktop.
Save pxpc2/3203434 to your computer and use it in GitHub Desktop.
public class SetTrap extends Strategy implements Task
{
SceneObject trap;
public void run()
{
if (trap.isOnScreen())
{
// Already doing everything for me
SMethods.activateTrap(trap);
}
else
{
Walking.walk(trap);
}
}
public boolean validate()
{
trap = SceneEntities.getNearest(SConstants.SWAMP_LIZARD_TRAP_OPEN);
return (trap != null && Players.getLocal().getAnimation() == -1) &&
(Inventory.getCount(SConstants.NET) > 0) &&
(Inventory.getCount(SConstants.ROPE) > 0) &&
(Inventory.getCount() < 26);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment