Handling Adds

Got a cool macro idea? Wanna request a macro? Here is the place for you!

Moderator: MacroQuest Developers

reece
decaying skeleton
decaying skeleton
Posts: 8
Joined: Tue Oct 14, 2003 9:45 am

Handling Adds

Post by reece » Tue Oct 21, 2003 12:24 pm

I have still not seen anyone find a good method of handling adds while using a hunting script. If anyone of the geniuses out here can develop a method of checking for an unlimited number of adds while fighting a mob I will be impressed (which is your reward for doing so :D )

I have done something like this before but it doesn't always work and it only checks for 1 add:

Code: Select all


| Assume myTargetID is set to the id of your current target

Sub CheckForAdds
   /declare newAddID local

   /target NPC radius 20
   /varset newAddID $target(id)
   /if n @newAddID!=@myTargetID /call slowMob @newAddID
   /target id @myTargetID
/return

reece
decaying skeleton
decaying skeleton
Posts: 8
Joined: Tue Oct 14, 2003 9:45 am

Anyone Think This Might Work

Post by reece » Tue Oct 21, 2003 4:08 pm

Does anyone think this might work:

Code: Select all


/target npc radius 20 notid @myTargetID

In order to target an add and distinguish it from my current target.

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

Post by Falco72 » Tue Oct 21, 2003 4:17 pm

I used to do that using /alert, but now it do not work anymore with the "true" name (I dont know how to call the name that is reported using $target(name) over the one that is give using $target(name,clear)), only with the cleared name. The difference is very important because before using /alert add 1 npc $target(name) you can identify all the mobs around you even if the are of the same type (an orc pawn). I have looked at the C code but at the moment I cant find the solution, the alert source is changed a lot from the version before the plaz (you are GREAT, man) change. Anyway, before the change this was the code I used:

Code: Select all

Sub SKMez
   /declare locv1 local
   /declare locv2 local   
   /if @Debug==1 /echo Status: sub SKMez
   /varset Mezzing 0
   /varset locv2 1
   /alert clear 1
   /delay 3
   /varset mezid(0,1) " "
   /varset mezid(0,2) " "
   /varset mezid(0,3) " "
   /varset mezid(0,4) " "
   /varset mezid(0,5) " "
   /varset mezid(0,6) " "
   /varset mezid(1,1) 0
   /varset mezid(1,2) 0
   /varset mezid(1,3) 0
   /varset mezid(1,4) 0
   /varset mezid(1,5) 0
   /varset mezid(1,6) 0
   /varset mezid(2,1) 0
   /varset mezid(2,2) 0
   /varset mezid(2,3) 0
   /varset mezid(2,4) 0
   /varset mezid(2,5) 0
   /varset mezid(2,6) 0
      
   /if n @myradius==0 /varset myradius 100
   /if $target(id)==$char(id) /press esc
   /if $target()==TRUE {
      /if $target(class)=="Merchant" /goto :ExitTgLoop
      /if $target(type)=="PC" /goto :ExitTgLoop
      /if $target(type)=="Corpse" /goto :ExitTgLoop
      /varset locv2 2
      /varset mezid(2,1) $target(level)
      /varset mezid(1,1) $target(id)
      /varset mezid(0,1) "$target(name,clean)"
      /alert add 1 npc "@mezid(0,1)"
      /delay 3
      :ExitTgLoop
    }
   /for locv1 @locv2 to 6
      /press esc
      /delay 3
      /if $alert(1)==FALSE {
         /if n @myzradius==0 {
            /target npc radius @myradius
         } else {
            /target npc zradius @myzradius radius @myradius
         }
      } else {
         /if n @myzradius==0 {
            /target npc noalert 1 radius @myradius
         } else {
            /target npc noalert 1 zradius @myzradius radius @myradius
         }
      }
      /delay 3
      /if @Debug==1 /echo Status: sub SKMez $target(class) $target(type) @myzradius @myradius
      /if $target()==FALSE /goto :ExitSKMez
      /if $target(class)=="Merchant" {
         /if @Debug==1 /echo Status: sub SKMez "Merchant"
         /alert add 1 npc "$target(name,clean)"
         /varcalc locv1 @locv1-1
         /goto :NextMez
      }
      /if $target(type)=="PC" {
         /if @Debug==1 /echo Status: sub SKMez "PC"
         /alert add 1 npc "$target(name,clean)"
         /varcalc locv1 @locv1-1
         /goto :NextMez
      }
      /if $target(type)=="Corpse" {
         /if @Debug==1 /echo Status: sub SKMez "Corpse"
         /alert add 1 npc "$target(name,clean)"
         /varcalc locv1 @locv1-1
         /goto :NextMez
      }
      /if n $target(hp,pct)>=1 {
         /if @Debug==1 /echo Status: sub SKMez "MOB" OK
         /varset mezid(2,@locv1) $target(level)
         /varset mezid(1,@locv1) $target(id)
         /varset mezid(0,@locv1) "$target(name,clean)"
         /alert add 1 npc "@mezid(0,@locv1)"
         /delay 3
      } else {
         /if @Debug==1 /echo Status: sub SKMez "other"
         /alert add 1 npc "$target(name,clean)"
         /varcalc locv1 @locv1-1
      }
      :NextMez
   /next locv1

   :ExitSKMez
   /if n @mezid(1,1)!=0 {
      /target id @mezid(1,1)
      /delay 3
      /attack on
   }
   /echo SKMezz with zradius @myzradius and radius @myradius
   /echo xMez "@mezid(0,1)" "@mezid(0,2)" "@mezid(0,3)" "@mezid(0,4)" "@mezid(0,5)" "@mezid(0,6)"
   /echo Level "@mezid(2,1)" "@mezid(2,2)" "@mezid(2,3)" "@mezid(2,4)" "@mezid(2,5)" "@mezid(2,6)"
   /if @Debug==1 /echo xMez @mezid(1,1) @mezid(1,2) @mezid(1,3) @mezid(1,4) @mezid(1,5) @mezid(1,6)
   /g Mezz @mezid(1,1) @mezid(1,2) @mezid(1,3) @mezid(1,4) @mezid(1,5) @mezid(1,6)
   /delay 3
