advchant.mac - Advanced Chant REV7

A forum for you to dump all the macros you create, allowing users to use, modify, and comment on your work.

Moderator: MacroQuest Developers

fatmike
decaying skeleton
decaying skeleton
Posts: 9
Joined: Sat Dec 27, 2003 12:42 pm

wandering

Post by fatmike » Sat Dec 27, 2003 12:48 pm

whenever i use this macro, i end up wandering all over the zone ALOT.

for example every time i try to do walruses in EW i end up swimming and dieing. is there any way to make it so that after each kill, i run back to the same spot and then start to kite from there, or aquire a target from there?

also, im having a problem with getting the heal song to work. i have type /mac chant 123 0 95 4 with 12 being my dots, 3 is level 5 selos, and 4 is my heal song. but for some reason, the heal song never goes off.

also, after kiting for 20 -30 mins, i end up with a bunch of adds, which is fine, but for some reason, randomly my bard decides that instead of the next mob being an add, he wants to kite a mob kinda far away, and runs over to him, which isnt that bad, but sometimes in looping around that mob, i run right thru my pack of adds who kill me, or beat me pretty bad, which is a problem because the heal song never goes off

can anyone tell me what im doing wrong?

bard is levle 38 and playing in EW by the way.

Raebis
a ghoul
a ghoul
Posts: 81
Joined: Fri Dec 12, 2003 6:23 am

Post by Raebis » Sat Dec 27, 2003 2:19 pm

In testing right now is a sort of rubber anchor, which does exactly what you need... This anchor will target the mob closest to the original starting point instead of targeting the mob closest to u

I will look into the add issue as well.
Always say what you want to say. Because those who mind, don't matter. And those who matter, don't mind.

tac8357
orc pawn
orc pawn
Posts: 25
Joined: Fri Oct 17, 2003 5:18 pm
Contact:

kina have the same problem

Post by tac8357 » Sat Dec 27, 2003 11:05 pm

Well after about 30 mins of good hunting it kinda goes wacko, it will circle the mob till it hits 18 percent then it seems to shoot off in a straight line to no where. No sure why it does that it works great for about 30 mins.

tac8357
orc pawn
orc pawn
Posts: 25
Joined: Fri Oct 17, 2003 5:18 pm
Contact:

by the way

Post by tac8357 » Sat Dec 27, 2003 11:19 pm

By the way i want to thank you for the macro it rocks besides a few bugs. I just wish i had the time to figure how to make macros. Its nice having you guys around to spend the time figuring this stuff out for us.

Thanx again

User avatar
Dniper
a lesser mummy
a lesser mummy
Posts: 71
Joined: Tue Nov 25, 2003 2:54 pm

Re: kina have the same problem

Post by Dniper » Sun Dec 28, 2003 1:53 pm

tac8357 wrote:Well after about 30 mins of good hunting it kinda goes wacko, it will circle the mob till it hits 18 percent then it seems to shoot off in a straight line to no where. No sure why it does that it works great for about 30 mins.
It does this because the mob warps far far away; it's not the problem of the macro itself.

I've noticed this happening a lot lately. I can't even chant kite anything hardly because half the time it seems to warp on me on the Venril server. The other night I witnessed another bard in Iceclad and he was camping Stormfeather, after like 12 hours it spawned and he chant kited it and then poof. I did a cross zone target and it was like 11,000m away and in the ocean. Poor guy was pretty pissed off.

