• You've discovered RedGuides 📕 an EverQuest multi-boxing community 🛡️🧙🗡️. We want you to play several EQ characters at once, come join us and say hello! 👋
  • IS THIS SITE UGLY? Change the look. To dismiss this notice, click the X --->

Macro Problem, please help (1 Viewer)

nijhal

Member
Joined
Feb 22, 2006
RedCents
10¢
Ok I finally got cable back.

I am making alterations to the hunter macro to macro the BB MM. It is all working correctly except every once in awhile it will target a group member instead of an add. This will cause the MT to continue to try to attack the group member, thus a loop and doing nothing. Anyone wanna look at my targeting code and see if theres a way to add in an if command at targeting?

like

Rich (BB code):
/if (${Target.PCName}) /keypress esc

Anyways heres the hunter macro I hacked to pieces.

Rich (BB code):
| BB MM Macro 
| NBBMain.mac 
| Author      : robdawg 
| Edit        : Chill, Fallon
| BBMM Edit   : Nijhal 
| Version     : v1.1BB Pirate MM 04/14/2006 
| Useage      : /macro NBBMain
| Description : This macro will warp your character around killing any mobs in your 
|      RV_MobArray for the BB Pirate MM.  Then it will attempt to loot all items in your 
|      RV_LootArray.  This is definitely a work in progress and I am sure 
|      someone can think of plenty of upgrades for this. 
|
|------------------------------------------------------------------------------------ 

#turbo 10 
#Include SpellCast.inc 
#Include Swap.inc 
#Chat say
#Chat Group
#Chat Tell

#event Butcher "Butcherblock Mountains"
#event Chest "#*#The guards be on tew us!#*#"
#event Chest "Someone is already looting that corpse."
#event Wait "#*#tells the group, 'pause 1 min for rebuffs!'"
#event Reset "Try attacking someone other than#*#"
#event Wait "You have been slain#*#"
#event Backup "You cannot see your target#*#"

