Monk Anchor & Pull locations help . . .

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

User avatar
bohicaseti
a lesser mummy
a lesser mummy
Posts: 33
Joined: Sat Mar 06, 2004 5:55 am

Monk Anchor & Pull locations help . . .

Post by bohicaseti » Sat Mar 06, 2004 6:18 am

I am fully prepared to take any flaming you folks want to toss my direction over this. I tried like mad to find any specific answers that I could over the last couple of weeks in the forums and have spent around 20 hours trying to edit / change it around but I'm just plain stuck and can't think of how to fix it. I appologize in advance if I missed a sticky or some other obvious post pertaining to this. The one that I was able to gleen the most info from was the MonkHunter template and I thank them so very much for at least getting me pointed in the right direction. My goal is to have an Anchor point in which to fight my mobs and then heal/buff myself back up. Then it's "supposed" to run out to a specified loc to tag a mob and bring it back to the Anchor point and repeat the process. So far it will self buff if needed and check my health at the start and heal if needed, then run to the pullLocation and tag a mob. It then runs back to the Anchor point like it supposed to, but at that part I can't seem to get it to do what I want. Pending on how I screw up the code, it will either run back out toward the mob to fight it back out in the middle of the zone or it just has a brain fart and stands there for a bit then tries to go to the loot code and then start the macro all over again by running out to the pull location. I'm Mr. Potato Head when it comes to programming skills but I try for days til I want to smash my keyboard. Thanks again.

Code: Select all

#turbo 50
#define ENEMY "#######"
#define PullX "###.##"
#define PullY "###.##"
#define AnchorX "###.##"
#define AnchorY "###.##"
#define SearchSphere "Radius ### ZRadius ###"

Sub Main
/declare PullX Global
/declare PullY Global
/declare AnchorX Global
/declare AnchorY Global
/declare LootSlot Global

:MainLoop
   /call GMCheck
   /call BuffCheck
   /call CheckHP
   /call MoveToPull
   /call GetTarget
   /call TagMob
   /call MoveToAnchor
   /call Wait
   /call LootMob
   /goto :MainLoop

Sub GMCheck 
:GMChecker 
   /if $GM=="TRUE" { 
    /if n $char(ability,"Feign Death")>0 /doability "Feign Death" 
    /quit 
    } 
/return 

Sub BuffCheck
  /if n $char(buff,"Shield of the Arcane")==0 {
   /cast item "Chestwraps of Enlightenment" }
   /delay 12s 
/return 

Sub CheckHP
   /if n $char(hp,pct)<75
    /call Mend
/return

Sub MoveToPull
:PullMoveLoop 
  /if "$char(state)"=="SIT" /stand 
   /face nolook loc PullY,PullX
    /if n $distance(PullY,PullX)>2 /sendkey down up 
    /if n $distance(PullY,PullX)<=2 { 
     /sendkey up up 
      /return } 
    /goto :PullMoveLoop
/return 

Sub GetTarget 
:TargetLoop 
  /cleanup 
  /echo Searching for a ENEMY 
  /target npc ENEMY SearchSphere 
  /delay 2s
   /if ("$target()"=="FALSE" || n $target(hp,pct)<=95) { 
    /echo Unable to locate any targets nearby... Will try again in 10 seconds. 
    /delay 10s 
/goto :TargetLoop 
} 
/return

Sub TagMob
   /face
   /delay 1s
   /press 8
   /delay 1s
/return

Sub MoveToAnchor 
:AnchorMoveLoop 
  /if "$char(state)"=="SIT" /stand 
   /face nolook loc AnchorY,AnchorX
    /if n $distance(AnchorY,AnchorX)>1 /sendkey down up 
    /if n $distance(AnchorY,AnchorX)<=1 { 
     /sendkey up up 
      /return } 
    /goto :AnchorMoveLoop 
/return 

Sub Mend
  /if n $char(ability,"Mend")>=0 { 
   /if n $char(hp,pct)<75 /doability "Mend" } 
   /delay 1s
  /call HealDisc
/return

Sub HealDisc
   /if n $char(hp,pct)<80 {
   /disc heal 
   }
  /call Robe
/return

Sub Robe
   /if n $char(hp,pct)==100 /return 
   /if "$invpanel"!="true" /press i 
   /finditem "Silver Moon Chest Wraps"
   /delay 1 
   /finditem "Silver Moon Chest Wraps" 
   /delay 1 
   /click left chest