I hope this problem gets fixed; I don't ever remember it being so bad as it is now. The only way I've found to get around it is by grouping the mob (if it's a social mob) with others of its likness so it doesn't run away. So now I mainly stick to AE kiting but it really sucks when I find a named mob and kite him only to have him poof across the zone (especially if it's in the ocean or something).
Veni, vidi, vici.

User avatar
wilso132
Contributing Member
Contributing Member
Posts: 106
Joined: Thu Oct 17, 2002 11:53 am

Post by wilso132 » Sun Dec 28, 2003 3:14 pm

This modified code will take care of warping mobs (thanks ml2517):

Code: Select all

| - chant.mac - By Raebis 
| 
| 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 
| 
| --------------------------------------------------------------------------------- 
| 
| usage: chant.mac <DOTs> <49selo> <radius> [<heal song>] 
| 
| 
| Usage Examples: 
|  -Scenario 1: If you are using... 
|   ...DOTs in Gems 1, 2, 3, and 4 
|   ...Level 49 Selo in Gem 5 
|   ...Hymn of Restoration in Gem 6 
|   ...Radius of 55 
|   syntax: /mac chant 1234 5 55 6 
| 
|  -Scenario 2: If you are using... 
|   ...DOTs in Gems 1 and 2 
|   ...Level 6 Selo in slot 3 
|   ...No Healsong 
|   ...Radius of 80 
|   syntax: /mac chant 123 0 80 
| 
| 
| If <heal song> is defined then when health goes below @HealthMin (default is 70%) 
| it will replace the first song in <DOTs> with <heal song> until health is above 
| @HealthMax (default is 85%) 
| 
| If <selo> is 0 then the macro will not try to cast selos every 150 seconds 
| 
| [REV3 was] Tested in in burning woods (for 1 hours); east wastes (for 2 hours), PoM (for 30 mins) 
| 
| Warning: You WILL wander around the zone, thought in ew for an hour i pretty 
| much stayed east of the kael zone and didn't wander too much 
| 
| REV4nt Dec 22 22:45 
| 
| Note: REV4nt has not been tested yet due to MQ2 updating 
| 

#event MissedNote "You miss a note, bringing your song to a close!" 
#event NeedTarget "You must first select a target for this spell!" 
#event Slow       "you slow down" 
#event Exp        "You gain " 
#event Tell       "tells you" 
#event Recovered  "You haven't recovered yet..."  
#event Died       "You have entered" 
#event Caster     " begins to cast a spell." 

#turbo 

Sub Main(DOTs,Selos,CRadius,HealSong) 
   /zapvars 

   /if $defined(CRadius)==false { 
      /echo usage: chant.mac <DOTs> <49selo> <radius> [<heal song>] 
      /return 
   } 

   /declare CirR global 

   /declare Songs array 
   /declare nSongs global 
   /declare CurSong global 
   /declare PrevSong global 

   /declare Exper global 
   /declare AAExp global 

   /declare SongTimer timer 
   /declare SeloTimer timer 
   /declare SelosSong global 

   /declare HealSong global 
   /declare OrigSong global 

   /declare HealthMin global 
   /declare HealthMax global 

   /declare DBLevel global 
   /declare LBLevel global 

   /declare GettingTarget global 
   /declare TargetUpNext global 

   /declare EachSong local 

   /varset nSongs $strlen(@DOTs) 
   /for EachSong 1 to @nSongs 
      /varset Songs(@EachSong) $mid($calc(@EachSong-1),1,@DOTs) 
      /echo Song @EachSong: $char(gem,@Songs(@EachSong) 
   /next EachSong 

   /if n @Selos!=0 { 
      /varset SelosSong $calc(@nSongs+1) 
      /varset Songs(@SelosSong) @Selos 
      /echo Selo's: $char(gem,@Songs(@SelosSong)) 
   } else { 
      /varset SelosSong 0 
      /echo Not using level 49 Selos. 
   } 

   /if $defined(HealSong)!=false { 
      /varset HealSong @HealSong 
      /echo Healsong: $char(gem,@HealSong) 
   } else { 
      /echo No HealSong. Please watch your health. 
   } 

   /varset CirR @CRadius 
   /echo Radius: @CRadius 

   /varset OrigSong @Songs(1) 
   /varset CurSong 1 
   /varset Exper $char(exp) 
   /varset AAExp $char(aa,exp) 
   /varset SongTimer 64 
   /varset SeloTimer 0 

   /varset LBLevel $calc($calc($char(level)*.66)+1) 
   /varset DBLevel $calc($calc($char(level)*.7)+1) 

   /varset HealthMin 70 
   /varset HealthMax 85 

   /varset TargetUpNext 0    
  
:Loop 

[color=darkred]   /if n $target(hp,pct)<=15 /if n $target(distance)>2000 { 
      /cleanup 
      /echo Target warped, acquiring another 
      /call gettarget 
   } [/color]

   /if n @TargetUpNext<=0 /if n $target(id)<=0 { 
      /call gettarget 
   } 

   /if n @TargetUpNext>0 /if n $target(id)>0 { 
      /echo User Selected Target or Aggroed while running 
      /varset TargetUpNext 0 
   } 
    
   /if n @SelosSong==0 /varset SeloTimer 10000 

   /if n @SeloTimer<=0 { 
      /varset CurSong @SelosSong 
      /varset SeloTimer 1500 
      /call Sing 
   } 

   /if n @SeloTimer<1460 /if n $char(speed)<=100 /if n $char(speed)>40 { 
      /echo Selos down for some reason... casting $char(gem,@Songs(5)) 
      /varset CurSong @SelosSong 
      /varset SeloTimer 1500 
      /call Sing 
   } 

   /if $defined(HealSong)!=false /if n @SeloTimer<1460 { 
      /if n $calc($calc($char(hp,cur)/$char(hp,max))*100)<@HealthMin { 
         /if n @Songs(1)!=@HealSong { 
            /echo Healing On - Health: $char(hp,pct)% to @HealthMax% 
            /varset Songs(1) @HealSong 
         } 
      } else /if n $calc($calc($char(hp,cur)/$char(hp,max))*100)>@HealthMax { 
         /if n @Songs(1)!=@OrigSong { 
            /echo Healing Off 
            /varset Songs(1) @OrigSong 
         } 
      } 
   } 

   /if n @SelosSong!=0 { 
      /if n @SeloTimer<1460 /if n @SongTimer<=0 /call Sing 
   } else { 
      /if n @SongTimer<=0 /call Sing 
   } 
   /call circ 
   /doevents 
   /delay 0 
   /goto :Loop 
/return 

Sub Sing 
   /stopsong 
   /cast @Songs(@CurSong) 
   /varset PrevSong @CurSong 
   /varadd CurSong 1 
   /varset SongTimer 32 
   /doevents 
   /if n @CurSong>@nSongs /varset CurSong 1 
/return 

Sub circ 
   /declare CirX local 
   /declare CirY local 

   /if n @TargetUpNext>0 { 

      /varset CirX $spawn(@TargetUpNext,y) 
      /varset CirY $spawn(@TargetUpNext,x) 

      /if n $spawn(@TargetUpNext,distance)<=$calc(@CirR*1.2) { 
         /target id @TargetUpNext 
         /varset TargetUpNext 0 
      } 
   } 

   /if n $target(id)>0 { 
      /varset CirX $target(y) 
      /varset CirY $target(x) 
   } 

   /if n $distance(@CirX,@CirY)<$calc(@CirR/2) { 
      /face heading $calc($heading(@CirX,@CirY)+180) 
   } else { 
      /face heading $calc($heading(@CirX,@CirY)+$calc(90*$calc(@CirR/$distance(@CirX,@CirY)))) 
   } 
/return 

Sub Event_MissedNote 
   /varset CurSong @PrevSong 
   /varset SongTimer 0 
   /doevents 
/return 

Sub Event_Recovered 
   /if n @CurSong!=$calc(@SelosSong-1) { 
      /varset CurSong @PrevSong 
      /varset SongTimer 0 
   } else { 
      /varset CurSong @SelosSong 
      /varset SeloTimer 1500 
      /call Sing 
   } 
   /doevents 
/return 

Sub Event_NeedTarget 
   /if n @TargetUpNext<=0 { 
      /call gettarget 
   } 
   /doevents 
/return 

Sub Event_Tell 
   /beep 
   /doevents 
/return 

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

Sub Event_Exp 
   /varset AAExp $calc($char(aa,exp)-@AAExp) 
   /varset Exper $calc($char(exp)-@Exper)  

   /echo EXP: @Exper%:$char(exp)% - AAXP: @AAExp%:$char(aa,exp)% - $calc($running/60) minutes 

   /varset Exper $char(exp) 
   /varset AAExp $char(aa,exp) 

   /varset LBLevel $calc($calc($char(level)*.66)+1) 
   /varset DBLevel $calc($calc($char(level)*.7)+1) 

   /if n @TargetUpNext<=0 /if n $target(id)<=0 { 
      /call gettarget 
   } 

   /if n @SeloTimer<1460 { 
      /stopsong 
      /varset CurSong 1 
   } 

   /varset SongTimer 0 
   /doevents 
/return 

Sub gettarget 
   /declare SID1 local 
   /if n @GettingTarget==1 /goto :GotId 
   /varset GettingTarget 1 
   /varset SID1 $searchspawn(npc,radius:$calc(@CirR*1.2)) 
   /if n @SID1>0 /if n $spawn(@SID1,level)>$calc(@LBLevel-3) /if n $spawn(@SID1,level)<=$char(level) /if n $spawn(@SID1,speed)>100 { 
      /target id @SID1 
      /echo Kiting aggro'd mob: $target(name,clean) 
      /goto :GotId 
   } 

   /varset SID1 $searchspawn(npc) 

:NeedId 

   /if n $spawn(@SID1,level)>@DBLevel /if n $spawn(@SID1,level)<=$char(level) { 
      /varset TargetUpNext @SID1 
      /echo TargetUpNext: $spawn(@TargetUpNext,name,clean) Distance: $spawn(@TargetUpNext,distance) 
      /goto :GotId 
   } else { 
     /varset SID1 $searchspawn(npc,"id:@SID1","next") 
   } 
   /goto :NeedId 

:GotId 
   /varset GettingTarget 0 
/return 

Sub Event_Caster(CastText) 
   /declare CastLen local 
   /declare CastPut local 
   /declare SID2 local 

   /varset CastLen $calc($strlen("CastText")-24) 
   /varset CastPut $left(@CastLen,"CastText") 
   /varset SID2 $id(@CastPut) 
   /if $spawn(@SID2,type)!=NPC /return 
   /if n $target(id)==@SID2 /return 
   /if n $spawn(@SID2,distance)<=$calc(@CirR*1.2) /if n $spawn(@SID2,level)>$calc(@LBLevel-3) /if n $spawn(@SID2,level)<=$char(level) /target id @SID2 
/return 

Raebis
a ghoul
a ghoul
Posts: 81
Joined: Fri Dec 12, 2003 6:23 am

Post by Raebis » Sun Dec 28, 2003 11:57 pm

Ok I am finally goign to test this mac, update it and come up with a REV5... Give me an hour or two and a new REV should be posted..

Going to implement this rubber anchor idea i've been talking about
Always say what you want to say. Because those who mind, don't matter. And those who matter, don't mind.

El
a ghoul
a ghoul
Posts: 108
Joined: Mon Dec 29, 2003 12:34 pm

Post by El » Mon Dec 29, 2003 12:46 pm

Others have said the same thing, but here's my two cents worth...

I tested rev4nt in Maru Seru yesterday 12/28. Level 32 here, and I used the following syntax:

/macro chant 123 0 45 4

where 1+2 were aoe dots, 3 was level 6 selo's, and 4 was Hymn.

1. Healing just doesn't work. I got beat on regularly from agroed mobs, and it didn't kick in once.

2. There seems to be a timing problem with level 6 selo's. After awhile (>5 minutes?), Selo's would just wear off. No missed notes, no stuns or anything. It would just wear off and not be recast before I was beat into a pulp.

3. With the warnings about #turbo in other threads, is it necessary to have it on?

4. If you have no target when you start this macro, it stands in one place and shivers. Occasionally (maybe 3 times in 5 hours of testing?), I would lose my target, and then the mobs I had agroed would catch up and beat on me.

Once, I drank a sow potion while kiting, which targeted myself, and the macro then proceeded to dot me while trying to circle myself. Yay for stupidity. Need some way of retargeting your agroed mobs if the target shifts or is lost.

5. Asking for the moon, I know, but it would be way cool if the macro could switch instruments.

Other than those minor items, this is a very good macro. I wish I could aoe kite my mobs as well as this does :-)

Raebis
a ghoul
a ghoul
Posts: 81
Joined: Fri Dec 12, 2003 6:23 am

Post by Raebis » Mon Dec 29, 2003 2:28 pm

Update on rev5:

1. Pretty much an entire revamp of the way songs are cast to:
Get most economical use of songs (no songs will me stopped to cast another)
Better timing for when casting selos - will implement a song queue system, i.e if selo's is about to wear off put it next in queue

2. Rubber anchor (already talked about this)
3. Better targeting routines
4. INI support

look for it soon in a store near you
Always say what you want to say. Because those who mind, don't matter. And those who matter, don't mind.

User avatar
wilso132
Contributing Member
Contributing Member
Posts: 106
Joined: Thu Oct 17, 2002 11:53 am

Post by wilso132 » Mon Dec 29, 2003 6:42 pm

You're the man Raebis... you're the man.

Raebis
a ghoul
a ghoul
Posts: 81
Joined: Fri Dec 12, 2003 6:23 am

Re's and Updates

Post by Raebis » Tue Dec 30, 2003 3:29 am

El wrote: 1. Healing just doesn't work. I got beat on regularly from agroed mobs, and it didn't kick in once.
Yes i found a bug where healing doesn't work if you don't have level 49 selos. Will be fixed in the next rev (pm me if you want quick-fix)
El wrote:2. There seems to be a timing problem with level 6 selo's. After awhile (>5 minutes?), Selo's would just wear off. No missed notes, no stuns or anything. It would just wear off and not be recast before I was beat into a pulp.
This also when using level 6 selos, if you kill a mob the song list gets reset to zero and sow could wear off then
El wrote:3. With the warnings about #turbo in other threads, is it necessary to have it on?
I dunno
El wrote:4. If you have no target when you start this macro, it stands in one place and shivers. Occasionally (maybe 3 times in 5 hours of testing?), I would lose my target, and then the mobs I had agroed would catch up and beat on me.
Make sure you have numlock/autorun on. Also it doesn't get a target until the target is within range (feature of the no cross zone targeting)
El wrote:Once, I drank a sow potion while kiting, which targeted myself, and the macro then proceeded to dot me while trying to circle myself. Yay for stupidity. Need some way of retargeting your agroed mobs if the target shifts or is lost.
Yes, i'm going to be implementing better target verification as well
El wrote: 5. Asking for the moon, I know, but it would be way cool if the macro could switch instruments.
Holy crap... maybe later
El wrote: Other than those minor items, this is a very good macro. I wish I could aoe kite my mobs as well as this does :-)
Thanks :)