Sub Main 

   /echo BBMM Mainbot started
   /keypress esc
   /keypress esc
   /keypress esc
   |------------------------------------------------------------ 
   |Checks if you are in Butcherblock ZoneID 68
   |------------------------------------------------------------
   /if (${Zone.ID}==68) /call event_Butcher
   |------------------------------------------------------------ 
   |Monk stuff, Hit Point Percentages to Mend and FD at 
   |------------------------------------------------------------ 
   |------------------------------------------------------------ 
   |How many times should aquire target fail before delaying? 
   |------------------------------------------------------------ 
   /declare RV_FailMax          int outer  3 
   |------------------------------------------------------------ 
   |How far would you like to target a mob? 
   |------------------------------------------------------------ 
   /declare RV_MaxRadius        int outer  10000
   |------------------------------------------------------------ 
   |How far is the combat range? 
   |------------------------------------------------------------ 
   /declare RV_Range            int outer 10 
   |------------------------------------------------------------ 
   |What is the minimum Z Value of mobs I should target? 
   |------------------------------------------------------------ 
   /declare RV_MinZRange        int outer  -1000 
   |------------------------------------------------------------ 
   |What is the maximum Z Value of mobs I should target? 
   |------------------------------------------------------------ 
   /declare RV_MaxZRange        int outer  1000 
   |------------------------------------------------------------ 
   |Should I loot all items? 
   |------------------------------------------------------------ 
   /declare RV_LootAllItems     int outer  0 
   |------------------------------------------------------------ 
   |Should I display stats? 
   |------------------------------------------------------------ 
   /declare RV_DisplayStats     int outer  1 
   |------------------------------------------------------------ 
   |Generic Counter Variable 
   |------------------------------------------------------------ 
   /declare c int outer 0 

   |------------------------------------------------------------ 
   |Loot Array Information. 
   |------------------------------------------------------------ 
   /call ReadINI PirateMob.ini "${Zone.Name}" Mob 
   /if (!${Defined[RV_MobArray]}) { 
      /echo Mob Array Creation Error, ending macro... 
      /endmacro 
   } 

   |------------------------------------------------------------ 
   |Mob Array Information. 
   |------------------------------------------------------------ 
   /call ReadINI PirateLoot.ini "${Zone.Name}" Loot 
   /if (!${Defined[RV_LootArray]}) { 
      /echo No Loot Array Created... 
   } 

   |------------------------------------------------------------ 
   |Variables that you don't need to worry about. 
   |------------------------------------------------------------ 
   /declare RV_FailCounter      int outer  0 
   /declare RV_MyTargetID       int outer  0 
   /declare RV_MyTargetName     string outer 
   /declare RV_MyTargetDead     int outer  0 
   /declare RV_InvalidTargetID  int outer  0 
   /declare RV_HasTarget        int outer  0 
   /declare RV_RandomWait       int outer  0 
   /declare RV_LootSlot         int outer  0 
   /declare RV_CheckLook        int outer  0 
   /declare RV_Fighting         int outer  0 
   /declare RV_TargetDead       int outer  0 
   /declare RV_MyXLOC           int outer  0 
   /declare RV_MyYLOC           int outer  0 
    
   /declare RV_FastRange        int outer 
   /declare RV_RangeMax         int outer 
   /declare RV_RangeMin         int outer 
   /varcalc RV_FastRange ${RV_Range}+3 
   /varcalc RV_RangeMax ${RV_Range}+1 
   /varcalc RV_RangeMin ${RV_Range}-1 

   /fastdrop on 
   /lootn never 

   :Start 
   /doevents 
   /call BuffCheck
   /call GMCheck 
   /call GetTarget 
   /if (${Zone.ID}==68) /call event_Butcher
   /doevents

   :KillAdds
   /target ${NearestSpawn[NPC Radius 17]} 
   
   /if (${RV_HasTarget}) /call MoveToMob 
   /if (${RV_HasTarget}) /call CombatSub 
   /if (${RV_HasTarget}) /call MoveToMob 
   /if (${RV_HasTarget} && (${Defined[RV_LootArray]} || ${RV_LootAllItems})) /call LootMob 
   /if (${RV_DisplayStats}) /call DisplayStats 
   /call ResetSub 

   /if (${NearestSpawn[NPC Radius 17].ID}) /target ${NearestSpawn[NPC Radius 17]}

   /varset RV_RandomWait ${Math.Rand[5]} 
   /varcalc RV_RandomWait ${RV_RandomWait}+1 
   /echo Paranoia - Waiting ${RV_RandomWait} seconds before resuming 
   /delay ${RV_RandomWait}s 

   /if (${NearestSpawn[NPC Radius 17].ID}) /target ${NearestSpawn[NPC Radius 17]}
   /if (${Target.ID}) { 
      /echo Looks like something is attacking us, killing it... 
      /warp target
      /delay 1s 
      /keypress back
      /delay 4
      /varset RV_HasTarget 1 
      /varset RV_Fighting 1 
      /goto :KillAdds 
   } 
    
   /goto :Start 
    
/return 

|-------------------------------------------------------------------------------- 
|SUB: Aquire Target 
|-------------------------------------------------------------------------------- 
Sub GetTarget 

   /declare RV_CurrentRadius   int local 
   /declare RV_TargetSub   int local 
   :Acquire
   /doevents
   /if (${Zone.ID}==68) /call event_Butcher 
   /for RV_CurrentRadius 100 to ${RV_MaxRadius} step 100 
      /for RV_TargetSub 1 to ${RV_MobArray.Size} 
         /squelch /target radius ${RV_CurrentRadius} nopcnear notid ${RV_InvalidTargetID} npc 

"${RV_MobArray[${RV_TargetSub}]}" 
         /varset RV_MyTargetID ${Target.ID} 
         /varset RV_MyTargetDead 0 
         /if (${Target.ID}) { 
            /if (${Int[${Target.PctHPs}]}<4) { 
               /echo Mob NOT a Full Health, picking another... 
               /varset RV_InvalidTargetID ${Target.ID} 
               /call ResetSub 
               /goto :Acquire 
            } 
            /if (${Int[${Target.Z}]}<${RV_MinZRange}) { 
               /echo Mob is BELOW Min Z Range, picking another... 
               /varset RV_InvalidTargetID ${Target.ID} 
               /call ResetSub 
               /goto :Acquire 
            } 
            /if (${Int[${Target.Z}]}>${RV_MaxZRange}) { 
               /echo Mob is ABOVE Max Z Range, picking another... 
               /varset RV_InvalidTargetID ${Target.ID} 
               /call ResetSub 
               /goto :Acquire 
            } 
            /varset RV_HasTarget 1 
            /varset RV_MyTargetName ${Target.CleanName} 
            /echo Acquired ${Target.CleanName} at range ${Int[${Target.Distance}]} 
            /warp target
            /delay 1s
            /keypress back hold
            /keypress back
            /delay 1s
            /return 
         } 
      /next RV_TargetSub 
      /delay 2 
   /next RV_CurrentRadius 

   /if (!${Target.ID}) { 
      /delay 2s 
      /varcalc RV_FailCounter ${RV_FailCounter}+1 
      /echo Failed to Acquire Target in Range ${RV_MaxRadius} ${RV_FailCounter} Time(s) 
      /doevents
      /if (${RV_FailCounter}>=${RV_FailMax}) { 
         /echo Waiting for Respawns, Resetting Failure Counter... 
         /delay 30s 
         /varset RV_FailCounter 0 
      } 
      /goto :Acquire 
   } 