:HPCheck 
  /cast item "Silver Moon Chest Wraps" 
  /delay 60 
  /if n $char(hp,pct)==100 /goto :bp 
  /goto :HPCheck
:bp 
  /click left chest
  /delay 1s 
  /if "$cursor(name)"!="Silver Moon Chest Wraps" /goto :Bp 
  /click left auto 
  /cleanup 
/call MoveToPull
/return 

Sub Wait
   /if n $target(distance)>20 /delay 1s {
     /if n $target(distance)<20 /call KillMob }
/return

Sub KillMob
:EpicCheck
/cast item "Celestial Fists" {
/delay 15
/goto :EpicCheck }

:KillStart 
/if @atk==1 { 
/face fast 
   /attack $target(name,clean) 
     :kickinass 
      /if "$combat"=="TRUE" { 
      /if n $target(distance)>=15 /sendkey down up 
        /face fast 
      /if n $target(distance)>=13 /sendkey down up 
        /face fast 
      /if n $target(distance)<=10 /sendkey up up 
        /face fast 
      /if n $target(distance)<=8 /sendkey up up 
        /face fast 
      /if $char(ability,"Flying Kick")>0 /doability "Flying Kick" 
      /if $char(ability,"Disarm")>0 /doability "Disarm" } 
      /if n $char(ability,"Mend")>=0 { 
       /if n $char(hp,pct)<75 /doability "Mend" 
      } 
        /if n $char(hp,pct)<=20 { 
        /attack off 
        /echo << $char(hp,pct)% LOW HP - SS >> 
        /call MoveToAnchor 
	/goto :EpicCheck
    } 
    } 
    /doevents 
    /if "$target()"=="TRUE" /goto :kickinass 
    /if $target(id)==0 { 
      /target npc ENEMY radius 50 
      /if $target()==FALSE /return 
      /delay 1s 
      /goto :KillStart 
      } 
/return

Sub LootMob
:LootMob
   /target npc corpse
   /loot
   /delay 1s
:LootLoop
   /if n LootSlot>=10 /goto :DoneLooting {
   /click left corpse @LootSlot 0
   /autoinventory
   /click left corpse @LootSlot 1
   /autoinventory
   /click left corpse @LootSlot 3
   /autoinventory
   /click left corpse @LootSlot 4
   /autoinventory
   /goto :LootLoop
   }
/return

Sub DoneLooting
:DoneLooting
   /cleanup
   
/goto :MainLoop
/return

I'm sure some of the code that is in there probably isn't supposed to be, I've tried to take some of it out at one point or another and tried adding other misc bits here and there with no luck. This is more or less a Frankenstein script that I tried to sew together from looking at about 8 different other scripts over the last couple of weeks. Once again I fully accept any flamage at this point if I have missed something obvious somewhere. I just can't seem to get it right. :?
[/code]

daerck
a ghoul
a ghoul
Posts: 134
Joined: Mon Jan 12, 2004 8:44 pm

Post by daerck » Sat Mar 06, 2004 7:48 am

Code: Select all

Sub KillMob 
:EpicCheck 
/cast item "Celestial Fists" { 
/delay 15 
/goto :EpicCheck } 
This part doesn't look right. Looks like you will either get a syntax error or get stuck in an endless loop.

Better way to solve this is to add a timer, and set it to the appropriate value whener the Celestial Fists are clicked, then check for something like this

Code: Select all

:KillStart
/if n @EpicTimer==0 {
   /cast item "Celestial Fists"
   /varset @EpicTimer 15s
}
and then have it Loop through this code everytime

Code: Select all

:KillStart 
[color=red]/if @atk==1[/color] { 
/face fast 
   /attack $target(name,clean) 
     :kickinass 
      /if "$combat"=="TRUE" { 
      /if n $target(distance)>=15 /sendkey down up 
        /face fast 
      /if n $target(distance)>=13 /sendkey down up 
        /face fast 
      /if n $target(distance)<=10 /sendkey up up 
        /face fast 
      /if n $target(distance)<=8 /sendkey up up 
        /face fast 
The red line is your problem I guess. You never declared or set the atk var therefore that loop won't be executed. Also, the distance changes are redundant. /sendkey down up, while press down the "up" key and keep it pressed until release. Therefore one /sendkey down up and /sendkey up up are sufficient.

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

Post by Mckorr » Sat Mar 06, 2004 9:29 am

The if line in red above is also wrong because it is a numeric comparison.

/if n @atk==1 {