Sorry for the delay on rev5, it might not have as many features as i expected heh... (need to talk to ohmz about a feature request in the searchspawn function for rubber anchor)
Always say what you want to say. Because those who mind, don't matter. And those who matter, don't mind.

ml2517
a grimling bloodguard
a grimling bloodguard
Posts: 1216
Joined: Wed Nov 12, 2003 1:12 am

Post by ml2517 » Tue Dec 30, 2003 4:47 am

Raebis wrote:In testing right now is a sort of rubber anchor, which does exactly what you need... This anchor will target the mob closest to the original starting point instead of targeting the mob closest to u

I will look into the add issue as well.
If I understand your thinking here. (pretty sure I do :lol: you want to do something like this.)

I took a look at the source code for $searchspawn and I *think* this is the proper way to use the loc: option. If it acts funky for some reason try flipping loc: x : y to loc: y : x
I would have expected it to be the reverse since /loc output in EQ is y,x but who knows.
If you are trying to do what I think you are you should be able to do it like this:

Code: Select all

| Run your character to the center of your hunting area and provide a large enough radius so that you stay in a safe area.
| Then you set a variable with your starting loc.
/declare StartX global
/declare StartY global
/declare MobID global
/varset StartX $char(x)
/varset StartY $char(y)

| Then when you do your $searchspawn it should be giving you mobs that are closest to the loc:x:y that you were standing at when you started the script.
| Also note that you can specify level ranges.  This should cut down alot of /if statements I saw in your code.  This will exclude anything not in your range limits.