/return 

|-------------------------------------------------------------------------------- 
|SUB: Moving 
|-------------------------------------------------------------------------------- 
Sub MoveToMob 

   /varset RV_MyXLOC ${Int[${Me.X}]} 
   /varset RV_MyYLOC ${Int[${Me.Y}]} 
   /declare RV_DistanceTimer timer 15 
    
   /doevents 
    
   :MovementLoop 

   /if ((!${RV_Fighting})&&(!${RV_TargetDead})&&(${Target.PctHPs}<100)) { 
      /echo Mob not at full health, picking another... 
      /varset RV_InvalidTargetID ${Target.ID} 
      /varset RV_HasTarget 0 
      /call ResetSub 
      /return 
   } 

   /if (${Target.ID}) { 
      /face fast 
   } 

   /if (${Int[${Target.Distance}]}>${RV_FastRange}) { 
      /keypress forward hold 
   } 
   /if (${Int[${Target.Distance}]}<${RV_FastRange}&&${Int[${Target.Distance}]}>${RV_RangeMax}) { 
      /keypress forward 
   } 
   /if (${Int[${Target.Distance}]}<${RV_RangeMin}) { 
      /keypress back 
   } 
   /if (!${RV_DistanceTimer}) { 
      /if ((${RV_MyXLOC}==${Int[${Me.X}]})&&(${RV_MyYLOC}==${Int[${Me.Y}]})) /call HitObstacle 
      /varset RV_MyXLOC ${Int[${Me.X}]} 
      /varset RV_MyYLOC ${Int[${Me.Y}]} 
      /varset RV_DistanceTimer 15 
      /goto :Movementloop 
   } 
   /if (${Int[${Target.Distance}]}>${RV_FastRange}) /goto :MovementLoop 

/return 

|-------------------------------------------------------------------------------- 
|SUB: Combat 
|-------------------------------------------------------------------------------- 
Sub CombatSub 
   /keypress back hold
   /delay 4
   /keypress back
   /echo Attacking Mob NOW!
   /g assist me 
   /varset RV_Fighting 1 
   /varset RV_TargetDead 0 
  
   :CombatLoop 
   /doevents 
|If your a monk clap your hands... or at least click your haste gloves 
   /if (${MF_HasteGloves.Equal[${Me.Inventory[hands]}]} && !${Me.Buff["Celestial Tranquility"].Duration}) /cast item 

"${MF_HasteGloves}" 

   /attack on 
   /doevents
    
   /call MoveToMob 
   /call SpecialIT 

   /if (!${Target.ID}) { 
      /attack off 
      /keypress forward 
      /keypress back 
      
      /varset RV_TargetDead 1 
      /varset RV_Fighting 0 
      /delay 1s 
      /target radius 30 corpse 
      /delay 1s 
      /if (!${Target.ID}) { 
         /call ResetSub 
         /return 
      } 
      /face fast 
   } 
   /if (!${RV_TargetDead}) { 
      /goto :CombatLoop 
   } 
    
/return 

