public static Composite InteractWithLabelOnGroundOpenable(Func <LabelOnGround> labelToOpenDel) { return(new Decorator(delegate { var labelOnGround = labelToOpenDel(); if (labelOnGround != null && !CommonBehavior.DoCombat() && !CommonBehavior.DoLooting()) { return true; } return false; }, new PrioritySelector( CommonBehavior.MoveTo(x => labelToOpenDel()?.ItemOnGround?.GridPos, x => labelToOpenDel()?.ItemOnGround?.Pos, CommonBehavior.OpenablesMovementSpec), new Action(delegate { var label = labelToOpenDel(); var chestComponent = label?.ItemOnGround.GetComponent <Chest>(); if (chestComponent != null && chestComponent.IsStrongbox == true && chestComponent.IsLocked == true) { ControlTimer.Restart(); while (ControlTimer.ElapsedMilliseconds < 3500 && chestComponent?.IsLocked == true) { Thread.Sleep(150); Mouse.SetCursorPosAndLeftOrRightClick(label, Latency); } return RunStatus.Failure; } else if (chestComponent != null && chestComponent.IsStrongbox == false && chestComponent.DestroyingAfterOpen == true) { ControlTimer.Restart(); while (ControlTimer.ElapsedMilliseconds < 3500 && label != null) { Thread.Sleep(150); Mouse.SetCursorPosAndLeftOrRightClick(label, Latency); } return RunStatus.Failure; } else { ControlTimer.Restart(); while (ControlTimer.ElapsedMilliseconds < 3500 && label != null) { Thread.Sleep(150); Mouse.SetCursorPosAndLeftOrRightClick(label, Latency); } return RunStatus.Failure; } })))); }
/* * Metamorph. Check for existence of spawn thane button ( this should only have isVisible == true if its a metamorph map) * if map is done, do metamorph. Check for "Construct metamorph" label * * * * Chosen body parts window: Metamorphwindow 0 -> 3 * 0 = eyes, 1 = liver, 2 = lung, 3= heart, 4 = brain (Body part boxes) * Bodypart box: * 0 -> 1 ( There is a body part chosen for this box IF isVisible == true * Metamorphwindow -> 1 = create button * * * Methamorph stash side of things * * MetamorphBodyPartStashWindowElement * BodyPartName can be : Eyes, livers, lungs, brains, hearts * * Metamorph body part element * 0 -> 0 ( if isVisible == false then there is no body part in the stash for this * */ public static bool DoOpenDeliriumMirror() { if (Me.DeliriumMirror != null && (Me.DeliriumMirror?.DistancePlayer < 25 || !CommonBehavior.DoCombat())) { return(true); } return(false); }