/varset MobID $searchspawn(npc,range:@minlvl:@maxlvl,loc:@StartX:@StartY,radius:@radiussize)

You shouldn't even have to do a searchspawn with the id: and next statements because each time you call the /varset MobID $searchspawn(npc,range:@minlvl:@maxlvl,loc:@StartX:@StartY,radius:@radiussize) line it should be targeting the closest mob to the starting location within the radius and of a certain level range.

El
a ghoul
a ghoul
Posts: 108
Joined: Mon Dec 29, 2003 12:34 pm

Post by El » Tue Dec 30, 2003 11:49 am

A little more information on the "target lost" problem. I saw it happen last night once in about 3 hours. It may very well be due to my playstyle with aoe kiting. My typical method is to run around agroing a bunch of critters, then take them back to a clear area to aoe kite. Until I'm in kiting mode, I don't have this macro on.

I had a group of agroed cougars in Iceclad, was running back to my kiting area, and had just triggered the macro. Either the targeted mob warped or de-spawned somehow, because I saw it vanish from my camera view, and the target was lost. At that point, I had the macro running, num-lock engaged, and it didn't reacquire a target (pack too far away?), so the macro began to run me in a slow, straight line. Switching to 1st person view, it looked very much like it was "hunting" for a direction to move to. I ended the macro at that point, reacquired the target, and things worked fine from then on.

