Guest User

Untitled

a guest
Nov 24th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.82 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using CommonBehaviors.Actions;
  4. using Styx;
  5. using Styx.Logic.BehaviorTree;
  6. using Styx.Logic.Combat;
  7. using TreeSharp;
  8. using Action = TreeSharp.Action;
  9.  
  10. namespace FishFeasted
  11. {
  12.     class FishFeasted : BotBase
  13.     {
  14.  
  15.         Random r = new Random();
  16.  
  17.         public override string Name
  18.         {
  19.             get { return "FishFeasted"; }
  20.         }
  21.  
  22.         public override PulseFlags PulseFlags
  23.         {
  24.             get { return PulseFlags.All; }
  25.         }
  26.  
  27.         float randy(double min, double max)
  28.         {
  29.             double range = (double)max - (double)min;
  30.             double sample = r.NextDouble();
  31.             double scaled = (sample * range) + min;
  32.             return (float)scaled;
  33.         }
  34.  
  35.         private Composite _root;
  36.         public override Composite Root
  37.         {
  38.             get {
  39.                 return _root ?? (_root = new PrioritySelector(
  40.                     new Decorator(ret => !StyxWoW.IsInGame || !StyxWoW.IsInWorld || !StyxWoW.Me.IsValid || StyxWoW.Me.IsCasting || SpellManager.GlobalCooldown,
  41.                         new ActionAlwaysSucceed()),
  42.                     new Decorator(ret => StyxWoW.Me.BagItems.Count(i => i != null && i.IsValid && i.Entry == 43015) > 0,
  43.                         new PrioritySelector(
  44.                             new Decorator(ret => StyxWoW.Me.CurrentPendingCursorSpell != null && StyxWoW.Me.CurrentPendingCursorSpell.Id == 57426,
  45.                                 new Action(ret => LegacySpellManager.ClickRemoteLocation(StyxWoW.Me.Location.RayCast(randy(0, 2 * Math.PI), randy(0, 5))))),
  46.                             new Action(ret => StyxWoW.Me.BagItems.FirstOrDefault(i => i.Entry == 43015).Use()))),
  47.                     new Action(ret => TreeRoot.Stop())
  48.                     ));
  49.             }
  50.         }
  51.     }
  52. }
Add Comment
Please, Sign In to add comment