chant.mac

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

Moderator: MacroQuest Developers

wizzyman
a ghoul
a ghoul
Posts: 106
Joined: Fri Dec 10, 2004 6:03 pm

chant.mac

Post by wizzyman » Tue Dec 21, 2004 11:59 pm

first one is for area where u got DB mob mainly and want to kite in a safe area; this mac ll pull closest DB mob not on avoid list and bring it back where u started mac, it ll then follow mob once he run.

Code: Select all


| - chant.mac - By Raebis 
|   - Mob avoidance added by ml2517 
|   - MQ2Parmatized by dkaa 
|   - MQ2Datatized by dkaa 
|   - Obstacle avoidance by dkaa 
| 
| Version: REV5c(w/ avoidance mod) Jan 10 4:30pm 
| 
| Features:------------------------------------------------------------------------ 
| 
| * Automatically selects high light blue, dark blue, or white mob 
| * Runs to mob before targeting it (Stealth! No cross-zone targeting!) 
| * Aggro/Add Detection: Automatically targets and kites aggroed mobs (adds) 
| * Ignores greens and low light blues unless they are aggroed (adds) 
| * Caster Detection: Automatically will switch target to aggroed casting mobs 
| * Compatible with level 49 and level 6 selos 
| * Auto Healing: If health gets low, it will automatically heal 
| * Fleeing Mob Catcher: If mob runs away, macro keeps you in range! 
| * Detects WMS (Warping Mob Syndrom) and gets a new target if a mob warps away! 
| * NEW: Rubber Anchor: kites mobs closest to macro starting point - no wandering! 
| * NEW: Mob avoidance by name.  Add/Remove from the list on the fly. (See the description of use below) 
| * NEW: Script pausing upon startup or during the script. (See the description of use below) 
| --------------------------------------------------------------------------------- 
| 
| usage: chant.mac <DOTs/LVL6 Selos> <49selo> <use ornate legs 1 else 0> <radius> [<heal song>] [<pause on 

startup>] 
| if u gonna use ornate legs selo clicky, u ll need to mem selo anyway and define selo gem correctly, for 

mac to check duration of buff.
| 
| Usage Examples: 
|  -Scenario 1: If you are using... 
|   ...DOTs in Gems 4, 5, 6, and 7 
|   ...Level 49 Selo in gem 2
|   ...Pas d'Ornate Legs Selo 
|   ...Radius of 55 
|   ...Hymn of Restoration in gem 1 
|   ...If you wanted the script to start paused 
|   syntax: /mac chant 4567 2 0 55 1 1 
| 
|  -Scenario 2: If you are using... 
|   ...DOTs in Gems 6 and 7 
|   ...Level 6 Selo in gem 3
|   ...Pas d'Ornate Legs Selo
|   ...Radius of 80 
|   ...Hymn of Restoration in gem 8 
|   ...If you want the script to start un-paused 
|   syntax: /mac chant 673 0 0 80 8 0 
|   
|  -Scenario 3: if u are using...
|   ...DOTS in Gems 3456
|   ...Level 49 Selo in Gem 7
|   ...Ornate Legs Selo
|   ...Radius of 70
|   ...Cantana of Replenishment in gem 1
|   ...If you want the script to start un-paused 
|   syntax: /mac chant 3456 7 1 70 1 0 
| 
| If <heal song> is defined then when health goes below ${Health}Min (default is 70%) 
| it will replace the first song in <DOTs> with <heal song> until health is above 
| ${Health}Max (default is 85%) 
| 
| If <pause on startup> is a 1 the script will pause upon startup so that you can add mobs to your avoid 

list. 
| If <pause on startup> is a 0 the script will start immediately and go hunting. 
| If you don't define <pause on startup> it assumes you want to immediately start hunting. 
| 
| If <selo> is 0 then the macro will not try to cast selos every 150 seconds 
| 
| Note about the rubber anchor: 
|   The macro will target the mob closest to the RubberAnchor (your /loc when first 
|   starting the macro) 
| 
| REV5b was Tested in EW for bout an hour 
| 
| Warning: You may wander from your starting point but after killing a mob, the 
|          next mob that the macro targets will be closest to your starting point
| you will need to mem a snare song to avoid runners if any 
| 
| Note: Rev information moved to the top 
| 
| ----------------------------------------------------------------------------------- 
| 
| New Commands: 
| ------------- 
| /avoidadd mobname 
| /avoidrem mobname 
| /pause 
| 
| Examples: 
| --------- 
| /avoidadd A Large Trout 
| /avoidrem A Large Trout 
| /pause 
| 
| When adding mobs to the avoidance list initially you can use the /echo pause command. 
| This will pause the script but still allow you to target and add/remove the mobs you'd 
| like to avoid/not avoid.  You can also pause the script upon startup by using the pause parameter. 
| 
| The best way to use the avoid add command is to use a hotkey with this: 
|   /avoidadd ${Target.CleanName} 
| 
| The best way to use the avoid remove command is to use a hotkey with this: 
|   /avoidrem ${Target.CleanName} 
| 
| Then you simply run around the zone targeting mobs that you know you'd like to avoid and add/remove them 
| to your avoidance list.  The list is written to an INI file so you won't have to add them to the list 
| the next time you play. 
| 

#event NeedTarget "#*#You must first select a target for this spell!#*#" 
#event Exp        "#*#You gain #*#" 
#event Died       "#*#You have entered#*#" 
#event Caster     "#*# begins to cast a spell.#*#" 
#event Tell       "#*#tells you#*#"
#event Snared     "#*#is surrounded by chains of music#*#" 
|#event dead       "You have been slain by#*#"

#turbo 10 

Sub Main(string DOTs,string Selos,string OrnateLegs,int CRadius,string Health,int Paused) 

   /if (!${Defined[CRadius]}) { 
      /echo usage: chant.mac <DOTs, LVL6 Selos> <49selo> <use ornate legs 1 else 0> <radius> [<heal song>] 
      /return 
   }

   /if (${OrnateLegs}!=0 && ${OrnateLegs}!=1) { 
      /echo usage: chant.mac <DOTs, LVL6 Selos> <49selo> <use ornate legs 1 else 0> <radius> [<heal song>] 
      /return
   } 

   /declare PauseFlag int outer 

   /if (${Defined[Paused]}) { 
       /if (${Paused}) { 
           /varset PauseFlag 1 
       } else { 
           /varset PauseFlag 0 
       } 
   } else { 
       /varset PauseFlag 0 
   } 

   /declare avoidadd string outer 
   /declare avoidrem string outer 
   

   /alias /pause /varcalc PauseFlag !${PauseFlag} 
   /alias /avoidadd /varset avoidadd 
   /alias /avoidrem /varset avoidrem 

   /declare CirR outer 

   /declare Songs[10] int outer 
   /declare nSongs int outer 
   /declare PrevSong int outer 
   /declare CurSong int outer
   /declare Exper int outer 
   /declare AAExp int outer 

   /declare SongTimer timer outer 
   /declare SeloSong int outer 

   /declare HealSong int outer 
   /declare OrigSong int outer 

   /declare HealthMin outer 
   /declare HealthMax outer 
   
   /declare DBLevel outer
   /declare Runner outer
   /declare Snaring outer
   /declare Snared outer
         
   /declare TargetUpNext int outer 
   /declare DE  outer
   /declare DE2  outer
   /declare Holding  outer
   /declare RubberX int outer 
   /declare RubberY int outer
   /declare RunnerCount int outer
   /declare OL int outer 

   /declare AvoidList[50] string outer UNDEFINED-ARRAY-ELEMENT 

   /declare MyXLOC float outer 
   /declare MyYLOC float outer 

   /declare ObstCount int outer 
   /declare EachSong int local 

   /call AvoidINILoad 

   /varset PrevSong 0 
   /varset MyXLOC 0.0 
   /varset MyYLOC 0.0 
   /varset Holding FALSE
   /varset Runner FALSE
   /varset Snared FALSE
   /varset Snaring FALSE
   /varset OL 0
   
   /varset nSongs ${DOTs.Length} 
   /echo nSongs ${nSongs} 
   /echo DOTs ${DOTs} 
   /for EachSong 1 to ${nSongs} 
      /varset Songs[${EachSong}] ${DOTs.Mid[${EachSong},1]} 
      /echo Song ${EachSong}: ${Me.Gem[${Songs[${EachSong}]}].Name} 
   /next EachSong 
   
   /if (${Selos}!=0) { 
      /varset SeloSong ${Selos} 
      /echo Selo's: Selo`s Accelerating Chorus 
   } else { 
      /varset SeloSong 0 
      /echo Not using level 49 Selos. 
   } 
   
   /if (${Selos}==0) /if (${OrnateLegs}==1) {
      /echo So u want to use ornate legs but not lvl 49 selo? /bonk
      /echo Read tutorial...
      /endmacro

   }

   /if (${Selos}!=0) /if (${OrnateLegs}==1) { 
      /varset OL 1
      /echo Selo's: Using Composers Greaves 
   } else { 
      /varset OL 0
       
   } 

   /if (!${Defined[Health]}) { 
      /echo No HealSong. Please watch your health. 
      /varset HealSong 0 
   } else /if (${Health}!=0) { 
      /varset HealSong ${Health} 
      /echo Healsong: ${Me.Gem[${HealSong}].Name} 
   } else { 
      /echo No HealSong. Please watch your health. 
      /varset HealSong 0 
   } 

   /varset CirR ${CRadius} 
   /echo Radius: ${CirR} 

   /varset OrigSong ${Songs[1]} 
   /varset CurSong 1 
   /varset Exper ${Me.Exp} 
   /varset AAExp ${Me.AAExp} 
   /varset SongTimer 1 

   | here is where u setup the mini lvl of mob u wish to look for, in lower lvl zone u might want to setup 

