Simple Fight-Kick Macro

Post your completed (working) macros here. Only for macros using MQ2Data syntax!

Moderator: MacroQuest Developers

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Simple Fight-Kick Macro

Post by Drumstix42 » Sun Jun 13, 2004 12:10 pm

I started making this macro, and tried using events, and then I found a much way to do it, blah blah.

The point is....

-If your attack is on, it will continue to kick as long as you have a target, your kick is ready to use, and your not casting a spell.
-If your attack is off, it'll wait until the next fight

Pretty simple. Can be easily added to for more skills I'm sure:

Code: Select all

|-- groupinfo.mac
|-- by Drumstix42
|-- 10-05-2004
|----------------------------------------------------
|-- Lets Kick it!

Sub Main
   /echo Auto-Kicking while Attacking
   /call Combat
/return

Sub Combat
   /echo Lets Fight...
   :WaitLoop
   /if (!${Me.Combat}) {
      /echo Waiting for another fight...
      /delay 60s ${Me.Combat}
      /goto :WaitLoop
   }
   /echo Fighting -- ${Target.CleanName}
   :CombatLoop
    /if (${Me.Combat}) {
       /delay 10s ${Me.AbilityReady["Kick"]}
       /if (${Me.AbilityReady["Kick"]}&&!${Me.Casting.ID}&&${Target.ID}&&!${Me.Stunned}) /doability "Kick"
    }
    /if (${Me.Combat}) /goto :CombatLoop
    /goto :WaitLoop
/return
Enjoy.
Last edited by Drumstix42 on Thu Jul 29, 2004 7:25 pm, edited 1 time in total.

kaatok
decaying skeleton
decaying skeleton
Posts: 3
Joined: Wed Jun 09, 2004 11:43 am

Post by kaatok » Sat Jun 26, 2004 11:56 am

First things first, im an utter beginner here i dont know the first thing about code or c++ or anything im just following guides and trying to pick it up as i go along, so forgive me my ignorance.

I use this macro, i love it take great joy from the simple things, like, not having to press a button all the time. I just got Feral swipe and was looking to incluse roughly the same code in this macro to add auto swipe.

Now again i have no clue but im guessing i would do this

Code: Select all

|-- groupinfo.mac 
|-- by Drumstix42 
|-- 10-05-2004 
|---------------------------------------------------- 
|-- Lets Kick it! 

Sub Main 
   /echo Auto-Kicking while Attacking 
   /call Combat 
/return 

Sub Combat 
   /echo Lets Fight... 
   :WaitLoop 
   /if (!${Me.Combat}) { 
      /echo Waiting for another fight... 
      /delay 60s ${Me.Combat} 
      /goto :WaitLoop 
   } 
   /echo Fighting -- ${Target.CleanName} 
   :CombatLoop 
    /if (${Me.Combat}) { 
       /delay 10s ${Me.AbilityReady["Kick"]} 
       /if (${Me.AbilityReady["Kick"]}&&!${Me.Casting.ID}&&${Target.ID}) /doability "Kick" 
    } 

    ***added code here***
    /if (${Me.Combat}) { 
       /delay[b] 60s [/b]${Me.AbilityReady["[b]Feral Swipe[/b]"]} 
       /if (${Me.AbilityReady["[b]Feral Swipe[/b]"]}&&!${Me.Casting.ID}&&${Target.ID}) /doability "[b]Feral Swipe[/b]" 
    } 
***finished***

    /goto :WaitLoop 
/return

Again im just trying to have an educated guess, but could anyone gimme a yes or no? Ive added in bold letters the change to the code i have done just basically changing kick to feral swipe and 10s to 60s.

I gotta start this book i got of 'learn c++ in 21 days' :P

Thank you for any help.[/code]

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Post by Drumstix42 » Sat Jun 26, 2004 8:50 pm

See if I can help ya out a bit here.

Lets take is step by step.


First, lets take this block:

