Real simple Stick.mac

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

Stix
orc pawn
orc pawn
Posts: 14
Joined: Tue Apr 20, 2004 12:39 am

Real simple Stick.mac

Post by Stix » Tue Apr 20, 2004 12:53 am

THis is my first macro that actually functions deacently. Its a real scaled down version of the stick macros out there, but this works with MQ2DATA.

If anyone find any errors please say so. im really trying to learn how to code, and im not real good at it.


Update 4-22-04

Added Enrage target watch functions. You will no longer stop attacking if our target is NOT enraged.

If you target yourself and have the macro engaged (Attack enabled), you will now untarget yourself.

Stoping Attack, stops the macro from functioning. this is intentional. just start attacking again to have it take over.

Added a few more melee abilitys.

4-23-04
Cleaned up the code a tad. (thanks Bob for the help).
removed paramiter for player set max distance.
Added auto-distance

Code: Select all

|Stik.mac 
|4-23-14 
| 
|Syntax: 
| Usage: /macro stick
|   
| 
|Functions: 
|  Now automatically sets Max Distances for you.
|  Will auto Kick, Beg, and disarm. 
|  Will turn off attack on ENRAGE, only if it is your mob that is enraged. 
|  Stoping attack while the macro is running will stop movment. 
|-Stix 


#event rageon "has become ENRAGED." 
#event rageoff "is no longer enraged" 
#event stunned "while stunned" 

sub main 
   
   /echo STICK MAC STARTED 

:main 
   /doevents 
   /if (${Me.Combat}) /goto :mob 
   /goto :main 

:mob 
   /if (${Target.Distance}>100) { 
      /echo (${Target}) IS OOR 
      /attack off 
      /goto :main 
   }  
   /if (${Target.ID}) { 
      /zapvars 
      /declare MaxD global 
      /varset MaxD "${Target.MaxRange}"
      /echo Attacking (${Target}) at @MaxD distance.
      /goto :combat 
   }    
   /goto :main 

:combat
   /doevents 
   /if (${String[${Target}].Equal[${Me}]}) /attack off 
   /if (!${Me.Combat}) /goto :main 
   /face fast nolook 
   /if (${Target.Distance}>@MaxD-2) /keypress forward hold 
   /if (${Target.Distance}<=@MaxD-4) /keypress forward     
   /if (${Target.Distance}<@MaxD-7) /keypress back hold 
   /if (${Target.Distance}<@MaxD-2) /if (${Me.AbilityReady[Kick]}) /doability "Kick" 
   /if (${Target.Distance}<@MaxD-2) /if (${Me.AbilityReady[Disarm]}) /doability "Disarm" 
   /if (${Target.Distance}<@MaxD-2) /if (${Me.AbilityReady[begging]}) { 
      /attack off 
      /face fast nolook 
      /delay 1 
      /doability "begging" 
      /if (!${Target.ID}) /goto :main 
      /attack on 
   } 
   /if (${Target.ID}) /goto :combat 
   /keypress back 
   /goto :main 
   /return 

sub event_rageon 
   /if (${Target.CurrentHPs}>10) /return 
   /popup ENRAGED ATTACK OFF 
   /echo Rage On 
   /attack off 
   /return 

sub event_rageoff 
   /if (${Target.CurrentHPs}>10) /return 
   /popup Rage OFF, ATTACKING NOW 
   /echo Rage Off 
   /attack on 
   /return 

sub event_stunned 
   /popup STUNNED STUNNED STUNNED 
   /delay 1s 
   /return
Please report any bugs/fixes.

Also cant seem to get the macro to stop moving while casting (tried the one bob listed, didnt work). if any one has any suggestions please post.
Last edited by Stix on Fri Apr 23, 2004 5:35 pm, edited 8 times in total.

JimJohnson
a grimling bloodguard
a grimling bloodguard
Posts: 1299
Joined: Sat Oct 11, 2003 6:00 am

Post by JimJohnson » Thu Apr 22, 2004 12:57 pm

Code: Select all

Ending Macro: Failed to parse /if command
stik.nac@12(main): /if ${Me.Combat} /goto :mob
Cleared the following: Timers Arrays
The current macro has ended
Usage: /if (<conditions>) <command>

