Guest User

Untitled

a guest
Oct 16th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.24 KB | None | 0 0
  1. package pphidetanner;
  2.  
  3. import impsoft.bots.reflection.PhysicalObject;
  4. import impsoft.scripting.ibot.aryanweb.*;
  5. import impsoft.scripting.ibot.structs.AryanTile;
  6. import impsoft.scripting.types.ColorScript;
  7. import impsoft.scripting.types.ColorSkeltonScriptable;
  8. import sScript.sScript;
  9.  
  10. public class Door extends AryanLineBase {
  11.  
  12. ColorScript cs;
  13. int doorId;
  14. AryanTile a;
  15. AryanTile b;
  16. AryanTile doorLoc;
  17. String open = new String("open");
  18.  
  19. /**
  20. * Creates a new instance of a AryanLineBase for a Door
  21. *
  22. * @param cs instance of ColorScript
  23. * @param a AryanTile location of side a of the door.
  24. * @param b AryanTile location of side b of the door.
  25. * @param doorLoc AryanTile location of the door.
  26. * @param doorId Object id of the door.
  27. */
  28. public Door(ColorScript cs, AryanTile a, AryanTile b, AryanTile doorLoc,
  29. int doorId) {
  30. super(a, b);
  31. this.cs = cs;
  32. this.a = a;
  33. this.b = b;
  34. this.doorId = doorId;
  35. this.doorLoc = doorLoc;
  36. }
  37.  
  38. ppHideTanner ppht = new ppHideTanner(this.cs);
  39.  
  40. @Override
  41. public boolean doActionForAToB(ColorSkeltonScriptable cs)
  42. throws InterruptedException, AryanWebReCalc, AryanWebChanged,
  43. AryanWebHalt {
  44. if (!cs.theMiniMap.canReachReflection(b)) {
  45. PhysicalObject door = this.ppht.pObj.getAtTile(this.doorId,
  46. this.doorLoc);
  47. if (door != null) {
  48. if (this.ppht.pObj.interact(door, this.open)) {
  49. for (int i = 0; (i < 10) && door.valid(); i++) {
  50. cs.sleep(300);
  51. }
  52. }
  53. }
  54. }
  55. if (cs.theMiniMap.canReachReflection(b))
  56. return true;
  57. return this.doActionForAToB(cs);
  58. }
  59.  
  60. @Override
  61. public boolean doActionForBToA(ColorSkeltonScriptable cs)
  62. throws InterruptedException, AryanWebReCalc, AryanWebChanged,
  63. AryanWebHalt {
  64. if (!cs.theMiniMap.canReachReflection(a)) {
  65. PhysicalObject door = this.ppht.pObj.getAtTile(this.doorId,
  66. this.doorLoc);
  67. if (door != null) {
  68. if (this.ppht.pObj.interact(door, this.open)) {
  69. for (int i = 0; (i < 10) && door.valid(); i++) {
  70. cs.sleep(300);
  71. }
  72. }
  73. }
  74. }
  75. if (cs.theMiniMap.canReachReflection(a))
  76. return true;
  77. return this.doActionForBToA(cs);
  78. }
  79.  
  80. @Override
  81. public int getDistanceFromAToB(ColorSkeltonScriptable cs,
  82. CachedInformation info) throws InterruptedException {
  83. return 1;
  84. }
  85.  
  86. @Override
  87. public int getDistanceFromBToA(ColorSkeltonScriptable cs,
  88. CachedInformation info) throws InterruptedException {
  89. return 1;
  90. }
  91.  
  92. @Override
  93. public boolean hasActionFromAToB() {
  94. return true;
  95. }
  96.  
  97. @Override
  98. public boolean hasActionFromBToA() {
  99. return true;
  100. }
  101.  
  102. @Override
  103. public boolean hasPointsBetween() {
  104. return false;
  105. }
  106.  
  107. }
Add Comment
Please, Sign In to add comment