this lvl lower (need to kill ph light blue or so) then use the non calc varset
   |/varset DBLevel ${Math.Calc[${Me.Level}*.75]} 
   /varset DBLevel 36 

   | those are value of when u wish to start and stop heal song
   /varset HealthMin 70 
   /varset HealthMax 95 

   /varset TargetUpNext 0    
  
   /varset RubberX ${Me.X} 
   /varset RubberY ${Me.Y} 

   /echo Rubber Anchor dropped at ${RubberX},${RubberY} 

   /if (${PauseFlag}==1) { 
       /echo Script [PAUSED] issue an "/pause" to unpause it. 
   } 

:Loop 
    
    /if (${Bool[${Me.Buff["Grasping Roots"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Root"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Entrapping Roots"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Engorging Roots"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Earthen Roots"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Engulfing Roots"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Ensnaring Roots"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Enveloping Roots"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Fetter"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Greater Fetter"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Immobilize"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Greater Immobilize"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Instill"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Paralyzing Earth"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Savage Roots"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Shackles of Tunare"]}]}==TRUE) /call Root
    
| this is for DE illusion mask if u wish to turn this off then change it to:
|  "/varset DE TRUE
|   |/if (${Bool[${Me.Buff["Illusion: Dark Elf"]}]}==FALSE) {
|   |   /varset DE FALSE
|   |   /call DE
|   |} else {
|   |   /varset DE TRUE
|   |}"

    |/varset DE TRUE
    /if (${Bool[${Me.Buff["Illusion: Dark Elf"]}]}==FALSE) {
       /varset DE FALSE
       /call DE
    } else {
       /varset DE TRUE
    }
    /if (${Bool[${Me.Buff["Illusion: Dark Elf"]}]}==TRUE) /varset DE2 FALSE
    /if (${Cursor.ID}) /autoi

    /if (${Me.AbilityReady[Forage]}) { 
      /doability forage
      /autoi
    }

    /if (${avoidadd.Length}) { 
        /echo ${avoidadd.Length} for ${avoidadd} 
        /call AvoidINIAdd "${avoidadd}" 
        /varset avoidadd 
    } 

    /if (${avoidrem.Length}) { 
        /echo ${avoidrem.Length} for ${avoidrem} 
        /call AvoidINIRemove "${avoidrem}" 
        /varset avoidrem 
    } 

    /if (${PauseFlag}==1) { 
        /delay 1 
        /doevents AddAvoid 
        /doevents RemoveAvoid 
        /goto :Loop 
    } 

   /if (${TargetUpNext}<=0) /if (!${Target.ID}) { 
      /call GetTarget 
      |/delay 2 
   } 

   /if (${TargetUpNext}>0) /if (${Target.ID}) { 
      /echo User Selected Target or Aggroed while running 
      /varset TargetUpNext 0 
   } 

   /if (${Target.Distance}>1000) /if (${Target.PctHPs}<=98) { 
      /echo Target Warped... Getting a new target; id was ${Target.ID} 
      /cleanup
      /varset Holding FALSE
      /varset Runner FALSE 
      /call GetTarget 
      /delay 2 
   } 
   
   /if (${HealSong}) /if (${Me.PctHPs}<${HealthMin} && !${Snaring}) { 
      /if (${Songs[1]}!=${HealSong}) { 
         /echo Healing On - Health: ${Me.PctHPs}% to ${HealthMax}% 
         /varset Songs[1] ${HealSong} 
      } 
   } 

   /if (${HealSong}) /if (${Me.PctHPs}>=${HealthMax} && !${Snaring}) { 
      /if (${Songs[1]}!=${OrigSong}) { 
         /echo Healing Off 
         /varset Songs[1] ${OrigSong} 
      } 
   }
| here is check if snare needed, where is 2 should be the number of your snare gem.  
   /if (${Target.PctHPs}<20 && ${Target.Speed}<160 && (${Target.ID}!=0))  { 
         /echo Snaring on 
         /varset Songs[1] 2
         /varset Snaring TRUE 
   } else {
         /Varset Snaring FALSE
         /if (${Songs[1]}!=${HealSong}) /varset Songs[1] ${OrigSong}
         }
         

   |/delay 2 
   /if (${SeloSong}) /if (!${Me.Casting.ID}) /if (!${Me.Buff[$Me.Gem[${SeloSong}].Name].Duration}) /varset 

SongTimer 1 
   /if (${SongTimer}>0) /if (!${Me.Casting.ID}) /call SongFailed 
   /call Circ 
   /delay 1 
   /doevents 
   |/delay 1 
   /goto :Loop 
/return 

Sub Event_Timer(string TimerName) 
   /if (${String[${TimerName}].Equal[SongTimer]}) { 
      | ${Me.Buff[${Me.Gem[4]}].ID} 
      /if (${SeloSong}) /if (${Bool[${Me.Buff["Selo`s Accelerating Chorus"]}]}==FALSE && ${DE}) {
         /echo Selos not up!!! 
         /if (${OL}== 1) {
            /stopsong
            /nomod /itemnotify 18 rightmouseup
            /varset PrevSong 0 
            /varset SongTimer 9 
            /call Circ 
            /doevents 
            /return
         } else {
            /stopsong 
            /cast ${SeloSong} 
            /varset PrevSong 0 
            /varset SongTimer 30 
            /call Circ 
            /doevents 
            /return
         }
      }
   } 

      | ${Me.Buff[${Me.Gem[4].Name}].Duration}<=6) { 
      /if (${SeloSong}) /if (${Me.Buff[${Me.Gem[${SeloSong}].Name}].Duration}<=6 && ${DE}) { 
         /echo Selos about to die 
         /if (${OL}== 1) {
            /stopsong
            /nomod /itemnotify 18 rightmouseup 
            /varset PrevSong 0 
            /varset SongTimer 9 
            /call Circ 
            /doevents 
            /return
         } else {
            /stopsong 
            /cast ${SeloSong} 
            /varset PrevSong 0 
            /varset SongTimer 30 
            /call Circ 
            /doevents 
            /return
         } 
      }

      /delay 2 
      /if (${DE}) {
         /stopsong 
         /echo ${CurSong} casting ${Songs[${CurSong}]} 
         /cast ${Songs[${CurSong}]} 
         /varset PrevSong ${CurSong} 
         /varcalc CurSong ${CurSong}+1 
         /if (${CurSong}>${nSongs}) /varset CurSong 1 
         /varset SongTimer 30 
         /call Circ 
         /doevents
      } 
   }

 
/return 

Sub Circ

   /if (!${Target.ID}) /goto :notarget
   /if (${Target.PctHPs}< 20 && ${Target.Speed} < 160) /goto :runner
   /if (${Target.PctHPs}< 100) {
      /declare CirX local 
      /declare CirY local 

      /call CheckObst

:Holding_loop
      /if (${Target.Distance}> 250 && ${Me.PctHPs}> 50 && ${Target.PctHPs}> 20) {
         /echo Slowing some...
         /if (${Me.Moving}) /keypress up
         /varset Holding TRUE
         /goto :Holding_loop 
      } else {
         /varset Holding FALSE
         /if (!${Me.Moving}) /keypress num_lock
             }
      /if (${Target.ID}) { 
      /varset CirX ${RubberY} 
      /varset CirY ${RubberX} 
      } else { 

             /if (${TargetUpNext}!=0) { 

                /varset CirX ${RubberY} 
                /varset CirY ${RubberX} 

                /if (${Spawn[ID ${TargetUpNext}].Distance}<=${Math.Calc[${CirR}*2]}) { 
                   /if (${Target.ID}) { 
                      /if (${Target.ID}!=${TargetUpNext}) { 
                         /target id ${TargetUpNext} 
                      } 
                   } else { 
                    /target id ${TargetUpNext} 
                          } 
                /varset TargetUpNext 0 
                } 
             }  
      } 

      /if (${Math.Distance[${CirX},${CirY}]}<${Math.Calc[${CirR}/2]}) { 
         /face heading ${Math.Calc[${Heading[${CirX},${CirY}].DegreesCCW}+180]} 
   } else { 
         /face heading 

${Math.Calc[${Heading[${CirX},${CirY}].DegreesCCW}+${Math.Calc[90*${CirR}/${Math.Distance[${CirX},${CirY}]}]

}]} 
          } 
   /return

   } else {

      /declare CirX local 
      /declare CirY local 

      /call CheckObst 

      /if (${Target.ID}) { 
         /varset CirX ${Target.Y} 
         /varset CirY ${Target.X} 
      } else { 

           /if (${TargetUpNext}!=0) { 

              /varset CirX ${Spawn[ID ${TargetUpNext}].Y} 
              /varset CirY ${Spawn[ID ${TargetUpNext}].X} 

              /if (${Spawn[ID ${TargetUpNext}].Distance}<=${Math.Calc[${CirR}*2]}) { 
                 /if (${Target.ID}) { 
                    /if (${Target.ID}!=${TargetUpNext}) { 
                       /target id ${TargetUpNext} 
                       } 
                  } else { 
                    /target id ${TargetUpNext} 
                         } 
               /varset TargetUpNext 0 
               } 
            } 
      } 

   /if (${Math.Distance[${CirX},${CirY}]}<${Math.Calc[${CirR}/2]}) { 
      /face heading ${Math.Calc[${Heading[${CirX},${CirY}].DegreesCCW}+180]} 
   } else { 
      /face heading 

${Math.Calc[${Heading[${CirX},${CirY}].DegreesCCW}+${Math.Calc[90*${CirR}/${Math.Distance[${CirX},${CirY}]}]

}]} 
          } 
/return

:notarget

   /declare CirX local 
   /declare CirY local 

   /call CheckObst 

   /if (${Target.ID}) { 
      /varset CirX ${Target.Y} 
      /varset CirY ${Target.X} 
   } else { 

        /if (${TargetUpNext}!=0) { 

            /varset CirX ${Spawn[ID ${TargetUpNext}].Y} 
            /varset CirY ${Spawn[ID ${TargetUpNext}].X} 

            /if (${Spawn[ID ${TargetUpNext}].Distance}<=${Math.Calc[${CirR}*2]}) { 
                /if (${Target.ID}) { 
                    /if (${Target.ID}!=${TargetUpNext}) { 
                        /target id ${TargetUpNext} 
                    } 
                } else { 
                    /target id ${TargetUpNext} 
                } 
                /varset TargetUpNext 0 
            } 
        } 
   } 

   /if (${Math.Distance[${CirX},${CirY}]}<${Math.Calc[${CirR}/2]}) { 
      /face heading ${Math.Calc[${Heading[${CirX},${CirY}].DegreesCCW}+180]} 
   } else { 
      /face heading 

${Math.Calc[${Heading[${CirX},${CirY}].DegreesCCW}+${Math.Calc[90*${CirR}/${Math.Distance[${CirX},${CirY}]}]

}]} 
   } 
/return

:runner
   
   /varset Runner TRUE
   /declare CirX local 
   /declare CirY local 

   /call CheckObst 

   /if (${Target.ID}) { 
      /varset CirX ${Target.Y} 
      /varset CirY ${Target.X} 
   } else { 

        /if (${TargetUpNext}!=0) { 

            /varset CirX ${Spawn[ID ${TargetUpNext}].Y} 
            /varset CirY ${Spawn[ID ${TargetUpNext}].X} 

            /if (${Spawn[ID ${TargetUpNext}].Distance}<=${Math.Calc[${CirR}*2]}) { 
                /if (${Target.ID}) { 
                    /if (${Target.ID}!=${TargetUpNext}) { 
                        /target id ${TargetUpNext} 
                    } 
                } else { 
                    /target id ${TargetUpNext} 
                } 
                /varset TargetUpNext 0 
            } 
        } 
   } 

   /if (${Math.Distance[${CirX},${CirY}]}<${Math.Calc[${CirR}/2]}) { 
      /face heading ${Math.Calc[${Heading[${CirX},${CirY}].DegreesCCW}+180]} 
   } else { 
      /face heading 

${Math.Calc[${Heading[${CirX},${CirY}].DegreesCCW}+${Math.Calc[90*${CirR}/${Math.Distance[${CirX},${CirY}]}]

}]} 
   } 
/return

sub DE

| here is the sub of DE mask, u ll need to change number 25 to what slot number is your at (25 is for slot 9 

of main inventory)

/delay 2

   /if (!${DE2}) {
      /stopsong 
      /echo casting Illusion Dark Elf, since you re so blind...
      /nomod /itemnotify 25 rightmouseup 
      /call Circ
      /delay 1
      /doevents
      /varset DE2 TRUE
   } 
   
/return           
     

Sub SongFailed 
   /if (!${PrevSong}) { 
      /varset SongTimer 1 
      /return 
   } 
   /varset CurSong ${PrevSong} 
   /varset SongTimer 1 
/return 

Sub Event_NeedTarget 
   /if (${TargetUpNext}<=0) /call GetTarget 
/return 

Sub Event_Died 
   /delay 10 
   /sit 
   /delay 10 
   /camp desktop 
/return 

Sub Event_Dead 
   /endmacro

/return 

Sub Event_Exp 
   /varset AAExp ${Math.Calc[${Me.AAExp}-${AAExp}]} 
   /varset Exper ${Math.Calc[${Me.Exp}-${Exper}]} 

   /echo EXP: ${Exper}:${Me.PctExp}% - AAXP: ${AAExp}:${Me.AAExp}% - ${Math.Calc[${Macro.RunTime}/60]} 

minutes 

   /varset Exper ${Me.Exp} 
   /varset AAExp ${Me.AAExp} 

   /if (${TargetUpNext}==0) /if (${Target.ID}==0) /call GetTarget 
/return 

Sub GetTarget 
   /declare LastMobID int local 0 
   /declare FirstMobID int local 0 
   /declare MobID int local 0 
   /declare SRadius int local
   /varset Runner FALSE
   /varset Snaring FALSE
   
   


   /varset MobID ${Spawn[npc radius ${Math.Calc[${CirR}*4]}].ID} 
   /varset FirstMobID ${MobID} 
   /echo MobID ${MobID} 

   :CheckAggrodMobs 
   /if (${MobID}!=0) { 
       /if (${Spawn[ID ${MobID}].Speed}>180) { 
          /call AvoidTargets ${MobID} 
          /if (${Macro.Return}==1) { 
             /target id ${MobID} 
             /echo Kiting aggro'd mob: ${Target.CleanName} 
             /return 
          } 
       } 
       /varset LastMobID ${MobID} 
       /varset MobID ${Spawn[npc id ${LastMobID} radius ${Math.Calc[${CirR}*2]} next].ID} 
       /if (${FirstMobID}==${MobID}) { 
           /goto :NoAggrodMobs 
       } 
       /goto :CheckAggrodMobs 
       :NoAggrodMobs 
   } 
   /echo no aggro'd mobs found 

   /varset MobID 0 
   /varset FirstMobID 0 
   /varset LastMobID 0 
   /alert clear 1 
   | a clear alert and noalert don't mix
   /alert add 1 npc this_is_bogus 
   /for SRadius 100 to 10000 step 100 
      /if (${MobID}==0) { 
          /varset MobID ${Spawn[noalert 1 npc range ${DBLevel} ${Me.Level} loc ${RubberX} ${RubberY} radius 

${SRadius}].ID} 
          /varset FirstMobID ${MobID} 
      } else { 
          /varset LastMobID ${MobID} 
          /varset MobID ${Spawn[noalert 1 npc range ${DBLevel} ${Me.Level} loc ${RubberX} ${RubberY} radius 

${SRadius}].ID} 
          /if (${FirstMobID}==${MobID}) { 
              /next SRadius 
          } 
      } 
      /if (${MobID}!=0) { 
         /call AvoidTargets ${MobID} 
         /if (${Macro.Return}==1) { 
            /echo not avoiding ${Spawn[ID ${MobID}].CleanName} 
            /goto :Done 
         } else { 
            /alert add 1 npc ${Spawn[ID ${MobID}].CleanName} 
        } 
      } 
   /next SRadius 

   /varset MobID ${Spawn[npc]} 
   /echo No mobs found, action required! 
   /beep 
   /beep 
   /beep 
   /beep 
:Done 
   /varset TargetUpNext ${MobID} 
   /echo Next: ${Spawn[ID ${MobID}].Level} ${Spawn[ID ${MobID}].CleanName} - Distance: ${Spawn[ID 

${MobID}].Distance} 
/return 



|############################################################################# 


Sub AvoidTargets(int TempMobID) 
    /declare Element int local 1 

:AvoidCheckLoop 

    /if (${Ini[AvoidList.ini,Avoid,${Element}].Equal[NULL]}) { 
        /varcalc Element ${Element}+1
    } 

    /if (${Ini[AvoidList.ini,Avoid,${Element}].Equal[${Spawn[ID ${TempMobID}].CleanName}]}) { 
        /echo AVOIDING ${Ini[AvoidList.ini,Avoid,${Element}]} 
        /return 0
         
    } 
    /varcalc Element ${Element}+1
    /if (${Element} < 11) /goto :AvoidCheckLoop
 
/return 1 


|############################################################################# 


Sub AvoidINIRemove(string RemoveName) 
/declare TempElements local 0 
/declare TempVar int local 0 
/declare TempItem string local 

:RemCheckLoop 
    /varset TempItem ${Ini[AvoidList.ini,Avoid,${TempVar},NOTFOUND]} 
    /if (${TempItem.Equal[NULL]}) { 
        | no file 
        /goto :RemFoundInArray 
    } 
    /if (${TempItem.Equal[NOTFOUND]}) { 
        /echo ${RemoveName} not in AvoidList.ini 
        /goto :RemFoundInArray 
    } 

    /if (${RemoveName.Equal[${TempItem}]}) { 
        /varset AvoidList[${Math.Calc[${TempVar}+1]}] Empty 
        /echo ${RemoveName} removed from AvoidList.ini 
        /ini AvoidList.ini Avoid ${TempVar} Empty 
    :VerifyRemoval 
        /if (!${Ini[AvoidList.ini,Avoid,${TempVar},NOTFOUND].Equal[Empty]}) { 
            /echo verify removal unsuccessful 
            /goto :VerifyRemoval 
        } 
        /goto :RemFoundInArray 
    } 
    /varcalc TempVar ${TempVar}+1 
    /goto :RemCheckLoop 
:RemFoundInArray 
/return 


|############################################################################# 


Sub AvoidINIAdd(string AddName) 
/declare TempElements int local 0 
/declare TempVar int local 1 
/declare TempItem string local 

/echo AvoidINIAdd ${AddName} 

:AddCheckLoop 
    /varset TempItem ${Ini[AvoidList.ini,Avoid,${TempVar},NOTFOUND]} 

    /if (${TempItem.Equal[NULL]}) { 
        | no file 
        /goto :FoundInArray 
    } 

    /if (${TempItem.Equal[NOTFOUND]}) { 
        /varset AvoidList[${Math.Calc[${TempVar}+1]}] ${AddName} 
        /goto :AddItem 
    } 

    /if (${TempItem.Equal[${AddName}]}) { 
        /echo ${AddName} already in AvoidList.ini 
        /goto :FoundInArray 
    } 

    /if (${TempItem.Equal[Empty]}) { 
        /varset AvoidList[${Math.Calc[${TempVar}+1]}] ${AddName} 
        /goto :AddItem 
    } 

    /varcalc TempVar ${TempVar}+1 
    /goto :AddCheckLoop 

:AddItem 

    /ini AvoidList.ini Avoid ${TempVar} "${AddName}" 

:VerifyAdd 
    /if (!${Ini[AvoidList.ini,Avoid,${TempVar},NOTFOUND].Equal[${AddName}]}) { 
        /echo verify addition unsuccessful 
        /goto :VerifyAdd 
    } 

/echo ${AddName} added to AvoidList.ini 

:FoundInArray 
/return 


|############################################################################# 


Sub AvoidINILoad 
/declare TempItem string local 
/declare AvoidItemNum int local 0 

:LoadAvoidLoop 

    /varset TempItem ${Ini[AvoidList.ini,Avoid,${AvoidItemNum},NOTFOUND]} 
    /if (${TempItem.Equal[NULL]}) { 
        /goto :DoneLoading 
    } 
    /if (${TempItem.Equal[NOTFOUND]}) { 
        /goto :DoneLoading 
    } 
    | note: indexing starts at 1 not 0 
    /echo adding ${TempItem} to avoid list at ${Math.Calc[${AvoidItemNum}+1].Int} 
    /varset AvoidList[${Math.Calc[${AvoidItemNum}+1]}] ${TempItem} 
    /varcalc AvoidItemNum ${AvoidItemNum}+1 
    /goto :LoadAvoidLoop 
:DoneLoading 
/return 


|############################################################################# 

Sud Event_Snared

/declare Snared TRUE

/return

Sub Event_AddAvoid(string EvtText) 
/if (${EvtText.Mid[6,10].Equal[avoid add ]}) { 
    /call AvoidINIAdd "${EvtText.Mid[16,${Math.Calc[${EvtText.Length}-16]}]}" 
} 
/return 

Sub Event_RemoveAvoid(EvtText) 
/if (${EvtText.Mid[6,13].Equal[avoid remove ]}) { 
    /call AvoidINIRemove "${EvtText.Mid[19,${Math.Calc[${EvtText.Length}-19]}]}" 
} 
/return 

Sub Event_Caster(string CastText) 
   /declare CasterID int local 
   /varset CasterID ${Spawn[${CastText.Left[${Math.Calc[${String[${CastText}].Length}-24]}]}].ID} 
   /if (!${Spawn[ID ${CasterID}].Type.Equal[NPC]}) /return 
   /if (${Target.ID}==${CasterID}) /return 
   /if (${Spawn[ID ${CasterID}].Distance}<=${Math.Calc[${CirR}*2]}) { 
      /target id ${CasterID} 
      /echo Targeting Caster: ${Target.CleanName} 
   } 
/return 

Sub Event_Tell 
   /beep 
   /mp3 play 
/return 

sub CheckObst 
    /if (${MyXLOC}==${Me.X} && ${MyYLOC}==${Me.Y} && !${Holding}) { 
        /echo STUCK!!! 
        /call HitObst 1 
    } 
    /varset MyXLOC ${Me.X} 
    /varset MyYLOC ${Me.Y} 
/return 

sub HitObst 
   /keypress up 
   /keypress down hold 
   /if (${Math.Rand[99]}>50) { 

       
      /keypress Right hold
      /delay 10 
      /delay ${Param0} 
      /keypress Right 
   } else { 
      
      /keypress Left hold
      /delay 10 
      /delay ${Param0} 
      /keypress Left 
   } 
   /keypress down 
   /keypress Right 
   /keypress Left 
   /keypress up 
   /keypress num_lock
   /delay 1s
 
/return 

sub Root

| here is what u ll sing if u get rooted, u can replace the song by anything u think is best in such 

occasion (AE slow, heal etc) fear may not be the best choice in some zones.

:root
   
   /stopsong
   /cast "Angstlich`s Appalling Screech" gem8 3s
   /delay 3s
      
   /if (${Bool[${Me.Buff["Grasping Roots"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Root"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Entrapping Roots"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Engorging Roots"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Earthen Roots"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Engulfing Roots"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Ensnaring Roots"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Enveloping Roots"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Fetter"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Greater Fetter"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Immobilize"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Greater Immobilize"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Instill"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Paralyzing Earth"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Savage Roots"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Shackles of Tunare"]}]}==TRUE) /goto :root

 
/return


25/12/04 added ornate legs routine and snare duty for runners
Last edited by wizzyman on Sat Dec 25, 2004 5:22 pm, edited 13 times in total.

insanitywiz
a hill giant
a hill giant
Posts: 250
Joined: Mon Jul 08, 2002 7:50 am

Post by insanitywiz » Wed Dec 22, 2004 12:35 pm

Just a suggestion, but when someone posts a mac on the VIP forums it's considered bad form to make minor edits and post it on the general macro depot.

SwiftyMUSE
Developer
Developer
Posts: 1205
Joined: Tue Sep 23, 2003 10:52 pm

Post by SwiftyMUSE » Wed Dec 22, 2004 1:06 pm

insanitywiz wrote:Just a suggestion, but when someone posts a mac on the VIP forums it's considered bad form to make minor edits and post it on the general macro depot.
Considering the mac is posted in this forum at http://www.macroquest2.com/phpBB2/viewtopic.php?t=6768, I doubt that is what he did.

insanitywiz
a hill giant
a hill giant
Posts: 250
Joined: Mon Jul 08, 2002 7:50 am

Post by insanitywiz » Wed Dec 22, 2004 1:09 pm

Ahh, you are correct sir. At first glance it looked like the new version DKAA had up in the VIP section, because I am an idiot.

wizzyman
a ghoul
a ghoul
Posts: 106
Joined: Fri Dec 10, 2004 6:03 pm

Post by wizzyman » Wed Dec 22, 2004 3:14 pm

yah i took this mac from there, if i had vip i doupt i would need to edit macros :smile:

edited it again added some forage duty to not run out of food and drink (no clue what it ll do if your race cant forage)

also customized the circle so that he ll kite in his rubber anchor, but ll go pull outside when no mob close enough, he ll also follow low hp runner if any. i did this to remove the levit song from one of my dot gem, as it wont circle then in steep area and die from injured by falling. (unless u bind your anchor too close to some bluff or sheer :twisted: )

insanitywiz
a hill giant
a hill giant
Posts: 250
Joined: Mon Jul 08, 2002 7:50 am

Post by insanitywiz » Wed Dec 22, 2004 4:50 pm

Bards get forage. For added DPS I would toss in a check for bellow and some other random abilities.

wizzyman
a ghoul
a ghoul
Posts: 106
Joined: Fri Dec 10, 2004 6:03 pm

Post by wizzyman » Thu Dec 23, 2004 1:02 pm

fixed avoiding, now should avoid porperly.

fixed BDLevel calculate.

gettarget should grab agroed mob as next target more easily.

added a slow down step while pulling to avoid outrun mobs while running back to anchor.

improved some the unstuck stuff.

posting 2nd mac here:

2nd one is for open areas where u may need to run a lot to grab a target, and dont want to waste your time running it back to anchor 10 milles away, staying the closest anyway from your anchor.

Code: Select all


| - chant.mac - By Raebis 
|   - Mob avoidance added by ml2517 
|   - MQ2Parmatized by dkaa 
|   - MQ2Datatized by dkaa 
|   - Obstacle avoidance by dkaa 
| 
| Version: REV5c(w/ avoidance mod) Jan 10 4:30pm 
| 
| This mac is used mostly for big open zones with not a lot of 
| big hills (cause hills cause pain - unless you have levitate) 
| 
| Features:------------------------------------------------------------------------ 
| 
| * Automatically selects high light blue, dark blue, or white mob 
| * Runs to mob before targeting it (Stealth! No cross-zone targeting!) 
| * Aggro/Add Detection: Automatically targets and kites aggroed mobs (adds) 
| * Ignores greens and low light blues unless they are aggroed (adds) 
| * Caster Detection: Automatically will switch target to aggroed casting mobs 
| * Compatible with level 49 and level 6 selos 
| * Auto Healing: If health gets low, it will automatically heal 
| * Fleeing Mob Catcher: If mob runs away, macro keeps you in range! 
| * Detects WMS (Warping Mob Syndrom) and gets a new target if a mob warps away! 
| * NEW: Rubber Anchor: kites mobs closest to macro starting point - no wandering! 
| * NEW: Mob avoidance by name.  Add/Remove from the list on the fly. (See the description of use below) 
| * NEW: Script pausing upon startup or during the script. (See the description of use below) 
| --------------------------------------------------------------------------------- 
| 
| usage: chant.mac <DOTs/LVL6 Selos> <49selo> <radius> [<heal song>] [<pause on startup>] 
| 
| 
| Usage Examples: 
|  -Scenario 1: If you are using... 
|   ...DOTs in Gems 4, 5, 6, and 7 
|   ...Level 49 Selo in Gem 2 
|   ...Radius of 55 
|   ...Hymn of Restoration in Gem 1 
|   ...If you wanted the script to start paused 
|   syntax: /mac chant 4567 2 55 1 1 
| 
|  -Scenario 2: If you are using... 
|   ...DOTs in Gems 6 and 7 
|   ...Level 6 Selo in gem 3 
|   ...Radius of 80 
|   ...Hymn of Restoration in gem 8 
|   ...If you want the script to start un-paused 
|   syntax: /mac chant 673 0 80 8 0 
| 
| 
| If <heal song> is defined then when health goes below ${Health}Min (default is 70%) 
| it will replace the first song in <DOTs> with <heal song> until health is above 
| ${Health}Max (default is 85%) 
| 
| If <pause on startup> is a 1 the script will pause upon startup so that you can add mobs to your avoid 

list. 
| If <pause on startup> is a 0 the script will start immediately and go hunting. 
| If you don't define <pause on startup> it assumes you want to immediately start hunting. 
| 
| If <selo> is 0 then the macro will not try to cast selos every 150 seconds 
| 
| Note about the rubber anchor: 
|   The macro will target the mob closest to the RubberAnchor (your /loc when first 
|   starting the macro) 
| 
| REV5b was Tested in EW for bout an hour 
| 
| Warning: You may wander from your starting point but after killing a mob, the 
|          next mob that the macro targets will be closest to your starting point 
| 
| Note: Rev information moved to the top 
| 
| ----------------------------------------------------------------------------------- 
| 
| New Commands: 
| ------------- 
| /avoidadd mobname 
| /avoidrem mobname 
| /pause 
| 
| Examples: 
| --------- 
| /avoidadd A Large Trout 
| /avoidrem A Large Trout 
| /pause 
| 
| When adding mobs to the avoidance list initially you can use the /echo pause command. 
| This will pause the script but still allow you to target and add/remove the mobs you'd 
| like to avoid/not avoid.  You can also pause the script upon startup by using the pause parameter. 
| 
| The best way to use the avoid add command is to use a hotkey with this: 
|   /avoidadd $(Target.CleanName} 
| 
| The best way to use the avoid remove command is to use a hotkey with this: 
|   /avoidrem ${Target.CleanName} 
| 
| Then you simply run around the zone targeting mobs that you know you'd like to avoid and add/remove them 
| to your avoidance list.  The list is written to an INI file so you won't have to add them to the list 
| the next time you play. 
| 

#event NeedTarget "#*#You must first select a target for this spell!#*#" 
#event Exp        "#*#You gain #*#" 
#event Died       "#*#You have entered#*#" 
#event Caster     "#*# begins to cast a spell.#*#" 
#event Tell       "#*#tells you#*#" 
|#event dead       "You have been slain by#*#"

#turbo 10 

Sub Main(string DOTs,string Selos,int CRadius,string Health,int Paused) 

   /if (!${Defined[CRadius]}) { 
      /echo usage: chant.mac <DOTs, LVL6 Selos> <49selo> <radius> [<heal song>] 
      /return 
   } 

   /declare PauseFlag int outer 

   /if (${Defined[Paused]}) { 
       /if (${Paused}) { 
           /varset PauseFlag 1 
       } else { 
           /varset PauseFlag 0 
       } 
   } else { 
       /varset PauseFlag 0 
   } 

   /declare avoidadd string outer 
   /declare avoidrem string outer 

   /alias /pause /varcalc PauseFlag !${PauseFlag} 
   /alias /avoidadd /varset avoidadd 
   /alias /avoidrem /varset avoidrem 

   /declare CirR outer 

   /declare Songs[10] int outer 
   /declare nSongs int outer 
   /declare PrevSong int outer 
   /declare CurSong int outer
   /declare Exper int outer 
   /declare AAExp int outer 

   /declare SongTimer timer outer 
   /declare SeloSong int outer 

   /declare HealSong int outer 
   /declare OrigSong int outer 

   /declare HealthMin outer 
   /declare HealthMax outer 
   
   /declare DBLevel outer 

   /declare TargetUpNext int outer 
   /declare DE  outer
   /declare DE2  outer

   /declare RubberX int outer 
   /declare RubberY int outer 

   /declare AvoidList[50] string outer UNDEFINED-ARRAY-ELEMENT 

   /declare MyXLOC float outer 
   /declare MyYLOC float outer 

   /declare ObstCount int outer 
   /declare EachSong int local 

   /call AvoidINILoad 

   /varset PrevSong 0 
   /varset MyXLOC 0.0 
   /varset MyYLOC 0.0 

   /varset nSongs ${DOTs.Length} 
   /echo nSongs ${nSongs} 
   /echo DOTs ${DOTs} 
   /for EachSong 1 to ${nSongs} 
      /varset Songs[${EachSong}] ${DOTs.Mid[${EachSong},1]} 
      /echo Song ${EachSong}: ${Me.Gem[${Songs[${EachSong}]}].Name} 
   /next EachSong 

   /if (${Selos}!=0) { 
      /varset SeloSong ${Selos} 
      /echo Selo's: ${Me.Gem[${SeloSong}].Name} 
   } else { 
      /varset SeloSong 0 
      /echo Not using level 49 Selos. 
   } 

   /if (!${Defined[Health]}) { 
      /echo No HealSong. Please watch your health. 
      /varset HealSong 0 
   } else /if (${Health}!=0) { 
      /varset HealSong ${Health} 
      /echo Healsong: ${Me.Gem[${HealSong}].Name} 
   } else { 
      /echo No HealSong. Please watch your health. 
      /varset HealSong 0 
   } 

   /varset CirR ${CRadius} 
   /echo Radius: ${CirR} 

   /varset OrigSong ${Songs[1]} 
   /varset CurSong 1 
   /varset Exper ${Me.Exp} 
   /varset AAExp ${Me.AAExp} 
   /varset SongTimer 1 

   |/varset DBLevel ${Math.Calc[${Me.Level}*.75]} 
   /varset DBLevel 38 

   /varset HealthMin 70 
   /varset HealthMax 95 

   /varset TargetUpNext 0    
  
   /varset RubberX ${Me.X} 
   /varset RubberY ${Me.Y} 

   /echo Rubber Anchor dropped at ${RubberX},${RubberY} 

   /if (${PauseFlag}==1) { 
       /echo Script [PAUSED] issue an "/pause" to unpause it. 
   } 

:Loop 
    
    /if (${Bool[${Me.Buff["Grasping Roots"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Root"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Entrapping Roots"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Engorging Roots"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Earthen Roots"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Engulfing Roots"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Ensnaring Roots"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Enveloping Roots"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Fetter"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Greater Fetter"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Immobilize"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Greater Immobilize"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Instill"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Paralyzing Earth"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Savage Roots"]}]}==TRUE) /call Root
    /if (${Bool[${Me.Buff["Shackles of Tunare"]}]}==TRUE) /call Root

    /if (${Bool[${Me.Buff["Illusion: Dark Elf"]}]}==FALSE) {
       /varset DE FALSE
       /call DE
    } else {
       /varset DE TRUE
    }
    /if (${Bool[${Me.Buff["Illusion: Dark Elf"]}]}==TRUE) /varset DE2 FALSE
    /if (${Cursor.ID}) /autoi

    /if (${Me.AbilityReady[Forage]}) { 
      /doability forage
      /autoi
    }

    /if (${avoidadd.Length}) { 
        /echo ${avoidadd.Length} for ${avoidadd} 
        /call AvoidINIAdd "${avoidadd}" 
        /varset avoidadd 
    } 

    /if (${avoidrem.Length}) { 
        /echo ${avoidrem.Length} for ${avoidrem} 
        /call AvoidINIRemove "${avoidrem}" 
        /varset avoidrem 
    } 

    /if (${PauseFlag}==1) { 
        /delay 1 
        /doevents AddAvoid 
        /doevents RemoveAvoid 
        /goto :Loop 
    } 

   /if (${TargetUpNext}<=0) /if (!${Target.ID}) { 
      /call GetTarget 
      |/delay 2 
   } 

   /if (${TargetUpNext}>0) /if (${Target.ID}) { 
      /echo User Selected Target or Aggroed while running 
      /varset TargetUpNext 0 
   } 

   /if (${Target.Distance}>1000) /if (${Target.PctHPs}<=50) { 
      /echo Target Warped... Getting a new target; id was ${Target.ID} 
      /cleanup 
      /call GetTarget 
      /delay 2 
   } 

   /if (${HealSong}) /if (${Me.PctHPs}<${HealthMin}) { 
      /if (${Songs[1]}!=${HealSong}) { 
         /echo Healing On - Health: ${Me.PctHPs}% to ${HealthMax}% 
         /varset Songs[1] ${HealSong} 
      } 
   } 

   /if (${HealSong}) /if (${Me.PctHPs}>=${HealthMax}) { 
      /if (${Songs[1]}!=${OrigSong}) { 
         /echo Healing Off 
         /varset Songs[1] ${OrigSong} 
      } 
   } 
   |/delay 2 
   /if (${SeloSong}) /if (!${Me.Casting.ID}) /if (!${Me.Buff[$Me.Gem[${SeloSong}].Name].Duration}) /varset 

SongTimer 1 
   /if (${SongTimer}>0) /if (!${Me.Casting.ID}) /call SongFailed 
   /call Circ 
   /delay 1 
   /doevents 
   |/delay 1 
   /goto :Loop 
/return 

Sub Event_Timer(string TimerName) 
   /if (${String[${TimerName}].Equal[SongTimer]}) { 
      | ${Me.Buff[${Me.Gem[4]}].ID} 
      /if (${SeloSong}) /if (!${Me.Buff[${Me.Gem[${SeloSong}]}].ID} && ${DE}) { 
         /echo Selos not up!!! 
         /stopsong 
         /cast ${SeloSong} 
         /varset PrevSong 0 
         /varset SongTimer 30 
         /call Circ 
         /doevents 
         /return 
      }
   } 

      | ${Me.Buff[${Me.Gem[4].Name}].Duration}<=6) { 
      /if (${SeloSong}) /if (${Me.Buff[${Me.Gem[${SeloSong}].Name}].Duration}<=6 && ${DE}) { 
         /echo Selos about to die 
         /stopsong 
         /cast ${SeloSong} 
         /varset PrevSong 0 
         /varset SongTimer 30 
         /call Circ 
         /doevents 
         /return 
      } 

      /delay 2 
      /if (${DE}) {
         /stopsong 
         /echo ${CurSong} casting ${Songs[${CurSong}]} 
         /cast ${Songs[${CurSong}]} 
         /varset PrevSong ${CurSong} 
         /varcalc CurSong ${CurSong}+1 
         /if (${CurSong}>${nSongs}) /varset CurSong 1 
         /varset SongTimer 30 
         /call Circ 
         /doevents
      } 
   } 
/return 

Sub Circ 
   /declare CirX local 
   /declare CirY local 

   /call CheckObst 

   /if (${Target.ID}) { 
      /varset CirX ${Target.Y} 
      /varset CirY ${Target.X} 
   } else { 

        /if (${TargetUpNext}!=0) { 

            /varset CirX ${Spawn[ID ${TargetUpNext}].Y} 
            /varset CirY ${Spawn[ID ${TargetUpNext}].X} 

            /if (${Spawn[ID ${TargetUpNext}].Distance}<=${Math.Calc[${CirR}*2]}) { 
                /if (${Target.ID}) { 
                    /if (${Target.ID}!=${TargetUpNext}) { 
                        /target id ${TargetUpNext} 
                    } 
                } else { 
                    /target id ${TargetUpNext} 
                } 
                /varset TargetUpNext 0 
            } 
        } 
   } 

   /if (${Math.Distance[${CirX},${CirY}]}<${Math.Calc[${CirR}/2]}) { 
      /face heading ${Math.Calc[${Heading[${CirX},${CirY}].DegreesCCW}+180]} 
   } else { 
      /face heading 

${Math.Calc[${Heading[${CirX},${CirY}].DegreesCCW}+${Math.Calc[90*${CirR}/${Math.Distance[${CirX},${CirY}]}]

}]} 
   } 
/return 


sub DE


/delay 2

   /if (!${DE2}) {
      /stopsong 
      /echo casting Illusion Dark Elf, since you re so blind...
      /nomod /itemnotify 25 rightmouseup 
      /call Circ
      /delay 1
      /doevents
      /varset DE2 TRUE
   } 
   
/return           
     

Sub SongFailed 
   /if (!${PrevSong}) { 
      /varset SongTimer 1 
      /return 
   } 
   /varset CurSong ${PrevSong} 
   /varset SongTimer 1 
/return 

Sub Event_NeedTarget 
   /if (${TargetUpNext}<=0) /call GetTarget 
/return 

Sub Event_Died 
   /delay 10 
   /sit 
   /delay 10 
   /camp desktop 
/return 

Sub Event_Dead 
   /endmacro

/return 

Sub Event_Exp 
   /varset AAExp ${Math.Calc[${Me.AAExp}-${AAExp}]} 
   /varset Exper ${Math.Calc[${Me.Exp}-${Exper}]} 

   /echo EXP: ${Exper}:${Me.PctExp}% - AAXP: ${AAExp}:${Me.AAExp}% - ${Math.Calc[${Macro.RunTime}/60]} 

minutes 

   /varset Exper ${Me.Exp} 
   /varset AAExp ${Me.AAExp} 

   /if (${TargetUpNext}==0) /if (${Target.ID}==0) /call GetTarget 
/return 

Sub GetTarget 
   /declare LastMobID int local 0 
   /declare FirstMobID int local 0 
   /declare MobID int local 0 
   /declare SRadius int local 


   /varset MobID ${Spawn[npc radius ${Math.Calc[${CirR}*4]}].ID} 
   /varset FirstMobID ${MobID} 
   /echo MobID ${MobID} 

   :CheckAggrodMobs 
   /if (${MobID}!=0) { 
       /if (${Spawn[ID ${MobID}].Speed}>170) { 
          /call AvoidTargets ${MobID} 
          /if (${Macro.Return}==1) { 
             /target id ${MobID} 
             /echo Kiting aggro'd mob: ${Target.CleanName} 
             /return 
          } 
       } 
       /varset LastMobID ${MobID} 
       /varset MobID ${Spawn[npc id ${LastMobID} radius ${Math.Calc[${CirR}*2]} next].ID} 
       /if (${FirstMobID}==${MobID}) { 
           /goto :NoAggrodMobs 
       } 
       /goto :CheckAggrodMobs 
       :NoAggrodMobs 
   } 
   /echo no aggro'd mobs found 

   /varset MobID 0 
   /varset FirstMobID 0 
   /varset LastMobID 0 
   /alert clear 1 
   | a clear alert and noalert don't mix 
   /alert add 1 npc this_is_bogus 
   /for SRadius 100 to 10000 step 100 
      /if (${MobID}==0) { 
          /varset MobID ${Spawn[noalert 1 npc range ${DBLevel} ${Me.Level} loc ${RubberX} ${RubberY} radius 

${SRadius}].ID} 
          /varset FirstMobID ${MobID} 
      } else { 
          /varset LastMobID ${MobID} 
          /varset MobID ${Spawn[noalert 1 npc range ${DBLevel} ${Me.Level} loc ${RubberX} ${RubberY} radius 

${SRadius}].ID} 
          /if (${FirstMobID}==${MobID}) { 
              /next SRadius 
          } 
      } 
      /if (${MobID}!=0) { 
         /call AvoidTargets ${MobID} 
         /if (${Macro.Return}==1) { 
            /echo not avoiding ${Spawn[ID ${MobID}].CleanName} 
            /goto :Done 
         } else { 
            /alert add 1 npc ${Spawn[ID ${MobID}].CleanName} 
        } 
      } 
   /next SRadius 

   /varset MobID ${Spawn[npc]} 
   /echo No mobs found, action required! 
   /beep 
   /beep 
   /beep 
   /beep 
:Done 
   /varset TargetUpNext ${MobID} 
   /echo Next: ${Spawn[ID ${MobID}].Level} ${Spawn[ID ${MobID}].CleanName} - Distance: ${Spawn[ID 

${MobID}].Distance} 
/return 



|############################################################################# 


Sub AvoidTargets(int TempMobID) 
    /declare Element int local 1 

:AvoidCheckLoop 

    /if (${Ini[AvoidList.ini,Avoid,${Element}].Equal[NULL]}) { 
        /varcalc Element ${Element}+1
    } 

    /if (${Ini[AvoidList.ini,Avoid,${Element}].Equal[${Spawn[ID ${TempMobID}].CleanName}]}) { 
        /echo AVOIDING ${Ini[AvoidList.ini,Avoid,${Element}]} 
        /return 0
         
    } 
    /varcalc Element ${Element}+1
    /if (${Element} < 11) /goto :AvoidCheckLoop
 
/return 1 

|############################################################################# 


Sub AvoidINIRemove(string RemoveName) 
/declare TempElements local 0 
/declare TempVar int local 0 
/declare TempItem string local 

:RemCheckLoop 
    /varset TempItem ${Ini[AvoidList.ini,Avoid,${TempVar},NOTFOUND]} 
    /if (${TempItem.Equal[NULL]}) { 
        | no file 
        /goto :RemFoundInArray 
    } 
    /if (${TempItem.Equal[NOTFOUND]}) { 
        /echo ${RemoveName} not in AvoidList.ini 
        /goto :RemFoundInArray 
    } 

    /if (${RemoveName.Equal[${TempItem}]}) { 
        /varset AvoidList[${Math.Calc[${TempVar}+1]}] Empty 
        /echo ${RemoveName} removed from AvoidList.ini 
        /ini AvoidList.ini Avoid ${TempVar} Empty 
    :VerifyRemoval 
        /if (!${Ini[AvoidList.ini,Avoid,${TempVar},NOTFOUND].Equal[Empty]}) { 
            /echo verify removal unsuccessful 
            /goto :VerifyRemoval 
        } 
        /goto :RemFoundInArray 
    } 
    /varcalc TempVar ${TempVar}+1 
    /goto :RemCheckLoop 
:RemFoundInArray 
/return 


|############################################################################# 


Sub AvoidINIAdd(string AddName) 
/declare TempElements int local 0 
/declare TempVar int local 1 
/declare TempItem string local 

/echo AvoidINIAdd ${AddName} 

:AddCheckLoop 
    /varset TempItem ${Ini[AvoidList.ini,Avoid,${TempVar},NOTFOUND]} 

    /if (${TempItem.Equal[NULL]}) { 
        | no file 
        /goto :FoundInArray 
    } 

    /if (${TempItem.Equal[NOTFOUND]}) { 
        /varset AvoidList[${Math.Calc[${TempVar}+1]}] ${AddName} 
        /goto :AddItem 
    } 

    /if (${TempItem.Equal[${AddName}]}) { 
        /echo ${AddName} already in AvoidList.ini 
        /goto :FoundInArray 
    } 

    /if (${TempItem.Equal[Empty]}) { 
        /varset AvoidList[${Math.Calc[${TempVar}+1]}] ${AddName} 
        /goto :AddItem 
    } 

    /varcalc TempVar ${TempVar}+1 
    /goto :AddCheckLoop 

:AddItem 

    /ini AvoidList.ini Avoid ${TempVar} "${AddName}" 

:VerifyAdd 
    /if (!${Ini[AvoidList.ini,Avoid,${TempVar},NOTFOUND].Equal[${AddName}]}) { 
        /echo verify addition unsuccessful 
        /goto :VerifyAdd 
    } 

/echo ${AddName} added to AvoidList.ini 

:FoundInArray 
/return 


|############################################################################# 


Sub AvoidINILoad 
/declare TempItem string local 
/declare AvoidItemNum int local 0 

:LoadAvoidLoop 

    /varset TempItem ${Ini[AvoidList.ini,Avoid,${AvoidItemNum},NOTFOUND]} 
    /if (${TempItem.Equal[NULL]}) { 
        /goto :DoneLoading 
    } 
    /if (${TempItem.Equal[NOTFOUND]}) { 
        /goto :DoneLoading 
    } 
    | note: indexing starts at 1 not 0 
    /echo adding ${TempItem} to avoid list at ${Math.Calc[${AvoidItemNum}+1].Int} 
    /varset AvoidList[${Math.Calc[${AvoidItemNum}+1]}] ${TempItem} 
    /varcalc AvoidItemNum ${AvoidItemNum}+1 
    /goto :LoadAvoidLoop 
:DoneLoading 
/return 


|############################################################################# 


Sub Event_AddAvoid(string EvtText) 
/if (${EvtText.Mid[6,10].Equal[avoid add ]}) { 
    /call AvoidINIAdd "${EvtText.Mid[16,${Math.Calc[${EvtText.Length}-16]}]}" 
} 
/return 

Sub Event_RemoveAvoid(EvtText) 
/if (${EvtText.Mid[6,13].Equal[avoid remove ]}) { 
    /call AvoidINIRemove "${EvtText.Mid[19,${Math.Calc[${EvtText.Length}-19]}]}" 
} 
/return 

Sub Event_Caster(string CastText) 
   /declare CasterID int local 
   /varset CasterID ${Spawn[${CastText.Left[${Math.Calc[${String[${CastText}].Length}-24]}]}].ID} 
   /if (!${Spawn[ID ${CasterID}].Type.Equal[NPC]}) /return 
   /if (${Target.ID}==${CasterID}) /return 
   /if (${Spawn[ID ${CasterID}].Distance}<=${Math.Calc[${CirR}*2]}) { 
      /target id ${CasterID} 
      /echo Targeting Caster: ${Target.CleanName} 
   } 
/return 

Sub Event_Tell 
   /beep 
   /mp3 play 
/return 

sub CheckObst 
    /if (${MyXLOC}==${Me.X}) /if (${MyYLOC}==${Me.Y}) { 
        /echo STUCK!!! 
        /call HitObst 1 
    } 
    /varset MyXLOC ${Me.X} 
    /varset MyYLOC ${Me.Y} 
/return 

sub HitObst 
   /keypress up 
   /keypress down hold 
   /if (${Math.Rand[99]}>50) { 

       
      /keypress Right hold
      /delay 10 
      /delay ${Param0} 
      /keypress Right 
   } else { 
      
      /keypress Left hold
      /delay 10 
      /delay ${Param0} 
      /keypress Left 
   } 
   /keypress down 
   /keypress Right 
   /keypress Left 
   /keypress up 
   /keypress num_lock
   /delay 1s
 
/return  

sub Root

:root
   
   /stopsong
   /cast "Angstlich`s Appalling Screech" gem8 3s
   /delay 3s
      
   /if (${Bool[${Me.Buff["Grasping Roots"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Root"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Entrapping Roots"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Engorging Roots"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Earthen Roots"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Engulfing Roots"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Ensnaring Roots"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Enveloping Roots"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Fetter"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Greater Fetter"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Immobilize"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Greater Immobilize"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Instill"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Paralyzing Earth"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Savage Roots"]}]}==TRUE) /goto :root
   /if (${Bool[${Me.Buff["Shackles of Tunare"]}]}==TRUE) /goto :root

 
/return

PS if u got more than 10 avoidadd u ll need to boost this value in sub Root:
"
/varcalc Element ${Element}+1
/if (${Element} < 11) /goto :AvoidCheckLoop
"
it better to keep this low to not miss any add. unless u got a faster puter than me witch is very easy :P

PPS if u get rooted u ll sing ae fear, u can switch this to any other song u ll found usefull is this case, fear may be bad on DB mobs area but make wonders on lightblue/BD area.

TheDew
decaying skeleton
decaying skeleton
Posts: 1
Joined: Mon Jun 06, 2005 3:06 am

Post by TheDew » Mon Jun 06, 2005 3:15 am

Is there a way to configure this code to use a solid anchor that would keep the toon running in the same circle the whole time insted of moving. Ive found several great places to run this program in the 60's but the places are not open areas by any means.

Thanks for any help

wizzyman
a ghoul
a ghoul
Posts: 106
Joined: Fri Dec 10, 2004 6:03 pm

Post by wizzyman » Mon Jun 06, 2005 4:28 am

use search, the macro you want does exist... somewhere...

colt45
orc pawn
orc pawn
Posts: 16
Joined: Thu Jun 10, 2004 5:29 am

Post by colt45 » Tue Jun 21, 2005 8:16 pm

just a few questions, does this macro require the plugins such as Moveutils and Twist or any for that matter?

Also The rubber anchor shouldn't be too hard to fix, If you know a way to make a set anchor it would sure be appreciated

Kenny*
a lesser mummy
a lesser mummy
Posts: 43
Joined: Sun Aug 22, 2004 1:56 am
Contact:

Post by Kenny* » Sat Jul 16, 2005 3:21 pm

since next update he just run alway and dont cast dots just circle with spam


"Due to complete misuse of the String Top-level Object, it has been removed." i dont understand enough to fix by myself but if anyone fixed it or have nother version working could post plz.