bob_the_builder
a hill giant
a hill giant
Posts: 275
Joined: Tue Jul 22, 2003 1:22 pm

Post by bob_the_builder » Thu Apr 22, 2004 1:05 pm

Correct, this macro needs to be updated to work with the new /if ()

As the message states:

Usage: /if (<conditions>) <command>

Bob_is_not_an_old_dog

Stix
orc pawn
orc pawn
Posts: 14
Joined: Tue Apr 20, 2004 12:39 am

Post by Stix » Thu Apr 22, 2004 1:08 pm

should be fixed now. Changed attack range, and follow distances. Nxt update i will be adding a few more things like enrage tracking. You wont stop attacking your mob, if a mob next to you enrages.

WIll post it tonight, its on other PC.

mackster
a ghoul
a ghoul
Posts: 95
Joined: Mon Sep 09, 2002 3:02 pm

Post by mackster » Thu Apr 22, 2004 1:22 pm

If you target yourself while in the middle of attacking, you walk backwards

bob_the_builder
a hill giant
a hill giant
Posts: 275
Joined: Tue Jul 22, 2003 1:22 pm

Post by bob_the_builder » Thu Apr 22, 2004 1:33 pm

Just add

Code: Select all

/declare MobID global
/varset MobID "${Target.ID}"
.
.
.
/tar @MobID
That will make it so you cant target anything else.

or change the /tar @MobID and make it

Code: Select all

/if (${Target.ID.NotEqual["@MobID"]}) /goto :main
The point being that when you target yourself your distance is less then

Code: Select all

(${Target.Distance}<5)
and you /keypress back hold , /keypress back over and over again ....


Bob

JimJohnson
a grimling bloodguard
a grimling bloodguard
Posts: 1299
Joined: Sat Oct 11, 2003 6:00 am

Post by JimJohnson » Thu Apr 22, 2004 4:00 pm

Doesnt seem to be working correctly.

/macro stik

target a mob nothing happends.

turn on attack with mob targeted greater then 50 distance. macro turns off attack.
[MQ2] (Mob name) IS OOR
turn on attack with mob targeted less then 50 distance but more then 5. macro turns off attack.
[MQ2] (Mob name) IS OOR


or I am using the macro incorectly

Stix
orc pawn
orc pawn
Posts: 14
Joined: Tue Apr 20, 2004 12:39 am

Post by Stix » Thu Apr 22, 2004 8:48 pm

The macro is set up to turn off attack if your target is OOR. This stops you from runing after them mob especially in a raid enviroment, and your are just assisting a MA.

The macro does not end if you turn off attack, it just stops functioning. Just turn attack back on, and it takes ofer. This was intentional. Allows for some emergency moving/changing MA's ect with out chasing your target.

TAGBOT
orc pawn
orc pawn
Posts: 17
Joined: Fri Apr 09, 2004 12:27 pm

Post by TAGBOT » Thu Apr 22, 2004 10:58 pm

This is what I would like to use, but is there way to pause movement so a spell can be cast? I used another one that had that function but it no longer works.

Stix
orc pawn
orc pawn
Posts: 14
Joined: Tue Apr 20, 2004 12:39 am

Post by Stix » Thu Apr 22, 2004 11:11 pm

Just turn off attack, and movment stops. cast spell, and turn attack back on to resume having the macro move ya.

bob_the_builder
a hill giant
a hill giant
Posts: 275
Joined: Tue Jul 22, 2003 1:22 pm

Post by bob_the_builder » Thu Apr 22, 2004 11:23 pm

but is there way to pause movement so a spell can be cast

Code: Select all

/if ((${Target.Distance}>@MaxD)&&($!{Me.Casting.ID})) /move around some
Try adding that for each movement line.

Bob
Last edited by bob_the_builder on Fri Apr 23, 2004 8:37 am, edited 1 time in total.

bob_the_builder
a hill giant
a hill giant
Posts: 275
Joined: Tue Jul 22, 2003 1:22 pm

Post by bob_the_builder » Thu Apr 22, 2004 11:35 pm

Also this is good code from the original m0nk stick.mac and works with out /delay and double /keypress back hold mumbo jumbo

