Page 1 of 2

Stick.mac

Posted: Thu Apr 29, 2004 1:10 pm
by Stix
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

Posted: Thu Apr 29, 2004 1:19 pm
by Mckorr
Thanks, gives me some ideas for repairing autofight.inc (which is buggy right now)!

Posted: Thu Apr 29, 2004 1:30 pm
by Falco72
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

Posted: Thu Apr 29, 2004 1:56 pm
by dok
nm. beat me to it ;)

Posted: Thu Apr 29, 2004 7:46 pm
by yesman
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?

Posted: Thu Apr 29, 2004 11:39 pm
by Stix
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

Posted: Fri Apr 30, 2004 3:32 am
by yesman
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}

Modified

Posted: Sat May 01, 2004 4:18 pm
by Fuergrissa
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

Posted: Sun May 02, 2004 3:41 am
by Zeit
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

Posted: Sun May 02, 2004 10:38 am
by yesman
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
???

Posted: Sun May 02, 2004 11:52 am
by Zeit
Nope its working fine

Posted: Mon May 03, 2004 8:56 pm
by Stix
minor fixes see first post

Posted: Mon May 03, 2004 11:21 pm
by Fire
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

Posted: Mon May 03, 2004 11:23 pm
by yesman
should be able to just type /varset MaxD 13 in mq2chat window with macro running to get what you want.

Posted: Tue May 04, 2004 12:44 am
by Stix
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