|-------------------------------------------------------------------------------- 
|SUB: Looting 
|-------------------------------------------------------------------------------- 
Sub LootMob 

   /declare LootSlot    int inner  0 
   /declare LootCheck   int inner  0 
   /declare LootTotal   int inner  0 
    
   /face fast 
    
   /keypress forward 
   /keypress back 
    
   /delay 2s 
   /loot 
   /delay 2s 
   /if (!${Corpse.Items}) { 
      /echo NO LOOT! Cheap Bastard! 
      /return 
   } 

   /varset LootTotal ${Corpse.Items} 
   /for LootSlot 1 to ${LootTotal} 
      /itemnotify loot${LootSlot} leftmouseup 
      /delay 1s 
      /if (${RV_LootAllItems}) { 
         /echo Keeping a ${Cursor.Name}... WOOT! 
         /autoinventory 
         /delay 1s 
      } else { 
         /for LootCheck 1 to ${RV_LootArray.Size} 
            /if (${Cursor.Name.Find[${RV_LootArray[${LootCheck}]}]}) { 
               /echo Keeping a ${Cursor.Name}... WOOT! 
               /varcalc RV_LootStats[${LootCheck}] ${RV_LootStats[${LootCheck}]}+1 
               /autoinventory 
               /delay 1s 
            } 
         /next LootCheck 
      } 
      /if (${Cursor.ID}) { 
         /echo Destroying a ${Cursor.Name}... 
         /destroy 
         /delay 1s 
      } 
   /next LootSlot 
    
   /notify LootWnd DoneButton leftmouseup 
   /delay 2 
    
/return 

|-------------------------------------------------------------------------------- 
|SUB: Reset 
|-------------------------------------------------------------------------------- 
Sub ResetSub 

   /keypress esc 
   /keypress esc 
   /keypress esc 
   /keypress esc 
    
   /varset RV_HasTarget 0 
   /varset RV_TargetDead 0 
   /varset RV_Fighting 0 
    
/return 

|-------------------------------------------------------------------------------- 
|SUB: Obstacle Avoidance 
|-------------------------------------------------------------------------------- 
Sub HitObstacle 

   /echo Obstacle hit, moving around it... 
   /warp target
    
/return 

|-------------------------------------------------------------------------------- 
|SUB: GM Check 
|-------------------------------------------------------------------------------- 
Sub GMCheck 

   /if (${Spawn[gm].ID}) { 
      /beep 
      /beep 
      /beep 
      
      /echo GM has entered the zone! 
      /echo FUCK HIM but ending the macro... 

      /keypress forward 
      /keypress back 

      /doability "Feign Death" 
      /afk 
      /endmacro 
   } 
    
/return 

|-------------------------------------------------------------------------------- 
|SUB: Reading from an INI File 
|-------------------------------------------------------------------------------- 
Sub ReadINI(FileName,SectionName,ArrayType) 

   /echo Attempting to Read Section "${SectionName}" Zone Information from ${FileName}... 
   /delay 1s 
    
   /if (${Ini[${FileName},${SectionName},-1,NO].Equal[NO]}) { 
      /echo "${SectionName}" is not a Valid Section for FILE:${FileName}, ending macro... 
      /delay 1s 
      /return 
   } 
   /declare nValues     int local  1 
   /declare nArray      int local  0 
   /declare KeySet      string local  ${Ini[${FileName},${SectionName}]} 

   :CounterLoop 
   /if (!${KeySet.Arg[${nValues},|].Length}) { 
      /varcalc nValues ${nValues}-1 
      /goto :MakeArray 
   } 
   /varcalc nValues ${nValues}+1 
   /goto :CounterLoop 

   :MakeArray 
   /if (!${nValues}) /return 
   /if (${FileName.Equal["PirateMob.ini"]}&&${nValues}>0) { 
      /echo Declaring Mob Array... 
      /declare RV_MobArray[${nValues}]   string outer 
      /declare RV_MobStats[${nValues}]   string outer 
   } 
   /if (${FileName.Equal["PirateLoot.ini"]}&&${nValues}>0) { 
      /echo Declaring Loot Array... 
      /declare RV_LootArray[${nValues}]  string outer 
      /declare RV_LootStats[${nValues}]  string outer 
   } 
   /for nArray 1 to ${nValues} 
      /if (${FileName.Equal["PirateMob.ini"]}) { 
         /varset RV_MobArray[${nArray}] ${Ini[${FileName},${SectionName},${ArrayType}${nArray}]} 
         /varset RV_MobStats[${nArray}] 0 
      } 
      /if (${FileName.Equal["PirateLoot.ini"]}) { 
         /varset RV_LootArray[${nArray}] ${Ini[${FileName},${SectionName},${ArrayType}${nArray}]} 
         /varset RV_LootStats[${nArray}] 0 
      } 
   /next nArray 
    
   /echo "${SectionName}" Zone Information Read Successfully from ${FileName}... 
   /delay 1s 
    
