Stick.mac

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

Moderator: MacroQuest Developers

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

Stick.mac

Post by Stix » Thu Apr 29, 2004 1:10 pm

This works for the most part, has a few bugs, but not sure if its the macro or MQ2Data reporting faulty numbers.

On some mobs the to Hit range is way off, and you mis alot. others it reads fine.

5-3-04 should now clear MaxD to get proper range with out spaming the MQ screen now. Seems to be pretty stable.

Code: Select all

|Stik.mac 
|5-3-04 7:35 PM 
| 
|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" 
#event slain "has been slain" 

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}) { 
      /deletevar MaxD
      /declare MaxD int local
      /varset MaxD ${Target.MaxRangeTo}
      /echo Attacking (${Target}) at ${MaxD} distance. 
      /goto :combat 
   }    
   /goto :main 

:combat 
   /doevents 
   /if (${Target.ID}==${Me.ID}) /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
   /keypress back 
   /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

sub event_slain 
   /keypress back 
   /return
Last edited by Stix on Mon May 03, 2004 8:53 pm, edited 2 times in total.

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Thu Apr 29, 2004 1:19 pm

Thanks, gives me some ideas for repairing autofight.inc (which is buggy right now)!

Falco72
a hill giant
a hill giant
Posts: 215
Joined: Fri Sep 26, 2003 3:24 am

Post by Falco72 » Thu Apr 29, 2004 1:30 pm

It can be better if you change

Code: Select all

:combat
   /doevents
   /if (${String[${Target}].Equal[${Me}]}) /attack off
to

Code: Select all

:combat
   /doevents
   [color=red]/if (${Target.ID}==${Me.ID}) /attack off[/color]
and

Code: Select all

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

Code: Select all

:mob
   /if (${Target.Distance}>100) {
      /echo (${Target}) IS OOR
      /attack off
      /goto :main
   } 
   /if (${Target.ID}) {
      [color=red]/declare MaxD int local
      /varset MaxD "${Target.MaxRangeTo}"
      /echo Attacking (${Target}) at ${MaxD} distance.[/color]
      /goto :combat
   }   
   /goto :main

dok
a ghoul
a ghoul
Posts: 127
Joined: Mon Mar 15, 2004 3:38 pm

Post by dok » Thu Apr 29, 2004 1:56 pm

nm. beat me to it ;)

yesman
a lesser mummy
a lesser mummy
Posts: 64
Joined: Tue Apr 27, 2004 9:06 pm

Post by yesman » Thu Apr 29, 2004 7:46 pm

Instead of :

Code: Select all

: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 
   } 
You need :

Code: Select all

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

Getting error with your /declare MaxD, already declared.

Is this because of the /goto's you are using? Is there a way to set up the declare before you target a mob?

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

Post by Stix » Thu Apr 29, 2004 11:39 pm

The declare is in the place it is, with /zapvars just above it, so that it gets the new distance from the mob each time it starts over (changign mobs).

If i didnt do it that way i was running into stuff like this. Mob_01 has a hit radius of 10, macro started MaxD sets to 10. now change to mob_02, has a hit radius of 6, MaxD is still set to 10, so you end up missing 99 % of the time.

By placing the /zapvars in the spot it is, and having the MaxD reset each time you retarget a mob it gets the proper distance per mob. I think i saw something in one of the updates that will hide all var info from the MQ window. If i did read that corect, ill put it in, so that you dont get spamed.

EDIT
Just saw that /zapvar is no more. fixed the scrypt to be functional now.

See first post

yesman
a lesser mummy
a lesser mummy
Posts: 64
Joined: Tue Apr 27, 2004 9:06 pm

Post by yesman » Fri Apr 30, 2004 3:32 am

Figured out why you will always get the /declared error.

Target.MaxRange is a TLO, you instead of declaring it you are just being redundant.

Take out everything to do with MaxD and just sub in ${Target.MaxRange.Int}

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

Modified

Post by Fuergrissa » Sat May 01, 2004 4:18 pm

i have modified this alot and will post it when finished, i have an issue where a certain mob in one of the planes sets a distance of 22, would this work to set a max distance of 18.

Code: Select all

 /varset MaxD ${Target.MaxRangeTo}
