Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Turbo.plugins.patrick.autoactions.actions.rift {
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Windows.Forms;
- using Newtonsoft.Json;
- using parameters.types;
- using parameters;
- using Plugins;
- using util.thud;
- using util.input;
- public class HexingPants : AbstractAutoAction {
- public static bool ToggledOn { get; set; } = true;
- public int MinimumIntervalMS { get; set; } = 500;
- public int WiggleDistance { get; set; } = 25;
- private bool GoLeftNow = true;
- private long lastTimeMoved = 0;
- public override string tooltip => "Wiggle";
- public override string GetAttributes() {
- return $"[ {nameof(MinimumIntervalMS)}: {MinimumIntervalMS}, {nameof(WiggleDistance)} : {WiggleDistance} ]";
- }
- public override long minimumExecutionDelta => 64;
- public override List<AbstractParameter> GetParameters()
- {
- return new List<AbstractParameter>
- {
- SimpleParameter<int>.of(nameof(MinimumIntervalMS), x => MinimumIntervalMS = x),
- SimpleParameter<int>.of(nameof(WiggleDistance), x => WiggleDistance = x),
- };
- }
- public override bool Applicable(IController hud)
- {
- return ToggledOn &&
- hud.Game.Me.IsInGame &&
- !hud.Game.Me.IsDead &&
- hud.Game.SpecialArea == SpecialArea.GreaterRift &&
- hud.Game.Me.Powers.BuffIsActive(hud.Sno.SnoPowers.HexingPantsOfMrYan.Sno) &&
- (DateTimeOffset.Now.ToUnixTimeMilliseconds() - lastTimeMoved > MinimumIntervalMS);
- }
- public override void Invoke(IController hud)
- {
- int toAdd = GoLeftNow ? -WiggleDistance : +WiggleDistance;
- GoLeftNow = !GoLeftNow;
- lastTimeMoved = DateTimeOffset.Now.ToUnixTimeMilliseconds();
- InputSimulator.PostMessageKeyPress(Keys.MButton, (int)hud.Game.Me.FloorCoordinate.ToScreenCoordinate().X + toAdd, (int)hud.Game.Me.FloorCoordinate.ToScreenCoordinate().Y);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement