using System;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;
namespace Bolge
{
public class Fisher: Core
{
protected Dictionary <string, string> actions;
public static string GetPluginAuthor (){
return "Bolge";
}
public static string GetPluginVersion (){
return "1.0.0.0";
}
public static string GetPluginDescription (){
return "Fishing machine";
}
public Fisher () : base (){
actions = new Dictionary <string, string> (){
{"Moving to the Left", "Stand Firm Left"},
{"Moving to the Right", "Stand Firm Right"},
{"Escape", "Give Slack"},
{"Move to the Bottom", "Reel In"},
{"Leap", "Big Reel In"}
};
}
protected void Wait (){
while (me.target == null || (me.target.target != null && me.target.target != me) || getBuff (me.target, "Strength Contest") == null){
// If not selected goal Or goals we can not Target (not our fish) Or this is not a fish
Thread.Sleep (1000);
}
}
protected void Stopper (){
Buff check;
while (true){
Wait ();
check = getBuff (me.target, "Tension");
if (check != null && isCasting ()){
CancelSkill (); // Alas, fishing is not the plow, cancel castes otherwise
try{
MoveForward (true);
Thread.Sleep (100);
} finally {
MoveForward (false);
}
Log ("Cancel");
Thread.Sleep (1500);
}
Thread.Sleep (100);
}
}
public void PluginRun (){
Thread stopper = new Thread (Stopper); // Stream that will cancel the cast, cast if that something is not right.
stopper.Start ();
while (true){
Wait ();
String skill = null;
// Select the appropriate response to the buffs fish
foreach (Buff enBuff in me.target.getBuffs ()){
if (actions.ContainsKey (enBuff.name)){
skill = actions [enBuff.name];
break;
}
}
// Kastuem if there is
if (! isCasting () && skill != null){
if (! isGliding ()){
TurnDirectly ();
}
Log ("Used:" + skill);
UseSkill (skill, true);
}
Thread.Sleep (100);
}
}
}
}