Code: Select all

    /if (${Me.Combat}) { 
       /delay 10s ${Me.AbilityReady["Kick"]} 
       /if (${Me.AbilityReady["Kick"]}&&!${Me.Casting.ID}&&${Target.ID}) /doability "Kick" 
    }
The code how it stands now just waits for Kick to be ready to use, then kicks. We can eitehr just a line in before that /delay, or replace it.

Here's my suggestion for adding a line to active the Feral Swipe (since it's an AA, and not really an ability per-say).

Get the SpellCast.inc (an include file) and put it in your macro folder:
http://macroquest2.com/phpBB2/viewtopic.php?t=6748

Add this code in blue:

Code: Select all

|-- groupinfo.mac
|-- by Drumstix42
|-- 10-05-2004
|----------------------------------------------------
|-- Lets Kick it!

[color=cyan]#include SpellCast.inc[/color]

Sub Main
   /echo Auto-Kicking while Attacking
   /call Combat
/return
Then, add this line before our /delay

Code: Select all

    /if (${Me.Combat}) {
       [color=cyan]/call Cast "Feral Swipe" activate[/color]
       /delay 10s ${Me.AbilityReady["Kick"]}
       /if (${Me.AbilityReady["Kick"]}&&!${Me.Casting.ID}&&${Target.ID}) {
          /doability "Kick"
       }
    }
The only difference from that and replacing the /delay line is:

Lets say Feral Swipe pops up while waiting for kick to pop, it won't do the Feral Swipe until after the next kick. Honestly, that's the least of anyone's worries I'm sure.

Another option could be this:

Code: Select all

    /if (${Me.Combat}) {
       /if (!${Me.Casting.ID}&&${Target.ID}) /call Cast "Feral Swipe" activate
       /delay 10s ${Me.AbilityReady["Kick"]}
       /if (${Me.AbilityReady["Kick"]}&&!${Me.Casting.ID}&&${Target.ID}) {
          /doability "Kick"
       }
    }
... to make sure your not casting, and you have a target.

There's tons of way to customize it really. Just giving you options.

User avatar
Kambic
a lesser mummy
a lesser mummy
Posts: 74
Joined: Fri May 28, 2004 11:48 am

Auto-Beg

Post by Kambic » Sat Jun 26, 2004 10:34 pm

I thought I'd change that to make it Auto Beg (just trying to practice my macro coding).

All I did was change every reference to Kick over to Begging, and added commands to turn off attack and turn it back on and beg in between. Unfortunately (although the macro works), it locks up the client for me*.

Here's my code:

Code: Select all

Sub Main
   /echo Auto-Begging while Attacking
   /call Combat
/return

Sub Combat
   /echo Lets Beg...
   :WaitLoop
   /if (!${Me.Combat}) {
      /echo Waiting for another fight...
      /delay 60s ${Me.Combat}
      /goto :WaitLoop
   }
   /echo Begging -- ${Target.CleanName}
   :CombatLoop
    /if (${Me.Combat}) {
       /delay 10s ${Me.AbilityReady["Begging"]}
       /if (${Me.AbilityReady["Begging"]}&&!${Me.Casting.ID}&&${Target.ID}) {
          /attack off
          /doability "Begging"
          /attack on
       }
    }
    /if (${Me.Combat}) /goto :CombatLoop
    /goto :WaitLoop
/return
*Yes I've been to F-H and I know there are other solutions to this problem, but I want my macro to work.

The macro runs, it attemps to beg but it locks the client (no spells or hotkeys, only game supplied menus). I assume the problem is turning attack on and off, what is the proper solution? I've tried writing this several different ways, sub routines, different combinations of /if and /goto, etc. but all of them lock me up. I thought I'd be able to clone this code yet it still did it.

Another avenue I've considered is changing #turbo, but I don't understand it much and did not fiddle with it.

Me.Name
a lesser mummy
a lesser mummy
Posts: 56
Joined: Thu Mar 11, 2004 11:49 pm
Location: ${Me.Bound}

Post by Me.Name » Sun Jun 27, 2004 2:42 am