[color=red]/if (${MaxD}>18) /varset MaxD 18[/color]
      /echo Attacking a level ${Target.Level} ( ${Target.CleanName} ) at a Distance of ${MaxD}
      /goto :combat
thanks in advance

Zeit
a lesser mummy
a lesser mummy
Posts: 34
Joined: Sat Jan 24, 2004 5:54 am

Post by Zeit » Sun May 02, 2004 3:41 am

was getting error because a define was in the loop so took it out got rid of the error chopped it down some added an event to start the bot (this is a kite group) Begging i dont think is working still but im not really worried about it. Am having a problem sometimes when the mob dies key hangs on /Keypress forward (or back) hold and takes off running gets himself killed sometimes most times i see it and stop him. Not real sure where the bug is but its working pretty well. Going to add them returning to a specific loc after the mob is dead later ill post when its finished. Any ideas on the taking off running thing would be appreciated

Code: Select all

#event go "go fools"

sub main

   /declare MaxD int local

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

:mob
   /if (${Target.Distance}>300) {
      /echo (${Target}) IS OOR
      /attack off
      /goto :main
   } 
   /if (${Target.ID}) {
      /varset MaxD ${Target.MaxRangeTo}
      /if (${MaxD}>16) /varset MaxD 16
      /echo Attacking (${Target}) at ${MaxD} distance.
      /goto :combat
   }   
   /goto :main

:combat
   /doevents
   /if (${Target.ID}==${Me.ID}) /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[Backstab]}) /doability "Backstab"
   /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_go
   /target Kiter
   /assist
   /attack on
/return

yesman
a lesser mummy
a lesser mummy
Posts: 64
Joined: Tue Apr 27, 2004 9:06 pm

Post by yesman » Sun May 02, 2004 10:38 am

Zeit wrote:

Code: Select all

   /if (${Target.ID}) {
      /varset MaxD ${Target.MaxRangeTo}
      /if (${MaxD}>16) /varset MaxD 16
      /echo Attacking (${Target}) at ${MaxD} distance.
      /goto :combat
   }   
   /goto :main

Aren't you getting an unparsable and macro ending with /if (${MaxD}>16) /varset MaxD 16

Shouldn't it be

Code: Select all

/if (${MaxD}>${Int[16]}) /varset MaxD 16
???

Zeit
a lesser mummy
a lesser mummy
Posts: 34
Joined: Sat Jan 24, 2004 5:54 am

Post by Zeit » Sun May 02, 2004 11:52 am

Nope its working fine

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

Post by Stix » Mon May 03, 2004 8:56 pm

minor fixes see first post

Fire
decaying skeleton
decaying skeleton
Posts: 9
Joined: Mon Nov 10, 2003 7:12 pm

Post by Fire » Mon May 03, 2004 11:21 pm

Would it be possable to have a mod for this mac so you could set your max distance when you start the mac, and if no distance is given it will default to finding the distance for you as it does now? I tried playing around and trying to add that to it, but i cannot figure out how to make it go one way or the other.


Fire

yesman
a lesser mummy
a lesser mummy
Posts: 64
Joined: Tue Apr 27, 2004 9:06 pm

Post by yesman » Mon May 03, 2004 11:23 pm

should be able to just type /varset MaxD 13 in mq2chat window with macro running to get what you want.

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

Post by Stix » Tue May 04, 2004 12:44 am

Can try this UNTESTED, im going to bed.

Code: Select all

|Stik.mac 
| BETA !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  BETA  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|5-3-04 11:45 PM 
| 
|Syntax: 
| Usage: /macro stick 14 ( or other range you choose )
|    
| 
|Functions: 
|  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" 
#event slain "has been slain" 

sub main(p0) 
    
   /if (${Defined[p0]}==FALSE) { 
      /echo usage Usage stick.mac 14 (or any distance you choose) 
      /return 
   } 
   /deletevar MaxD  
   /declare MaxD global 
   /varset MaxD @p0 
   /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}) { 
      /echo Attacking (${Target}) at ${MaxD} distance. 
      /goto :combat 
   }    
   /goto :main 

:combat 
   /doevents 
   /if (${Target.ID}==${Me.ID}) /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 
   /keypress back 
   /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 

sub event_slain 
   /keypress back 
   /return