Just an FYI. Otherwise, your proposed changes sound really good.

Have you ever thought of defining a target kiting area? i.e. run around target some mobs, kite them back to your target kiting area and kite there?

Raebis
a ghoul
a ghoul
Posts: 81
Joined: Fri Dec 12, 2003 6:23 am

Re: ml2517 & El

Post by Raebis » Tue Dec 30, 2003 12:38 pm

ml2517:
Thanks for the info about the level select in $searchspawn, that will definately make things easier and quicker.

As for the loc:x:y and radius, i've tested this and it seems a little buggy to me, it could be my syntax, but i'll look more into it

Too bad i can't just $searchspawn(npc,loc:@x:@y) and have it target the closest mob to x,y - but it needs a radius.


El:
Sounds like you have de-spawning mobs, fortunately it doesn't happen too often. Something you can try, when a target despawns you don't have to end and restart the macro, u can simply target the next mob in the pack, either by /target npc or clicking on it and then the mac will kite selected mob.

I hope to implement a kiting area system in the future, however that would mean the macro has to deal with movement and velocity changes, and that requires some more coding.. namely keypresses and i hate keypresses but we'll see
Always say what you want to say. Because those who mind, don't matter. And those who matter, don't mind.

El
a ghoul
a ghoul
Posts: 108
Joined: Mon Dec 29, 2003 12:34 pm

Post by El » Tue Dec 30, 2003 12:46 pm

/tar npc returns the closest mob of that description?