/return
The echo lines are for debug purpouse.
To make it short it looks around to see if the are NPC mobs (even with the same name using $target(name)) and put then in the alert list 1. Then make a /target noalert 1 with a give radius (around and up and down with zradius) and see what it gets. If is a PC or a Merchant, it stores it in the alert and to do it again. It will stop or when reached the total of six mobs (if there are more than six a fast evacuate a good think to do) or if the $target() is false. Then it pass the ids of the mobs to my group. Easy, isnt it?
As said the problem is that after the last revamp of MQ, I cant use it any more because /alert cant find the mob using the syntax an_orc_pawn00 but only with an orc pawn. I hope to repair it, but really I need some help from a more skilled C programmer.

LordGiddion
a snow griffon
a snow griffon
Posts: 352
Joined: Sat Sep 13, 2003 6:12 pm
Contact:

Post by LordGiddion » Wed Oct 22, 2003 3:04 pm

Gonna play with this over the weekend, Gonna add a mez command to my version of genbot. What I'm looking at - in psudo code
Use assist to get the target ID of the mob I don't want to mez
use /target npc radius 100 notid @assistid to get the first mob to mez
Store ID in an array
use /target npc radius 100 notid @assistid next to cycle through the mobs
and add ID to array
Cycle through array to perform mezs

User avatar
doanchano
orc pawn
orc pawn
Posts: 27
Joined: Sun Jan 11, 2004 11:31 pm

Post by doanchano » Wed Jan 14, 2004 12:06 am

I will be doing the same thing here except i think in the array of adds i will be handling what to pull of the pet using a loop to all mobs in the array

/if n $target(hp,pct)!=100
/cast "dooming Darkness"
put in a delay
/cast "root"

switch target to the next target id in array and loop the slow and root

This is very preliminary of course and will have to incorporate recogniton of the spells sticking and if not moving to facilitate that they do.

A real simple routine to handle the adds would be to move a certain distance then

/sit

as the mobs approach

/stand

you can ping pong the adds back and forth between coming after you and going for the pet.

I actually have a lot of fun doing this with my own pet.

Thing is though once the mobs coming for you reach a certain point they continue to come and wont go back to the pet