Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pphidetanner;
- import impsoft.bots.reflection.PhysicalObject;
- import impsoft.scripting.ibot.aryanweb.*;
- import impsoft.scripting.ibot.structs.AryanTile;
- import impsoft.scripting.types.ColorScript;
- import impsoft.scripting.types.ColorSkeltonScriptable;
- import sScript.sScript;
- public class Door extends AryanLineBase {
- ColorScript cs;
- int doorId;
- AryanTile a;
- AryanTile b;
- AryanTile doorLoc;
- String open = new String("open");
- /**
- * Creates a new instance of a AryanLineBase for a Door
- *
- * @param cs instance of ColorScript
- * @param a AryanTile location of side a of the door.
- * @param b AryanTile location of side b of the door.
- * @param doorLoc AryanTile location of the door.
- * @param doorId Object id of the door.
- */
- public Door(ColorScript cs, AryanTile a, AryanTile b, AryanTile doorLoc,
- int doorId) {
- super(a, b);
- this.cs = cs;
- this.a = a;
- this.b = b;
- this.doorId = doorId;
- this.doorLoc = doorLoc;
- }
- ppHideTanner ppht = new ppHideTanner(this.cs);
- @Override
- public boolean doActionForAToB(ColorSkeltonScriptable cs)
- throws InterruptedException, AryanWebReCalc, AryanWebChanged,
- AryanWebHalt {
- if (!cs.theMiniMap.canReachReflection(b)) {
- PhysicalObject door = this.ppht.pObj.getAtTile(this.doorId,
- this.doorLoc);
- if (door != null) {
- if (this.ppht.pObj.interact(door, this.open)) {
- for (int i = 0; (i < 10) && door.valid(); i++) {
- cs.sleep(300);
- }
- }
- }
- }
- if (cs.theMiniMap.canReachReflection(b))
- return true;
- return this.doActionForAToB(cs);
- }
- @Override
- public boolean doActionForBToA(ColorSkeltonScriptable cs)
- throws InterruptedException, AryanWebReCalc, AryanWebChanged,
- AryanWebHalt {
- if (!cs.theMiniMap.canReachReflection(a)) {
- PhysicalObject door = this.ppht.pObj.getAtTile(this.doorId,
- this.doorLoc);
- if (door != null) {
- if (this.ppht.pObj.interact(door, this.open)) {
- for (int i = 0; (i < 10) && door.valid(); i++) {
- cs.sleep(300);
- }
- }
- }
- }
- if (cs.theMiniMap.canReachReflection(a))
- return true;
- return this.doActionForBToA(cs);
- }
- @Override
- public int getDistanceFromAToB(ColorSkeltonScriptable cs,
- CachedInformation info) throws InterruptedException {
- return 1;
- }
- @Override
- public int getDistanceFromBToA(ColorSkeltonScriptable cs,
- CachedInformation info) throws InterruptedException {
- return 1;
- }
- @Override
- public boolean hasActionFromAToB() {
- return true;
- }
- @Override
- public boolean hasActionFromBToA() {
- return true;
- }
- @Override
- public boolean hasPointsBetween() {
- return false;
- }
- }
Add Comment
Please, Sign In to add comment