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

[Plugin] Hasla Weapon Assistant

Status
Not open for further replies.
Awesome work, I cannot test right now but will try it out tonight. Thanks for the work and sharing!
 
Can anyone tell me how to edit to roll only for example Conviction rune?

Maybe deleting all this¿?

else if (item.name == "Faded Fortitude Token")
doRoll = GetGroupStatus("Fortitude (Shield)");

else if (item.name == "Faded Honor Token")
doRoll = GetGroupStatus("Honor (1H)");

else if (item.name == "Faded Loyalty Token")
doRoll = GetGroupStatus("Loyalty (2H)");

else if (item.name == "Faded Sacrifice Token")
doRoll = GetGroupStatus("Sacrifice (Lute)");
 
Last edited:
SetGroupStatus("Farm mobs ON", true);
SetGroupStatus("Courage (Bow)", false);
SetGroupStatus("Compassion (Heal)", false);
SetGroupStatus("Conviction (Staff)", false);
SetGroupStatus("Fortitude (Shield)", false);
SetGroupStatus("Honor (1H)", false);
SetGroupStatus("Loyalty (2H)", false);
SetGroupStatus("Sacrifice (Lute)", false);



set false to true to roll for the token
 
That or just click the checkbox in the widget (but plasma's post is a good way to do it if you don't want to change the widget)

About following party leader, I guess that's a doable option. I'll probably have to move the settings to their own form to not abuse the checkbox space available on character widget.
 
so this is my edit, but for some reason it won't use skills?

All I want to use is firebolt. Any help? :D Thanks!

PHP:
using System;
using System.Windows.Forms;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Linq;
using ArcheBuddy.Bot.Classes;

namespace Hasla
{
    public class Hasla : Core
    {
        // EDIT THIS - the plugin's settings

        const double _COMBAT_RANGE = 24; // how close bot should move to a mob before using skills

        public static string GetPluginAuthor()
        {
            return "Karls";
        }

        public static string GetPluginVersion()
        {
            return "1.0";
        }

        public static string GetPluginDescription()
        {
            return "HaslaGrinder: Assisting you for Hasla Weapon Grind";
        }

        List<Creature> team;
        public Creature GetBestNearestMob(Zone zone)
        {
            try
            {

                foreach (var obj in getCreatures())
                {
                    if (obj.type == BotTypes.Npc && isAttackable(obj) && (obj.firstHitter == null || obj.firstHitter == me || team.Contains(obj.firstHitter))
                        && isAlive(obj) && (zone.ObjInZone(obj) || me.dist(obj) < _COMBAT_RANGE)
                        && (hpp(obj) == 100 || obj.aggroTarget == me || team.Contains(obj.aggroTarget)))
                    {
                        return obj;
                    }
                }
            }
            catch { }
            return null;
        }

        public void UseSkillAndWait(string skillName, bool selfTarget = false)
        {
            if (getSkill(skillName) == null)
                return;

            while (me.isCasting || me.isGlobalCooldown)
                Thread.Sleep(50);

            if (skillCooldown(skillName) > 0)
                return;

            if (!UseSkill(skillName, true, selfTarget))
            {
                if (me.target != null && GetLastError() == LastError.NoLineOfSight)
                {
                    if (dist(me.target) <= 5)
                        ComeTo(me.target, 2);
                    else if (dist(me.target) <= 10)
                        ComeTo(me.target, 3);
                    else if (dist(me.target) < 20)
                        ComeTo(me.target, 8);
                    else
                        ComeTo(me.target, 8);
                }
            }

            while (me.isCasting || me.isGlobalCooldown)
                Thread.Sleep(50);
        }

        public void PlayDead()
        {
            while (me.isCasting || me.isGlobalCooldown)
                Thread.Sleep(50);

            UseSkill("Play Dead", false, true);
            Thread.Sleep(2000);

            while (getAggroMobs().Count == 0 && (mpp() < 95 || hpp() < 95))
                Thread.Sleep(100);

            MoveForward(true);
            Thread.Sleep(250);
            MoveForward(false);
            
            Log("Regen done");
        }