How about this...

My warrior "taunts" and "kicks" (of course a warrior wouldn't need the casting check), so...

Code: Select all

| macro name: tank.mac

Sub Main
    :loop
    /if (${Me.Combat}&&${Target.ID}&&!${Me.Casting.ID}) {
        /if (${Me.AbilityReady["Taunt"]}) /doability "Taunt"
        /if (${Me.AbilityReady["Kick"]}) /doability "Kick"
    }
    /goto :loop
/return
You would need to stop it with a "/endmacro" command though.
I'll try this soon and post findings.

edit: fixed typo

update: Works for me but needs a check for stun. As it is now if you are stunned and an ability is ready, this macro goes nuts trying to do ability.

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Re: Auto-Beg

Post by Drumstix42 » Sun Jun 27, 2004 5:03 pm

Aye, does need a stun check, was gonna post that, forgot tho.





As for:
Kambic wrote:I thought I'd change that to make it Auto Beg (just trying to practice my macro coding).

All I did was change every reference to Kick over to Begging, and added commands to turn off attack and turn it back on and beg in between. Unfortunately (although the macro works), it locks up the client for me*.

Here's my code:

Code: Select all

Sub Main
   /echo Auto-Begging while Attacking
   /call Combat
/return

Sub Combat
   /echo Lets Beg...
   :WaitLoop
   /if (!${Me.Combat}) {
      /echo Waiting for another fight...
      /delay 60s ${Me.Combat}
      /goto :WaitLoop
   }
   /echo Begging -- ${Target.CleanName}
   :CombatLoop
    /if (${Me.Combat}) {
       /delay 10s ${Me.AbilityReady["Begging"]}
       /if (${Me.AbilityReady["Begging"]}&&!${Me.Casting.ID}&&${Target.ID}) {
          /attack off
          /doability "Begging"
          /attack on
       }
    }
    /if (${Me.Combat}) /goto :CombatLoop
    /goto :WaitLoop
/return
Heh, your biggest problem is:

${Me.Combat}

I don't think you can even Beg while your attack is on.

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Post by Drumstix42 » Sun Jun 27, 2004 5:07 pm

For begging (untested) use this:

Code: Select all

|-- Begging.mac

Sub Main
   /echo Auto-Begging
   /call Beg
/return

Sub Beg
   /echo Lets Beg...
   :WaitLoop
   /if (!${Target.ID}) {
      /echo Waiting for another target to beg from...
      /delay 60s ${Target.ID}
      /goto :WaitLoop
   }
   /echo Begging from -- ${Target.CleanName}
   :BegLoop
    /if (${Target.ID}) {
       /delay 10s ${Me.AbilityReady["Begging"]}
       /if (${Target.ID}) /doability "Begging"
    }
    /if (${Target.ID}) /goto :BegLoop
    /goto :WaitLoop
/return

User avatar
Kambic
a lesser mummy
a lesser mummy
Posts: 74
Joined: Fri May 28, 2004 11:48 am

Post by Kambic » Mon Jun 28, 2004 1:26 am

I don't think you can even Beg while your attack is on.
Right, and you can't. That's why I added the /attack on and the /attack off around the /doability "Begging" command. I believe something in there may be locking up the client.

The macro runs fine, don't get me wrong. My problem isn't the macro itself, but why the macro is locking up my client.

My goal is to have a macro where in normal combat, my guy will switch off attack, beg (or pick pocket, or sneak, or whatever non-combat skill I want), and then switch attack back on, all automatically (well we are macro'ing after all). And preferably, without locking up my client :)

Me.Name
a lesser mummy
a lesser mummy
Posts: 56
Joined: Thu Mar 11, 2004 11:49 pm
Location: ${Me.Bound}

Post by Me.Name » Mon Jun 28, 2004 3:18 am

Try this -

Code: Select all

Sub Main
    /echo Auto taunt and kick macro started
    :loop
    /if (${Me.Combat}&&${Target.ID}&&!${Me.Stunned}&&!${Me.Casting.ID}) {
        /if (${Me.AbilityReady["Taunt"]}) /doability "Taunt"
        /if (${Me.AbilityReady["Kick"]}) /doability "Kick"
        /face
        /if (${Target.Distance}>${Target.MaxRangeTo}) /keypress forward hold
        /if (${Target.Distance}<10) /keypress forward
    }
    /if (!${Me.Sitting}) /goto :loop
/return
Added:
04-06-27 Check for stun
04-06-28 Fixed typo. Added auto-follow code to keep within melee range of fleeing mobs. Macro now ends when you sit.

OK! No more posting code for me without trying it first!
Bad macroer, bad!
Last edited by Me.Name on Tue Jun 29, 2004 1:33 am, edited 2 times in total.

User avatar
Fuergrissa
a grimling bloodguard
a grimling bloodguard
Posts: 607
Joined: Mon Dec 08, 2003 3:46 pm
Location: UK

Post by Fuergrissa » Mon Jun 28, 2004 5:04 am

This works for begging

Code: Select all

    /if (${Me.AbilityReady[begging]}) {
    /attack off
    /face fast nolook
    /delay 1
    /doability "begging"
    /attack on
   }
[quote]"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."[/quote]

Stubs
a ghoul
a ghoul
Posts: 108
Joined: Fri May 07, 2004 2:20 pm
Contact:

Plugin...

Post by Stubs » Fri Jul 02, 2004 5:00 pm

Ok I have been struggling to learn how to code macros and plugins... I am terrible at it...could anyone help me out with a plugin version of this macro? I have the macro running with an addition.


ADDED:

/if (${Me.AbilityReady[disarm]}) {
/doability "disarm"

Replaced kick with bash as I have no kick ability.
Always aspiring to learn, not sure of my success rate.

dkaa wrote:
[quote](14:49:52) dont_know_at_all: i can't make it policy to ban people who annoy me because only fearless would be left here[/quote]

DumbStruck
a ghoul
a ghoul
Posts: 125
Joined: Fri Apr 30, 2004 8:46 am

Post by DumbStruck » Sat Jul 03, 2004 8:24 am

Seemes like a good lil macro .. but why not add a follow (stick to mob) routine ? What good is kick and attack if mob isnt there hehe since your automating the kick may as well do a stick.

I will try to cut up another macro to see if i can get a follow routine in there for my use hehe

Drumstix42
a grimling bloodguard
a grimling bloodguard
Posts: 808
Joined: Mon May 03, 2004 4:25 pm

Post by Drumstix42 » Sat Jul 03, 2004 4:44 pm

DumbStruck wrote:Seemes like a good lil macro .. but why not add a follow (stick to mob) routine ? What good is kick and attack if mob isnt there hehe since your automating the kick may as well do a stick.

I will try to cut up another macro to see if i can get a follow routine in there for my use hehe
If you wanna stick, you go ande code it to stick.
I must say in "EVERY" macro I see that has to do with combat, people always wanna stick. It's really not that hard to code if you really wanted it. But I honestly suggest go using a Plugin. Then you DON"T have to code it every macro you use. My best suggestion is MoveUtils.

Me.Name
a lesser mummy
a lesser mummy
Posts: 56
Joined: Thu Mar 11, 2004 11:49 pm
Location: ${Me.Bound}

Post by Me.Name » Sat Jul 03, 2004 5:56 pm

DumbStruck wrote:Seemes like a good lil macro .. but why not add a follow (stick to mob) routine ? What good is kick and attack if mob isnt there hehe since your automating the kick may as well do a stick.
Did you try mine? It is posted in this thread.

Drumstix42 is right though. A plugin would be a better way to go. Why re-invent the wheel when the pros already have a better one. :wink:

DumbStruck
a ghoul
a ghoul
Posts: 125
Joined: Fri Apr 30, 2004 8:46 am

Post by DumbStruck » Sat Jul 03, 2004 8:38 pm

some reason i can never get the plugins to work ..