Code: Select all

      /if (${Target.Distance}>@MeleeDistance) /keypress forward hold  
      /if (${Target.Distance}<=@MeleeDistance) /keypress forward
      /if (${Target.Distance}<=${Math.Calc[@MeleeDistance-5]}) /keypress back hold
That keeps you right at the mobs MeleeDistance which I also suggest adding in as a

Code: Select all

/varset MeleeDistance "@Param0"
cause you never know when a hitbox is like inside a giants pants )

Bob

Stix
orc pawn
orc pawn
Posts: 14
Joined: Tue Apr 20, 2004 12:39 am

Post by Stix » Fri Apr 23, 2004 2:02 am

Updated with new parms, tried to add the casting part, it just made the macro spam the screen with you can not use that command while casting. tried to get it there, just wouldnt work.

*** Removed player entered distances, added auto-distance

See first post.

Scriptless
orc pawn
orc pawn
Posts: 16
Joined: Fri Apr 23, 2004 4:20 pm

Good stuff

Post by Scriptless » Sat Apr 24, 2004 12:05 am

I have been working on a few macs and I would like to share them.

I take no credit for these, they are based off the above and dumbed down some.

These are for a warrior

Code: Select all

#event rageon "has become ENRAGED." 
#event rageoff "is no longer enraged" 
#event stunned "while stunned" 

sub main 

/echo CHASE ROLLIN

:main 
   /doevents 
   /newif (${Me.Combat}) /goto :mob 
   /goto :main 

:mob 
   /newif (${Target.Distance}>75) { 
      /echo (${Target}) IS OOR 
      /attack off 
      /goto :main 
   }  
   /newif (${Target.ID}) { 
      /echo Attacking (${Target}) 
      /goto :combat 
   }    
   /goto :main 

:combat 
   /doevents 
   /newif (!${Me.Combat}) /goto :main 
   /face fast nolook 
   /newif (${Target.Distance}>14) /keypress forward hold 
   /newif (${Target.Distance}<12) /keypress forward 
   /newif (${Target.Distance}<5) { 
      /keypress back hold 
      /delay 1 
      /keypress back 
   } 
   /newif (${Target.Distance}<12) /newif (${Me.AbilityReady[Kick]}) /doability "Kick" 
   /newif (${Target.Distance}<12) /newif (${Me.AbilityReady[taunt]}) /doability "taunt" 
   /newif (${Target.ID}) /goto :combat 
   /goto :main 
   /return 

sub event_rageon 
   /popup ENRAGED ATTACK OFF 
   /echo Rage On 
   /attack off 
   /return 

sub event_rageoff 
   /popup Rage OFF, ATTACKING NOW 
   /echo Rage Off 
   /attack on 
   /return 

sub event_stunned 
   /popup STUNNED STUNNED STUNNED 
   /delay 1s 
   /popup STUNNED STUNNED STUNNED 
   /delay 1s 
   /return

This is with no chase, the Popups are really cool, great idea

Code: Select all

#event rageon "has become ENRAGED." 
#event rageoff "is no longer enraged" 
#event stunned "while stunned" 

sub main 

/echo KICK TAUNT ROLLIN

:main 
   /doevents 
   /newif (${Me.Combat}) /goto :mob 
   /goto :main 


:mob 

/newif (${Me.AbilityReady[Kick]}) /doability "Kick" 

/newif (${Me.AbilityReady[taunt]}) /doability "taunt" 

/goto :main 

sub event_rageon 
   /popup ENRAGED ATTACK OFF 
   /echo Rage On 
   /attack off 
   /return 

sub event_rageoff 
   /popup Rage OFF, ATTACKING NOW 
   /echo Rage Off 
   /attack on 
   /return 

sub event_stunned 
   /popup STUNNED STUNNED STUNNED 
   /delay 1s 
   /popup STUNNED STUNNED STUNNED 
   /delay 1s 
   /return

Marnan
orc pawn
orc pawn
Posts: 12
Joined: Sun Oct 12, 2003 2:05 pm

Post by Marnan » Sun Apr 25, 2004 12:23 am

Thank you for this macro. My wrists need it. When fighting summoning mobs while working with rogues, I don't want to get summoned as it tends to make it hard on the rogues.

So with summoning mobs, I like to move in close enough so that I don't get summoned. How would I do that using this macro?

Thanks again for the hard work.