        public void LootThread()
        {
            try
            {
                BlockClientDice(true);
                while (true)
                {
                    foreach (var item in me.getDiceItems())
                    {
                        bool doRoll = false;

                        // Always roll on purses and random drops
                        if (item.name.EndsWith("Coinpurse") || item.name.StartsWith("Unidentified"))
                            doRoll = true;

                        else if(item.name == "Faded Conviction Token")
                            doRoll = GetGroupStatus("Conviction (Staff)");

                        else if (item.name == "Faded Courage Token")
                            doRoll = GetGroupStatus("Courage (Bow)");

                        else if (item.name == "Faded Compassion Token")
                            doRoll = GetGroupStatus("Compassion (Heal)");

                        else if (item.name == "Faded Fortitude Token")
                            doRoll = GetGroupStatus("Fortitude (Shield)");

                        else if (item.name == "Faded Honor Token")
                            doRoll = GetGroupStatus("Honor (1H)");

                        else if (item.name == "Faded Loyalty Token")
                            doRoll = GetGroupStatus("Loyalty (2H)");

                        else if (item.name == "Faded Sacrifice Token")
                            doRoll = GetGroupStatus("Sacrifice (Lute)");
                        
                        item.Dice(doRoll);
                        if(doRoll)
                            Log("Rolling on : " + item.name);
                        else
                            Log("Passing on : " + item.name);
                        
                        Thread.Sleep(500);
                    }
                    Thread.Sleep(1000);
                }
            }
            finally
            {
                BlockClientDice(false);
            }
        }

        public void RefreshTeam()
        {
            team = new List<Creature>();
            foreach (var t in getPartyMembers())
                team.Add(t.obj);
        }

        public void PluginRun()
        {
            DelAllGroupStatus();
            new Task(() => { LootThread(); }).Start();

            RoundZone zone = new RoundZone(me.X, me.Y, 40);

            SetGroupStatus("Farm mobs ON", true);
            SetGroupStatus("Courage (Bow)", false);
            SetGroupStatus("Compassion (Heal)", false);
            SetGroupStatus("Conviction (Staff)", false);
            SetGroupStatus("Fortitude (Shield)", false);
            SetGroupStatus("Honor (1H)", false);
            SetGroupStatus("Loyalty (2H)", false);
            SetGroupStatus("Sacrifice (Lute)", false);

            Log("Starting Hasla Assistant");

            Creature bestMob = null;
            RefreshTeam();

            while (true)
            {
                if (GetGroupStatus("Farm mobs ON") && isAlive())
                {
                    if (GetGroupStatus("Farm mobs ON"))
                    {
                        if (getAggroMobs().Count == 0)
                        {
                            // EDIT THIS - Change to your buffs or delete it

                            // rebuff
                            if (buffTime("Insulating Lens (Rank 5)") == 0 && skillCooldown("Insulating Lens") == 0)
                                UseSkillAndWait("Insulating Lens", true);   
                            
                             if (buffTime("Hummingbird Ditty (Rank 3)") == 0 && skillCooldown("Hummingbird Ditty") == 0)
                                UseSkillAndWait("Hummingbird Ditty", true);

                            
                        }

                        if (((mpp() > 40 && hpp() > 75) || getAggroMobs().Count > 0))
                        {
                            bestMob = GetBestNearestMob(zone);
                        }

                        if (bestMob != null)
                        {
                            try
                            {
                                while (bestMob != null && isAlive(bestMob) && isExists(bestMob) && GetGroupStatus("Farm mobs ON") && isAlive())
                                {
                                    if (bestMob.firstHitter != null && bestMob.firstHitter != me && !team.Contains(bestMob.firstHitter))
                                    {
                                        bestMob = null;
                                        break;
                                    }

                                    if (bestMob.firstHitter == null && getAggroMobs().Count > 0 && bestMob != GetBestNearestMob(zone))
                                        bestMob = GetBestNearestMob(zone);

                                    if (me.target != bestMob)
                                        SetTarget(bestMob);
                                    if (angle(bestMob, me) > 45 && angle(bestMob, me) < 315)
                                        TurnDirectly(bestMob);


                                    var distToMob = me.dist(bestMob);
                                    if (isAlive(bestMob))
                                    {
                                        if (distToMob > _COMBAT_RANGE)
                                        {
                                            ComeTo(me.target, _COMBAT_RANGE - 1);
                                  
                                            {
                                                UseSkillAndWait("Flamebolt");
                                                
                                            }
                                        }
                                    }

                                    Thread.Sleep(10);
                                }

                                bestMob = null;
                                RefreshTeam();
                            }
                            catch { }

                        }
                    }
                }
                Thread.Sleep(10);
            }
        }
    }
}
 
