What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

Trophy Fishing

wilderg99

New Member
Joined
May 31, 2014
Messages
245
Reaction score
0
Hello guys hoping someone can help me with this. this is a trophy fishing plugin that works alright. only problem it has is that it sometimes cancels the Skill and since its a channeled skill it really sucks. i dont know anything about code so im hoping one of you guys can take a ***** at it and hopefully fix it. =) thanks in advance!


using System;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;
namespace
{
public class Fisher: Core
{
protected Dictionary <string, string> actions;
public static string GetPluginAuthor (){
return "Biocide";
}

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 (false);
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);
}
}
}
}
 
Last edited:
I can see my name as author in that script. I have not put that there.
What i did in that code was translated the skills, like the names of the fish buffs and player skills to use.
I spend most of my time to perfecting my auction plugin and adding trade routes to the trade route plugin but i will take a look at this code later if no one else does before i do.
 
Last edited:
Ill have to go to bed now but try this code and tell me if it works.
It would probably be better to just take the out the whole tension buff check, but since im not an experienced coder I don't want to do that without testing it for my self.
Well anyway this code should do it.

Code:
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 (false);
                        Thread.Sleep (100);
                    } finally {
                        MoveForward (false);
                    }
                    Log ("Cancel");
                    Thread.Sleep (100);
                }
                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);
            }
        }
    }
}
 
This one Works only problem is that its a little slow matching the skills sometimes which makes you lose time on the reel in and big reel in,
 
Last edited:
This plugin will not catch the fish successfully.
It does not handle canceling casting properly, the debuff Tension remains on the fish for a small amount of time even after casting the correct spell. This causes you to cancel the current correct spell and potentially lose the fish.
What I did for mine was put it in 2 checks for the debuff Tension the first time it checks it waits 500 msec and then checks for the debuff again. If it finds it the second time this assumes the skill we are casting is not correct and cancels the skill.
This is the only work around I've found yet.

The buff stacks multiple times so I need help on how to detect if the buff = Tension x1 , x2 ,x3 ,x4 and so on as this would make the fishing script more accurate and faster instead of adding inherit delays.
Perhaps someone with a little more experience coding could help.
 
yea it would be awesome if someone could make a working trophy fishing code
 
This plugin will not catch the fish successfully.
It does not handle canceling casting properly, the debuff Tension remains on the fish for a small amount of time even after casting the correct spell. This causes you to cancel the current correct spell and potentially lose the fish.
What I did for mine was put it in 2 checks for the debuff Tension the first time it checks it waits 500 msec and then checks for the debuff again. If it finds it the second time this assumes the skill we are casting is not correct and cancels the skill.
This is the only work around I've found yet.

The buff stacks multiple times so I need help on how to detect if the buff = Tension x1 , x2 ,x3 ,x4 and so on as this would make the fishing script more accurate and faster instead of adding inherit delays.
Perhaps someone with a little more experience coding could help.

Honestly I don't know why you guys are worrying about CANCELLING the cast. Just casting the new skill auto cxl's the current skill. So Essentially just having it cast the new skill a few times as soon as a skill change is triggered, is all that needs to be done.

So far though Sintal1ty, your script is working the best.
 
Back
Top