/return 

|-------------------------------------------------------------------------------- 
|SUB: Display Stats 
|-------------------------------------------------------------------------------- 
Sub DisplayStats 

   /declare nArray  int local 
    
   /if (${Defined[RV_LootArray]}) { 
      /for nArray 1 to ${RV_LootArray.Size} 
         /echo ${Int[${RV_LootStats[${nArray}]}]} ${RV_LootArray[${nArray}]}'s 
      /next nArray 
   } 
    
/return 
|-------------------------------------------------------------------------------- 
|SUB: Special Combat 
|-------------------------------------------------------------------------------- 
Sub SpecialIt 

   /declare TempID    int inner  0 
   /doevents
   /if ((${Target.Distance}<11)&&(${Me.AbilityReady["Taunt"]})) /doability "Taunt" 
   /if ((${Target.Distance}<11)&&(${Me.AbilityReady["Kick"]})) /doability "Kick"

/return 
|---------------------------------------------------------------------------------
|Sub: Butcher.  Moves around in butcherblock and gets task.
|---------------------------------------------------------------------------------
Sub event_Butcher
   /doevents flush
   /call RemoveTask
   :butcherr
   /delay 5s
   /target Mister
   /delay 1s
   /face fast
   /delay 1s
   /keypress forward hold
   /delay 1s ${Target.Distance}<10
   /keypress back
   /doevents
   /delay 5s
   /say interested
   /delay 5s
   /notify TaskSelectWnd TSEL_AcceptButton leftmouseup
   /delay 5s
   /notify TaskTemplateSelectWnd TaskTemplateSelectListOptional listselect 3
   /delay 3s
   /notify TaskTemplateSelectWnd TaskTemplateSelectAcceptButton leftmouseup
   /delay 3s
   
   /doevents
   /keypress esc
   /keypress esc
   /keypress esc
   /target Mister
   /delay 3s
   /say Board
   /delay 10s
   /say board
   /delay 1m
   /keypress V
   /delay 1s 
   /notify AAWindow AAW_LoadButton leftmouseup
   /delay 3s
   /keypress V
   /delay 2m
   /delay 30s
   /mac NBBMain
   
   /return

|-----------------------------------------------------------------------------------
|Sub RemoveTask Removes group members from previous task.
|-----------------------------------------------------------------------------------
Sub RemoveTask
   :removetask
   /keypress F2
   /delay 1s
   /taskremove
   /delay 1s
   /keypress F3
   /delay 1s
   /taskremove
   /delay 1s
   /keypress F4
   /delay 1s
   /taskremove
   /delay 1s
   /keypress F5
   /delay 1s
   /taskremove
   /delay 1s
   /keypress F6
   /delay 1s
   /taskremove
   /delay 1s
   /keypress F1
   /delay 1s
   /taskremove
   /return

|------------------------------------------------------------------------------------
|Sub Chest : Warps to docks, loots chest and tells others to do the same.
|------------------------------------------------------------------------------------
Sub event_Chest
   /delay 1s
   /warp loc -13, -1036, -53
   /delay 2s
   /targ race chest
   /delay 2s
   /open
   /delay 2s
   /target corpse
   /delay 2s
   /loot
   /delay 3s
   /itemnotify loot2 rightmouseup
   /delay 3s
   /notify LootWnd DoneButton leftmouseup
   /cleanup
   /delay 2s
   /g loot the shard ya animals
   /delay 1s
   /target mister
   /delay 1s
   /warp target
   /delay 2m
   /say cast off
   /delay 2m
   /delay 1s
   /if (${Zone.ID}==68) /mac NBBMain
   /return

|-------------------------------------------------------------------------------
|Enchanter tells Main wait for rebuffs
|-------------------------------------------------------------------------------
Sub event_Wait
   /delay 1m
/return

|-----------------------------------------
|Sub Reset
|-----------------------------------------
Sub event_Reset
  /mac NBBMain
/return

Sub BuffCheck 

  /if (${Me.Buff["Swift like the wind"].Duration} !> ${MF_BuffTicks}) { 
    /g I need buffs
    /echo Casting Haste
  /delay 60s
  }
/return

Sub event_Wait
/delay 1m
/delay 30s
/mac nbbmain

Sub event_Backup
/keypress back
/return

Hope someone can help.

N
 
Macro Problem, please help

Users who are viewing this thread

Back
Top