Thank you pal. A hasla plugin was desperately needed.
 
Attack works as intended but looting didn't work out so well.

SetGroupStatus("Farm mobs ON", true);
SetGroupStatus("Courage (Bow)", false);
SetGroupStatus("Compassion (Heal)", true);
SetGroupStatus("Conviction (Staff)", false);
SetGroupStatus("Fortitude (Shield)", false);
SetGroupStatus("Honor (1H)", false);
SetGroupStatus("Loyalty (2H)", false);
SetGroupStatus("Sacrifice (Lute)", false);

Trying to roll for compassion and it passes every time. The widget is even checked, any ideas?
 
Wahoo yeah I requested something like this a while ago. Can't wait to test it thanks for developing it.
 
so this is my edit, but for some reason it won't use skills?

All I want to use is firebolt. Any help? :D Thanks!

In the area you edited, you wrote

Code:
                                    var distToMob = me.dist(bestMob); 
                                    if (isAlive(bestMob)) 
                                    { 
                                        if (distToMob > _COMBAT_RANGE) 
                                        { 
                                            ComeTo(me.target, _COMBAT_RANGE - 1); 
                                   
                                            { 
                                                UseSkillAndWait("Flamebolt"); 
                                                 
                                            } 
                                        } 
                                    }

Which should be (the 2nd if checks if the mob is out of range, so you want your combat skills in the else part - and you also had some syntax issue)

Code:
                                    var distToMob = me.dist(bestMob); 
                                    if (isAlive(bestMob)) 
                                    { 
                                        if (distToMob > _COMBAT_RANGE) 
                                        { 
                                            ComeTo(me.target, _COMBAT_RANGE - 1); 
                                        }
                                        else
                                        { 
                                            UseSkillAndWait("Flamebolt"); 
                                        } 
                                    }
 
Что я делаю не так? Он находиться со мной в пати, но ничего не делает. Просто подбегает к мобу и бегает вокруг него(
 
Can somebody explain the Widget part?

The link provided doesnt work.
 
@Malise: Sorry, can't understand a single word of russian :(

@Fragnot: Fixed the link in main post. It's just a custom "skin" for the character widget to make more room for checkboxes (you can activate it in AB Menu > Settings > Characters > Widgets). Also working on a version with its own GUI and a few more features, I'll just have to find some time to spend in Hasla to test & fix it once I'm done with the code.

https://www.thebuddyforum.com/archebuddy-forum/archebuddy-widgets/178329-simple-widget-check.html
 
how can i make this atk without move?
 
Last edited:
how can i make this atk without move?

Change the value in that line (40 by default) to the same value you put in _COMBAT_RANGE, so it only target mobs within attack range

Code:
RoundZone zone = new RoundZone(me.X, me.Y, 40);
 
I'm sorry. What am I doing wrong? He be with me in the party, but does nothing. Just runs and runs a mob around him (
 
Is there a way to just take the auto roll and auto declines part into it's own plug-in?
Something where if I'm actually controlling the character, and it will filter through the tokens for me?
That way I can pay attention to the combat and only have to click on rolls if its not tokens or coin bags?
 
compassion tokens nor rolling because Name is not detected...
did a name and id dump and it shows like this
Name: " " - ID: 35525
also when rolling in the logs you get this
Passing on : " "

fixed

else if(item.id == 26056)
doRoll = GetGroupStatus("Conviction (Staff)");

else if (item.id == 26055)
doRoll = GetGroupStatus("Courage (Bow)");

else if (item.id == 35525)
doRoll = GetGroupStatus("Compassion (Heal)");

else if (item.id == 26057)
doRoll = GetGroupStatus("Fortitude (Shield)");

else if (item.id == 26053)
doRoll = GetGroupStatus("Honor (1H)");

else if (item.id == 26054)
doRoll = GetGroupStatus("Loyalty (2H)");

else if (item.id == 26058)
doRoll = GetGroupStatus("Sacrifice (Lute)");
 
Last edited:
Karls can you post your exact build with your plugin. I want to basically plugin and play this so I wont have to tweak it to much. Most appreciated. <3
 
Status
Not open for further replies.
Back
Top