Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class FishingScript : Script
- {
- public FishingScript()
- : base("Fishing", "Bot")
- { }
- private int Fishes = 0;
- private WoWSpell Fishing = WoWSpell.Invalid;
- public override void OnStart()
- {
- Fishing = WoWSpell.GetSpell("Fishing");
- if (!Fishing.IsValid)
- {
- Print("You don't know fishing!");
- Stop();
- }
- }
- public override void OnTick()
- {
- if (!IsFishing)
- {
- Print("Casting Fishing Pole");
- Fishing.Cast();
- Sleep(1200);
- }
- if (Bobber.IsValid && IsFishing)
- {
- if (IsBobbing)
- {
- Print("Looks like we have a bait!");
- Bobber.Interact();
- Fishes++;
- Sleep(1000);
- }
- else
- Sleep(200);
- }
- }
- public override void OnTerminate()
- {
- Print("Fishing season is over! You did however catch {0} fishes.", Fishes);
- }
- private WoWGameObject Bobber
- {
- get
- {
- return Manager.Objects.Where(b => b.IsValid && b.IsGameObject)
- .Select(b => b as WoWGameObject)
- .Where(b => b.CreatedByMe && b.Name == "Fishing Bobber")
- .FirstOrDefault() ?? WoWGameObject.Invalid;
- }
- }
- private bool IsBobbing
- {
- get { return (Bobber.IsValid ? (Helper.Magic.Read<int>(Bobber.Pointer + 0xD4) & 1) != 0: false); }
- }
- private bool IsFishing
- {
- get { return Manager.LocalPlayer.ChanneledCastingId == Fishing.Id; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement