Advertisement
Guest User

Untitled

a guest
Mar 29th, 2015
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. public void ladderOrDoorInteract(String object, String action, int X, int Y, int Z){
  2. GameObject objectToInteract = getGameObjects().closest(new Filter<GameObject>(){
  3. public boolean match(GameObject Object){
  4. if(Object == null || Object.getName() == null) {
  5. return false;
  6. }
  7. if(!Object.getName().equals(object)) {
  8. return false;
  9. }
  10. if(!Object.getTile().equals(new Tile(X,Y,Z))) {
  11. return false;
  12. }
  13. return true;
  14. }
  15. });
  16. if(objectToInteract != null){
  17. if(objectToInteract.interact(action)){
  18. sleepUntil(new Condition(){
  19. public boolean verify(){
  20. return !objectToInteract.exists();
  21. }
  22. },Calculations.random(1400,1700));
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement