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

Autoattack Training Scarecrow

Status
Not open for further replies.

alcor75

Community Developer
Joined
Nov 22, 2012
Messages
376
Reaction score
24
[BUG] Melee Attack

So After some search and test i found that the skill "Melee Attack" is not working.

To test it, do this:

Code:
      {

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

            if (!UseSkill(skillName, true, selfTarget))
            {
                [B]Log(""GetLastError());[/B]
                if (me.target != null && GetLastError() == LastError.NoLineOfSight)
                {
                    //No line of sight, try come to target.
                    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 PluginRun()
        {
            while (true)
            {
                while (me.target == null)
                {
                    Thread.Sleep(50);
                }
 
                while (name(me.target) == "Elite Training Scarecrow" || name(me.target) == "Beginner Training Scarecrow" || name(me.target) == "Intermediate Training Scarecrow")
                {
                    if (angle(me.target, me) > 45 && angle(me.target, me) < 315)
                    {
                        TurnDirectly(me.target);
                    }

                    if (skillCooldown("Melee Attack") == 0)
                    {
                        UseSkillAndWait("Melee Attack");
                        Log("Used: Melee Attack");
                        Thread.Sleep(50);
                    }
           }
}

Hope Out take a look at this, and i hope i have not missed some easy concept.

/hat
 
Last edited:
right click the scarecrow or use your basic attack (press 1 if you havent moved that attack)
 
Last edited:
right click the scarecrow or use your basic attack (press 1 if you havent moved that attack)

Wow, tnx for answering me, but really, this make me look very stupid, so i'll add some info:

Code:
if (me.target.name == "Elite Training Scarecrow" || me.target.name == "Beginner Training Scarecrow" || me.target.name == "Intermediate Training Scarecrow")
            {
                Log("attack");
                TurnDirectly(me.target);
                foreach (Skill item in me.getSkills())
                {
                    Log(item.name);
                    if (item.name == "Melee Attack")
                    {
                        if (!item.UseSkill(true))
                        {
                           Log("Attack Failed");
                        }
                        break;
                    }
                }          
                Thread.Sleep(5000);                
            }

This Fail.

Code:
if (me.target.name == "Elite Training Scarecrow" || me.target.name == "Beginner Training Scarecrow" || me.target.name == "Intermediate Training Scarecrow")
            {
                Log("attack");
                TurnDirectly(me.target);                
                if (!UseSkill("Melee Attack"))
                {
                    Log("Attack Failed");
                }              
                Thread.Sleep(100);
                
            }

This fail.

Is Training Scarecrow somehow a special Creature that should be treated different?
Pls what i'm i doing wrong?

Ill test now a code to push Melee Attack to skillbar 1 slot1 and trigger it, but really don't like it ('m sure AB is aimed for more precision, this way is so much artificial....but if that the only way i'll live with it).

Out pls point me to right direction..

/hat
 
But why do you need a script for this when it auto attacks automatically?

Pls can you explain it?

I mean, let say i want my code to go and do something, and time by time come back to a Training Scarecrow and look like one of those AFker that Trion allow to afk at the scarecrow, really what i do befor shouldent mean, but my CODE and not me manually (really cant understand why you tell me to attack it manually in a bot forum) go back to a training scarecrow and (again the code) attack it.

"Attack it" is the key word, the CODE do it (in the hope it can), not me, i need IT to do it, when i'm not there (really, this is a bot forum, and bot shouldent require me to do something....) and what i do before and after (Since i need to do something)... if i were to leave it there attacking the Training scarecrow, probably i weren't here.

Can't understand why this look so complicated.....

Pls can someone help me?

/Hat
 
Pls can you explain it?

I mean, let say i want my code to go and do something, and time by time come back to a Training Scarecrow and look like one of those AFker that Trion allow to afk at the scarecrow, really what i do befor shouldent mean, but my CODE and not me manually (really cant understand why you tell me to attack it manually in a bot forum) go back to a training scarecrow and (again the code) attack it.

"Attack it" is the key word, the CODE do it (in the hope it can), not me, i need IT to do it, when i'm not there (really, this is a bot forum, and bot shouldent require me to do something....) and what i do before and after (Since i need to do something)... if i were to leave it there attacking the Training scarecrow, probably i weren't here.

Can't understand why this look so complicated.....

Pls can someone help me?

/Hat

Sadly, you need to pay someone to code what you want. Buying the archebuddy bot doesn't include the premium plugins. You need to buy them.
 
Sadly, you need to pay someone to code what you want. Buying the archebuddy bot doesn't include the premium plugins. You need to buy them.

Pls tell me you are making JK of me..... i'm the coder... i'm looking for the 1 line command that trigger the basic melee skill "Melee Attack" on the special target "Elite Training Scarecrow".

Why special? you tell becouse the commonly used code (posted above) do not work.

I already asked OUT to move this thread b/c id do not belong here, but to Dev forum.

Hope for a solution soon, i have a 13000 line of code plugin(not for sell) that miss this function to look what i want it to look.

/hat
 
You're going to want to use something like this:
Code:
        public void UseSkillAndWait(string skillName, bool selfTarget = false)
        {

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

            if (!UseSkill(skillName, true, selfTarget))
            {
                if (me.target != null && GetLastError() == LastError.NoLineOfSight)
                {
                    //No line of sight, try come to target.
                    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 PluginRun()
        {
            while (true)
            {
                while (me.target == null)
                {
                    Thread.Sleep(50);
                }
 
                while (name(me.target) == "Elite Training Scarecrow" || name(me.target) == "Beginner Training Scarecrow" || name(me.target) == "Intermediate Training Scarecrow")
                {
                    if (angle(me.target, me) > 45 && angle(me.target, me) < 315)
                    {
                        TurnDirectly(me.target);
                    }

                    if (skillCooldown("YourAbilityHere") == 0)
                    {
                        UseSkillAndWait("YourAbilityHere");
                        Log("Used: YourAbilityHere");
                        Thread.Sleep(50);
                    }
           }
}

Warning! This code does not and will not auto attack. Instead it casts the attack over and over.
 
Tnx alot for answering me Mordark.

I use that function "UseSkillAndWait" alot in other part of my code, and it work flawless (that part of the first basic autokill plugin Out posted).

My understanding, after 3 days of test is that AB can't trigger the "Melee Attack" Ability (the ID of this ability is "2", number that make me guess), the way the game client intend it (start Battle and slash your melee weapon), at least not on a Training Scarecrow.

There's no point in standing in front of a Training scarecrow and fire special skills... i hope you see what i mean (if i'm there using skills i'm not afk).

I really hope i still ignore something and i'll keep searching the API for a solution, but if Out or someone else can give me some more hint....i'll be grateful.

/Hat
 
You're going to want to use something like this:
Code:
        public void UseSkillAndWait(string skillName, bool selfTarget = false)
        {

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

            if (!UseSkill(skillName, true, selfTarget))
            {
                if (me.target != null && GetLastError() == LastError.NoLineOfSight)
                {
                    //No line of sight, try come to target.
                    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 PluginRun()
        {
            while (true)
            {
                while (me.target == null)
                {
                    Thread.Sleep(50);
                }
 
                while (name(me.target) == "Elite Training Scarecrow" || name(me.target) == "Beginner Training Scarecrow" || name(me.target) == "Intermediate Training Scarecrow")
                {
                    if (angle(me.target, me) > 45 && angle(me.target, me) < 315)
                    {
                        TurnDirectly(me.target);
                    }

                    if (skillCooldown("YourAbilityHere") == 0)
                    {
                        UseSkillAndWait("YourAbilityHere");
                        Log("Used: YourAbilityHere");
                        Thread.Sleep(50);
                    }
           }
}

Warning! This code does not and will not auto attack. Instead it casts the attack over and over.

So i tried this:

Code:
        public void UseSkillAndWait(string skillName, bool selfTarget = false)
        {

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

            if (!UseSkill(skillName, true, selfTarget))
            {
                if (me.target != null && GetLastError() == LastError.NoLineOfSight)
                {
                    //No line of sight, try come to target.
                    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 PluginRun()
        {
            while (true)
            {
                while (me.target == null)
                {
                    Thread.Sleep(50);
                }
 
                while (name(me.target) == "Elite Training Scarecrow" || name(me.target) == "Beginner Training Scarecrow" || name(me.target) == "Intermediate Training Scarecrow")
                {
                    if (angle(me.target, me) > 45 && angle(me.target, me) < 315)
                    {
                        TurnDirectly(me.target);
                    }
                    if (skillCooldown("Melee Attack") == 0)
                    {
                        UseSkillAndWait("Melee Attack");
                        Log("Used: Melee Attack");
                        Thread.Sleep(50);
                    }
           }
}

Result is:

it Log "Used: Melee Attack"

But the char stand still and NEWER initiate attack.

I believe this might be cataloged as "Bug"

Pls Out take a look at this.

/Hat
 
Status
Not open for further replies.
Back
Top