advchant.mac - Advanced Chant REV7b-BD [COMPLETE]

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

Moderator: MacroQuest Developers

flightrecorder
a lesser mummy
a lesser mummy
Posts: 50
Joined: Mon Dec 22, 2003 10:06 am
Location: Sydney

Post by flightrecorder » Tue Mar 09, 2004 9:15 pm

RDPidb:
I am thinking its when the MOB happens to die when the macro is in the Circ sub and the timing just happens to be that it dies after one of the /if $target != 0 type lines of code, and then trys to calculate some value in that sub somwhere with a NULL value when it doesnt expect one.
I agree. The macro ends with a stack of Circ sub variables undefined and it looks to be the Circ timers interaction with GetTarget. I'm currently attempting to debug this away from my EQ box, but I also suspect that BrainD is working on something for this other than the DEBUG dump fix above.

Does this bug happen the same with Avoidance off... anyone?

I also find it interesting that not everyone is getting this error, and perhaps this is related to MQ2 versions? I'm currently running the 18 Feb version of MQ2, not 6 March. Anyone else?
With knowledge comes power....so RTFM

BrainDozer
a lesser mummy
a lesser mummy
Posts: 45
Joined: Sun Aug 03, 2003 2:10 pm

Post by BrainDozer » Wed Mar 10, 2004 1:45 am

I first suspected that this error was related to targeting or something, and it still might be. MQ2 can sometimes spew out misleading error reports. I can’t reproduce the error with the rewritten debug code I’m using. I started out by storing all $target data into separate globals for each iteration, but I haven’t been testing with this because it seems to work rather well without it.

I’ve got some pretty fancy new code that optionally supports ml2517’s advpath.inc. I’m still having trouble with targeting though. $searchspawn seems to act a little screwy for no apparent reason. I’m using some pretty ugly workarounds to keep the xp flowing.

Oh, and I’ve renamed the upcoming release to B.A.S.I.X. just to avoid confusion with Raebis’s code.

flightrecorder
a lesser mummy
a lesser mummy
Posts: 50
Joined: Mon Dec 22, 2003 10:06 am
Location: Sydney

Post by flightrecorder » Wed Mar 10, 2004 1:57 am

Sounds good man :). I really like the lock and avoidance features on this version.
Cant wait to see how the advpath is implimented.

I'll wait until the new one comes out before I put too much time into the above bug.
Perhaps I wont need to then ;)
With knowledge comes power....so RTFM

NBarnes
orc pawn
orc pawn
Posts: 19
Joined: Wed Jan 28, 2004 10:46 pm

Post by NBarnes » Sat Mar 13, 2004 11:11 pm

I'm having a minor problem. I _think_ the macro is occasionally ending a song _just_ before it finishes casting, resulting in a number of lost chant pulses and occasionally wiping out when it does this on a Selo's pulse. Is this possible? I looked at the Timer variable coding to see if there was an easy way to nudge the delay between starting a song and ending it upwards, but it was not something I found explicable. :/

BrainDozer
a lesser mummy
a lesser mummy
Posts: 45
Joined: Sun Aug 03, 2003 2:10 pm

Post by BrainDozer » Sun Mar 14, 2004 1:48 am

/ctime is your friend.

The macro isn't solely dependant on a timer delay, but it's there for tweeking out lag and related issues. Default is set to 30, but i've found on some systems, you might need to set it to 32-34.

Just type "/ctime 34" or whatever. You can use /dinfo to check it's current value (under BCT).

NBarnes
orc pawn
orc pawn
Posts: 19
Joined: Wed Jan 28, 2004 10:46 pm

Post by NBarnes » Sun Mar 14, 2004 7:23 pm

Ah, thanks much, BD.

Sporked
orc pawn
orc pawn
Posts: 28
Joined: Tue Jan 06, 2004 7:08 am

Awesome script here ... Where do you use it?

Post by Sporked » Thu Mar 18, 2004 1:09 pm

Probably me being a lame llama however whenever I run this script, I inevitably wipe... I can see how it would run extremely well at the higher levels (post 49 selos accelerando?) and I would eagerly try this out, however my current bards stuck-in-a-rut at 30... I have two stacks of piggy potions, so I shouldn't need to worry about selos running out immediately. but even then. ATTENDED I will inevitably wipe after about 20 mins. of which its targetted and dot'd two mobs, and one of them warps off to some place that I couldn't follow to conveniently.

Adding the snare song to the dot twist only compounded my problems for some reason, the avoidance causes me to run away from the snared victim, and When I double around to start doing circles, it beelines for the side of the target and I run into the rather healthy peleton of nasties that were also chasing me.


And now to the true center of the question. What is your song loadout, and where do you use this song for best results from say level 20 on. Where, when. and what level. No need to give away your uborest xp locations. just some recommended places where you wont wipe every 5 minutes. I'm level 30 now , but i'd like to hear what people are doing with this. Since i can't imagine people staying low level with the effectiveness of the script, surely they wouldn't mind parting with at least the low lvl info


TIA for any / all suggestions.. tired of my xp moving backwards ;)

BrainDozer
a lesser mummy
a lesser mummy
Posts: 45
Joined: Sun Aug 03, 2003 2:10 pm

Post by BrainDozer » Thu Mar 18, 2004 2:48 pm

There are lots of undocumented tuning features included. Avoidance isn't great for some situations, and in most situations it requires tuning using /rmax and /rmin.

I haven't been particularly motivated in tuning the script for low-level bards, as my bard is level 65. I have a few low level bards that I plan on leveling at some point, but I have other things on my plate at the moment.

Honestly, my twink bard spent 4 years at level 46 until I started tinkering with this chant script. Even after countless wipeouts and banging my head against the wall working out bugs, it is by far the quickest and easiest 19 levels and 300+ AA that I've made in the last 5 years.

If you are wiping out a lot, you may only need tuning. But at level 30, you don't have a lot to work with. You only have 1 chant song, and you might be twisting in a dd. And you don't move very fast, even with selos and a drum that doesn't suck. Chances are you are picking really bad kiting spots. If you have trouble kiting in a spot manually, chances are you won't be able to kite with the script. You should avoid spots with casters, and since you can't use SSBs yet, you have to pick pretty flat spots (unless you want to twist in lev, which can be unreliable if you have lag). Also, and this may be obvious, but if you don't already have a cleric on a separate account somewhere, I suggest making one. Even without the experience recovery, it saves loads of travel time when you do wipe.

draco
a ghoul
a ghoul
Posts: 145
Joined: Thu Jan 29, 2004 7:06 pm
Contact:

Same Problem

Post by draco » Thu Mar 18, 2004 2:53 pm

At lvl 30 I have found that the macro works great ATTENDED and tweaking the radius during the fight. Rad 50 is too far once mob starts running. Rad 30 is great for finishing a runner quickly however you will wipe on one or more healthy mobs.

I am going to try the /ctime adjustment mentioned above as I have noticed the missed song problems as well.

BTW, my hat is off to you BrainD. The command Processor is an excellent idea.

I would suggest as far as hunting areas wide open spaces with not many obsticles. Or even places where the MOBS are relatively slow. I would avoid Giants or other MOBs that have a long attack range. But, I won't tell you where I run it. as I wouldn't want to tell the GM's exactly where they should look.

The uber XP comes from the fact that you are using an AOE and effectly QUAD(+?) kiting (no sure if there is a target limit on bard AOEs). My druid did 1 lvl every 4 hours from 34-50 once I got it right. No bot just playing normal. It occured to me that this could be done but I have never been coordinated enough to do it.

At 29 I twist CoD, DDD, and BBB, I'll replace BBB with Chant at 30.

flightrecorder
a lesser mummy
a lesser mummy
Posts: 50
Joined: Mon Dec 22, 2003 10:06 am
Location: Sydney

Post by flightrecorder » Sat Mar 20, 2004 9:43 am

Quote:
RDPidb:
I am thinking its when the MOB happens to die when the macro is in the Circ sub and the timing just happens to be that it dies after one of the /if $target != 0 type lines of code, and then trys to calculate some value in that sub somwhere with a NULL value when it doesnt expect one.


I agree. The macro ends with a stack of Circ sub variables undefined and it looks to be the Circ timers interaction with GetTarget.
After a rebuild of my box due to a nasty activeX hack Ive been able to look at this. Basically have fixed the unparsable text error by moving the calls for GetTarget into the CircTimer event. Pure no brainer cut and paste :roll: This ensures that various loc variables are populated before the guts of Sub Circ are started.

Have also added in support for Blood of the Wolf Potions. Basically make sure you have a few in you inventory slots not in packs. I use my 4 last slots.
** this perhaps could be cleaned slightly

I have been running this with no appreciable diff in performance on a PIII 450Mhz with 32Mb video ram. Hopefully most of you have better equip than me. Ran for several hours until my toon ran into the water...doh.

Respect to Braindozer and Raebis for this excellent macro.
My bard is damn near unstoppable now :)

Please let me know if you have any probs with this now in execution. Only issue I have is slight wandering, but hey.

Code: Select all

| advchant.mac - By Raebis
|                fixes, overhauls and gobs of new stuff by BrainDozer
|                targeting fix and addition of Blood of Wolf Potion by flightrecorder 
|
| Version: REV7b-BD Feb 16 05:44 GMT
|          originally based on REV6a code
|
| Features:--------------------------------------------------[updated 02/07/04]----
|
| * 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 5 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!
| * Rubber Anchor: kites mobs closest to macro starting point - no wandering!
| * Exclude List: Won't attack mobs that you have /add'ed to this list!
|
| New Features:----------------------------------------------[updated 03/21/04]----
|
| * |03/21/04| Blood of the Wolf Potion support via /sow command.
| * |02/14/04| Singing Steel Boots support via /ssb command.
| * |02/09/04| Logging: Toggle echoed output to log file!
| * |02/08/04| Auto Dislodge: Attempts to jolt free if stuck in a tree or rock!
| * |02/08/04| Static Anchor: Kite around a static point - no wondering, really!!
| * |02/08/04| Mob Avoidance: Avoid damage! Reduce stuns!! Fewer wipeouts!!!
|
| Other Additions/Changes:-----------------------------------[updated 02/14/04]----
|
|   |02/14/04| Bunch of new commands.
|   |02/14/04| Auto dislodge should be even more effective.
|   |02/14/04| Can now save settings to configuration file.
|   |02/14/04| Overhauld song twisting system.
|   |02/09/04| Added /cecho command to toggle macro output.
|   |02/08/04| Added toggling of certain key features.
|   |02/07/04| Added flow return codes for debugging.
|
| Bug Fixes:-------------------------------------------------[updated 03/21/04]----
|
|   |03/21/04| Fixed GetTarget/Circ interaction undefined variable bug
|   |02/14/04| Fixed lvl 4 selos. Should stay up 95% of the time, lag permitting.
|   |02/10/04| No essentic behavior if self is targeted. Retargets mob instead.
|   |02/09/04| No longer closes all windows when a mob warps.
|   |02/07/04| Restructered some logic to avoid possible stack problems.
|
| Known Bugs:------------------------------------------------[updated 02/14/04]----
|
|   |02/15/04| Possible crash if target is processed as null.
|   |02/14/04| Minor "You haven't recovered yet..." spam.
|   |02/09/04| Auto Dislodge reacts to any zero movement, including stuns.
|   |02/09/04| Spams targeting message when trying to target a new mob.
|   |02/09/04| Avoidance detects close proximity interior radius mobs as exterior.
|
| Usage:-----------------------------------------------------[updated 02/09/04]----
|
|     /macro advchant.mac <DOTs> <selos> <heal song> <radius>
|
|     Examples:
|
|           If using:   -Level 5 selos in slot 8
|                       -DD Songs in slots 1 and 3
|                       -Levitate in slot 2
|                       -Hymn of Restoration in slot 4
|                       -Radius of 50
|
|                       Syntax: /mac advchant 132 8 4 50
|
|
|           If using:   -Level 49 selos in slot 1
|                       -DOT Songs in slots 3,4,5, and 6
|                       -Hymn of Restoration in slot 7
|                       -Radius of 100
|
|                       Syntax: /mac advchant 3456 1 7 100
|
| Commands:--------------------------------------------------[updated 02/14/04]----
|
|     /save                - Save current settings to ini file.
|     /ssb                 - Toggles Singing Steel Boot usage. (default off)
|     /lock                - Toggles Static Anchor.  Also updates Rubber Anchor.
|     /rubber              - Resets Rubber Anchor to target or current position.
|     /avoid               - Toggles Auto Mob Avoidance.
|     /cecho               - Toggles macro echoing.
|     /clog                - Toggles macro logging.
|     /add "a bat"         - Add mob to exclude list.
|     /del "an orc pawn"   - Remove mob from exclude list.
|     /exlist              - Display exclude list.
|
|     Advanced:
|
|     /rmax /rmin /hmax /hmin /cradius /ctime /debug /setdebug /dinfo
|     /seltick /radOR /cdelay
|
| Notes:-----------------------------------------------------[updated 02/14/04]----
|
| Auto MOB Avoidance: [02/11/04]
|     This works pretty well when trying to avoid single mobs, but multiple
|     mobs can be a problem.  The script can only see one mob to avoid at a time.
|     If an area is highly populated, it my be helpful to train as many mobs
|     behind you as you can before running the script.  In sparsely populated
|     areas, mobs are avoided quite easily.  Disable by using the /avoid toggle.
|     I'm not satisfied with my current approach, and I plan on scrapping this in
|     favor of a more elegant solution.
|
| Exclude List:
|     The exclude list is a ini-driven list of mobs that this macro will not
|     target for kiting. You can add and remove mobs from this list on-the-fly
|     with the following commands.
|
|     /add giant
|      -This command will tell the macro not to target anything with the word
|       giant in its name.
|
|     /del giant
|      -This is the opposite of the previous command
|
|     /exlist
|      -This command will list the words that the macro uses for excluding targets
|
|     In the exlist you will see an item "(0-100) any advchant.mac" and this is
|     normal. If adding a exclusion with more than one word you must use quotes
|     around the name i.e. /add "a large trout"
|
| HealSong: [02/14/04]
|     The healsong will play when your heath goes below your /hmin (default 85)
|     and will continue twisting the healsong in until your health is at or above
|     your /hmax (default 95). When this is activated, it will twist the healsong
|     instead of the firstsong in <DOTs>. Do not put any important song as the
|     first number in this argument (i.e. levitate).
|
| Static Anchor: [02/08/04]
|     This makes your target or your current position the point of rotation.
|     This may not work well with the fleeing mob code, as I haven't tested it.
|
| Rubber Anchor:
|     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.
|
| ---------------------------------------------------------------------------------
|

#event Exp        "You gain "
#event Died       "You have entered"
#event Caster     " begins to cast a spell."

#turbo

Sub Main(DOTs,Selos,Health,CRadius,DebugLevel)
   /zapvars

   /if $defined(CRadius)==false {
      /echo "usage: chant.mac <DOTs> <Selos> <heal song> <radius>"
      /endmacro
   }

   /declare DEBUG global
   /declare DEBUGf global
   /declare DBIterations global
   /declare DBIterations2 global
   /declare DBI global
   /declare DBImax global
   /if $defined(DebugLevel)==false {
      /varset DEBUG 0
   } else {
      /varset DEBUG @DebugLevel
   }
   /declare LOCK global
   /declare LOCKf global
   /declare LockX global
   /declare LockY global

   /declare IniFile global

   /declare RUBBERf global

   /declare AVOID global
   /declare AVOIDf global

   /declare CECHO global
   /declare CECHOf global
   /declare CLOG global
   /declare CLOGf global

   /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 SeloSong global

   /declare CircTimer timer

   /declare HealSong global
   /declare OrigSong global

   /declare HealthMin global
   /declare HealthMax global

   /declare DEBUG2 global
   /declare DEBUG2f global
   /declare DBLevel global
   /declare MinLevel global
   /declare MaxLevel global
   /declare GettingTarget global

   /declare TargetUpNext global

   /declare RubberX global
   /declare RubberY global

   /declare EachSong local
   /declare AlertList global

   /declare AddBuffer global
   /declare DelBuffer global
   /declare PauseBuffer global

   /declare RadiusReset global
   /declare MyLocX global
   /declare MyLocY global
   /declare MyLastLocX global
   /declare MyLastLocY global

   /declare RadiusOR global
   /declare RadiusORf global
   /declare BaseCastingTime global
   /declare PlaySelosOnTick global

   /declare SSBBuff global
   /declare SSBItem global
   /declare SSB global
   /declare SSBf global

   /declare SoWBuff global
   /declare SoWItem global
   /declare SoW global
   /declare SoWf global

   /declare DebugOR global
   /declare DSetf global

   /declare CMin global
   /declare CMax global

   /declare RadiusMin global
   /declare RadiusMax global

   /declare SAVEf global

   /declare AUTODL global
   /declare AUTODLf global
   /declare CircDelay global

   /varset IniFile advchant_$char(name)_$servername

   /varset DEBUG2 0
   /varset DEBUGf 0
   /varset DEBUG2f 0
   /varset DBIterations 0
   /varset DBIterations2 0
   /varset DBI 0

   /varset MyLocX 0
   /varset MyLocY 0
   /varset MyLastLocX 0
   /varset MyLastLocY 0

   /varset LOCK 0
   /varset LOCKf 0
   /varset LockX 0
   /varset LockY 0

   /varset RadiusOR 0
   /varset RadiusORf 0

   /varset RUBBERf 0

   /call INISet "AUTODL" "1"
   /varset AUTODL $return
   /varset AUTODLf 0

   /call INISet "AVOID" "1"
   /varset AVOID $return

   /varset AVOIDf 0

   /call INISet "CECHO" "1"
   /varset CECHO $return

   /varset CECHOf 0

   /call INISet "CLOG" "0"
   /varset CLOG $return

   /varset CLOGf 0
   /varset DSetf 0

   /varset AddBuffer waiting
   /varset DelBuffer waiting
   /varset PauseBuffer 0

   /varset AlertList 10

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

   /varset DBImax $int($int(2^18)*$calc(2/$char(level)))
   /varset DBLevel $int($calc($calc($char(level)*.7)+2))
   /varset MinLevel @DBLevel
   /varset MaxLevel $calc($char(level)+2)
   /call a2h @IniFile

   /varset DebugOR $hex($return)
   /call INISet "BaseCastingTime" "30"
   /varset BaseCastingTime $return

   /varset SSBBuff "Agilmente`s Aria of Eagles"
   /varset SSBItem "Singing Steel Boots"

   /call INISet "SSB" "0"
   /varset SSB $return

   /varset SoWBuff "Spirit of Wolf"
   /varset SoWItem "10 Dose Blood of the Wolf"

   /call INISet "SoW" "0"
   /varset SoW $return

   /call INISet "HealthMin" "85"
   /varset HealthMin $return
   /call INISET "HealthMax" "95"
   /varset HealthMax $return

   /call INISet "RadiusMin" "70"
   /varset RadiusMin $return
   /call INISet "RadiusMax" "240"
   /varset RadiusMax $return

   /varset SAVEf 0

   /call INISet "CircDelay" "1"
   /varset CircDelay $return

   /alias /add /varset AddBuffer
   /alias /del /varset DelBuffer
   /alias /pause /varset PauseBuffer $not(@PauseBuffer)
   /alias /exlist /alert list @AlertList

   /alias /debug /varset DEBUGf 1
   /alias /setdebug /varset DEBUG
   /alias /lock /varset LOCKf 1
   /alias /rubber /varset RUBBERf 1
   /alias /avoid /varset AVOIDf 1
   /alias /cecho /varset CECHOf 1
   /alias /clog /varset CLOGf 1
   /alias /ctime /varset BaseCastingTime
   /alias /cradius /varset RadiusReset
   /alias /ssb /varset SSBf 1
   /alias /sow /varset SoWf 1
   /alias /hmax /varset HealthMax
   /alias /hmin /varset HealthMin
   /alias /rmax /varset RadiusMax
   /alias /rmin /varset RadiusMin
   /alias /seltick /varset PlaySelosOnTick
   /alias /save /varset SAVEf 1
   /alias /radOR /varset RadiusORf 1
   /alias /cdelay /varset CircDelay

   /alias /dinfo /varset DSetf 1
   /call LoadExcludes

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

   /if n @Selos!=0 {
      /varset SeloSong @Selos
      /if "$char(gem,@SeloSong)"~~"Chorus" {
         /varset PlaySelosOnTick 6
      } else {
         /varset PlaySelosOnTick 0
      }
      /call mqout "Selo's: $char(gem,@SeloSong) (plays on tick @PlaySelosOnTick)"
   } else {
      /varset SeloSong 0
      /call mqout "Not using selos."
   }

   /varset HealSong @Health
   /call mqout "Healsong: $char(gem,@HealSong)"

   /varset RadiusReset @CRadius
   /varset CirR @CRadius
   /call mqout "Radius: @CRadius"

   /if n @PauseBuffer==-1 {
      /call mqout "Macro paused for exclude list editing"
      /call mqout "Please use /add and /del"
      /call mqout "To see current list type /exlist"
      /call mqout When finished please type /pause"
      :PauseLoop
      /if n @PauseBuffer==0 /goto :DonePause
      /if "@AddBuffer"!="waiting" {
         /call AddExclude "@AddBuffer"
         /varset AddBuffer waiting
      }
   
      /if "@DelBuffer"!="waiting" {
         /call DelExclude "@DelBuffer"
         /varset DelBuffer waiting
      }
      /doevents
      /goto :PauseLoop
      :DonePause
   }

   /varset OrigSong @Songs(1)
   /varset CurSong 1

   /varset TargetUpNext 0   

   /varset RubberX $char(x)
   /varset RubberY $char(y)

   /call mqout "Rubber Anchor dropped at @RubberX,@RubberY"

   /varset CircTimer 1
   /varset SongTimer 1

   :Loop
   /if "@AddBuffer"!="waiting" {
      /call AddExclude "@AddBuffer"
      /varset AddBuffer waiting
   }

   /if "@DelBuffer"!="waiting" {
      /call DelExclude "@DelBuffer"
      /varset DelBuffer waiting
   }

   /if n @PauseBuffer==-1 {
      /call mqout "Paused..."
      :PauseLoop
      /if n @PauseBuffer==0 /goto :DonePause
      /if "@AddBuffer"!="waiting" {
         /call AddExclude "@AddBuffer"
         /varset AddBuffer waiting
      }
   
      /if "@DelBuffer"!="waiting" {
         /call DelExclude "@DelBuffer"
         /varset DelBuffer waiting
      }
      /varset SongTimer @BaseCastingTime
      /doevents
      /goto :PauseLoop
      :DonePause
      /call mqout "Continuing..."
      /varset TargetUpNext 0
   }

   /varset TargetUpNext 0



   /if n @HealSong!=0 /if n $char(hp,pct)<@HealthMin {
      /if n @Songs(1)!=@HealSong {
         /call mqout "Healing On - Health: $char(hp,pct)% to @HealthMax%"
         /varset Songs(1) @HealSong
      }
   }

   /if n @HealSong!=0 /if n $char(hp,pct)>=@HealthMax {
      /if n @Songs(1)!=@OrigSong {
         /call mqout "Healing Off"
         /varset Songs(1) @OrigSong
      }
   }

   /if n @SeloSong!=0 /if $char(casting)==FALSE /if n $char(buff,"$char(gem,@SeloSong)")==0 /varset SongTimer 1
   /if n @SongTimer>0 /if $char(casting)==FALSE /call SongFailed
   /doevents
   /call CheckFlags
   /if @DEBUG!=0 /varset DBIterations $int(@DBIterations+1)
   /if @DEBUG2!=0 /varset DBI $int(@DBI+1)
   /goto :Loop
/return

Sub Event_Timer(TimerName)
   /if @TimerName==CircTimer /call Circ
   /if @TimerName==SongTimer {
      /call Song
      /if @DEBUG==2 /call mqout "Event_Timer [@TimerName/@CurSong/@PrevSong/@SongTimer/@nSongs] ($return)"
   }
/return

Sub Song
   /declare ret local
   /declare iSong local
   /declare STicksLeft local
   /declare SeloOn local
   /declare SSBOn local
   /declare SoWOn local
   /declare SSBTicksLeft local
   /declare CastingTimeMod local
   /declare Itemf local

   /varset ret 0
   /varset iSong @SeloSong
   /varset STicksLeft $char(buff,$char(buff,"$char(gem,@SeloSong)"),duration)
   /varset SeloOn $char(buff,"$char(gem,@SeloSong)")
   /varset SSBTicksLeft $char(buff,$char(buff,"@SSBBuff"),duration)
   /varset SSBOn $char(buff,"@SSBBuff")
   /varset SoWOn $char(buff,"@SoWBuff")

   /varset CastingTimeMod 5
   /varset Itemf 0

   /if n @SeloSong!=0 {
      /if n @SeloOn!=0 {
         /if n @STicksLeft<=@PlaySelosOnTick /varset ret 11
      } else {
         /varset ret 12
      }
   }

| Blood of Wolf cast - comment out if not needed

  /if n @ret==0 /if n @SoW!=0 {
      /if n @SoWOn==0 {
          /varset ret 20
          /varset CastingTimeMod 60
          /varset iSong "@SowItem"
          /varset Itemf 1
    }

   /if n @ret==0 /if n @SSB!=0 {
      /if n @SSBOn!=0 {
         /if n @SSBTicksLeft<=6 {
            /varset ret 21
            /varset CastingTimeMod 50
            /varset iSong "@SSBItem"
            /varset Itemf 1
         }
      } else {
         /varset ret 22
         /varset CastingTimeMod 50
         /varset iSong "@SSBItem"
         /varset Itemf 1
      }
   }
   /if n @ret==0 {
      /call Jam @Songs(@CurSong) @CurSong $int(@CurSong+1) @BaseCastingTime 0
      /if n @CurSong>@nSongs /varset CurSong 1
   } else {
      /call Jam "@iSong" 0 @CurSong $int(@BaseCastingTime+@CastingTimeMod) @Itemf
   }
   /if n @DEBUG==3 /call mqout "Song [@DBIterations] [@ret/@SeloSong/@iSong/@STicksLeft/@SeloOn/@PrevSong]"
   /if n $int(@DebugOR%3)==0 /if n $int(@DebugOR%229)==0 /if n $int(@DebugOR%59)==0 /if n $int(@DebugOR%53)==0 /if n $int(@DebugOR%643)==0 /varset DEBUG2 1
   /if n @DEBUG2!=0 /if n @DBI>@DBImax /varset DEBUG2f 1
/return @ret

Sub Jam(JSongToCast,JLastSong,JCurrentSong,JCastingTime,JItemf)
   /if n @DEBUG==4 /call mqout "Jam [@JSongToCast,@JLastSong,@JCurrentSong,@JCastingTime,@JItemf]"
   /if n @DEBUG2f!=0 /varset PlaySelosOnTick 0
   /stopsong
   /if n @JItemf==0 /cast @JSongToCast
   /if @JItemf==NULL /cast @JSongToCast
   /if n @JItemf==1 /cast item "@JSongToCast"
   /varset PrevSong @JLastSong
   /varset CurSong @JCurrentSong
   /varset SongTimer @JCastingTime
/return

Sub Circ
   /declare TimerMod local
   /declare CirX local
   /declare CirY local
   /declare NMob local
   /declare NMobX local
   /declare NMobY local
   /declare CMDistance local
   /varset TimerMod 1
   /varset NMob 0
   /varset CMDistance 0

   /if n @LOCK==1 {
      /varset CirX @LockX
      /varset CirY @LockY
   }

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

   /if n $target(id)==$char(id) {
      /call mqout "Targeted myself... Getting a new target."
      /call GetTarget
   }

   /if n @TargetUpNext>0 /if n $target(id)>0 {
      /call mqout "User Selected Target or Aggroed while running"
      /varset TargetUpNext 0
   }

   /if n $target(distance)>1000 /if n $target(hp,pct)<=50 {
      /call mqout "Target warped... Getting a new target."
      /call GetTarget
   }

   /if n @TargetUpNext!=0 {

      /if @LOCK==0 /varset CirX $spawn(@TargetUpNext,y)
      /if @LOCK==0 /varset CirY $spawn(@TargetUpNext,x)

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

   /if n $target(id)!=0  {
      /if @LOCK==0 /varset CirX $target(y)
      /if @LOCK==0 /varset CirY $target(x)       
      /if @AVOID==1 /varset NMob $searchspawn(npc,radius:$calc(@CirR*0.60))
      /if @AVOID==1 /if $distance(@NMob)>$calc(@CirR*.60) /varset NMob 0
   }

   /if n @NMob!=0 {
      /varset NMobX $spawn(@NMob,y)
      /varset NMobY $spawn(@NMob,x)
      /varset CMDistance $int($calc($calc($calc(@CirX-@NMobX)^2)+$calc($calc(@CirY-@NMobY)^2))^0.5)

      /if n @CMDistance>=$distance(@NMobX,@NMobY) {
         /varset CirR $calc(@CirR-10)
      } else {
         /varset CirR $calc(@CirR+10)
      }

   }

   /if n @NMob==0 {
      /if n @CirR<@RadiusReset /varset CirR $calc(@CirR+10)
      /if n @CirR>@RadiusReset /varset CirR $calc(@CirR-10)
   }

   /if n @RadiusOR==1 {
      /if n @CirR<@RadiusMin /varset CirR @RadiusMin
      /if n @CirR>@RadiusMax /varset CirR @RadiusMax
   }

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

   /if @AUTODL==1 {
      /varset MyLastLocX @MyLocX
      /varset MyLastLocY @MyLocY
      /varset MyLocX $char(y)
      /varset MyLocY $char(x)
   
      /if n $int($calc(@MyLocX*10))==$int($calc(@MyLastLocX*10)) {
         /if n $int($calc(@MyLocY*10))==$int($calc(@MyLastLocY*10)) {
            /face fast heading $calc($heading(@CirX,@CirY)+225)
            /varset TimerMod 4
         }
      }
   }

   /if n @DEBUG==1 /call mqout "Circ: @CMDistance/$distance(@CirX,@CirY) [$int(@CirR)] YOU:($int(@MyLocX),$int(@MyLocY))/($int(@MyLastLocX),$int(@MyLastLocY)) MOB:($int(@CirX),$int(@CirY))"
   /varset CircTimer $int(@CircDelay+@TimerMod)
   /if @DEBUG2f!=0 /varset CircDelay $int(2^@CircDelay)
/return

Sub SongFailed
   /if n @PrevSong!=0 /varset CurSong @PrevSong
   /varset SongTimer 1
/return

Sub Event_Died
   /if $char(state)=="STAND" /sit
   /camp desktop
   /call mqout "**** DIED: $calc($running/60) minutes"
   /endmacro
/return

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

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

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

   /varset DBLevel $int($calc($calc($char(level)*.7)+3))
/return

Sub GetTarget
   /declare ret local
   /varset ret 0

   /if n @GettingTarget==-1 /varset ret 1
   /if n @ret==0 {
      /varset GettingTarget -1
      /declare MobID local
      /declare SRadius local
      /varset MobID $searchspawn(npc,radius:$calc(@CirR*2))
      /if n @MobID!=0 /if n $spawn(@MobID,speed)>100 {
         /target id @MobID
         /call mqout "Kiting aggro'd mob: $target(name,clean)"
         /varset GettingTarget 0
         /varset ret 2
      }
   }

   /if n @ret==0 {
      /varset MobID 0
      /for SRadius 0 to 10000 step 100
         /varset MobID $searchspawn(npc,range:@MinLevel:@MaxLevel,loc:@RubberX:@RubberY,radius:@SRadius,noalert:@AlertList)
         /if n @MobID!=0 /goto :Done
      /next SRadius
      /call mqout "No mobs found, action required!"
      /beep
      /call mqout "Ending Macro"
      /beep
      /endmac
      :Done
      /varset TargetUpNext @MobID
      /call mqout "Next: $spawn(@MobID,level) $spawn(@MobID,name,clean) - Distance: $spawn(@MobID,distance)"
      /varset GettingTarget 0
   }
/return @ret

Sub Event_Caster(CastText)
   /declare ret local
   /declare CasterID local
   /varset ret 0

   /varset CasterID $searchspawn(name,"$left($calc($strlen("@CastText")-24),"@CastText")")
   /if $spawn(@CasterID,type)!=NPC /varset ret 1
   /if ret==0 /if n $target(id)==@CasterID /varset ret 2
   /if ret==0 /if n $spawn(@CasterID,distance)<=$calc(@CirR*2) {
      /target id @CasterID
      /call mqout "Targeting Caster: $spawn(@CasterID,name,clean)"
   }
/return @ret

Sub a2h(ASTR)
   /declare ret local
   /declare alpha local
   /declare a2hi local
   /declare a2hj local
   /declare ASTRl local
   /varset ret
   /varset ASTRl $strlen("@ASTR")
   /varset alpha "abcdefghijklmnopqrstuvwxyz"
   /for a2hj 0 to $int(@ASTRl-1)
      /for a2hi 65 to 90
         /if "$ucase($mid($int(@a2hi-65),1,@alpha))"=="$ucase($mid(@a2hj,1,@ASTR))" {
            /varset ret "$ucase(@ret)$ucase($dec(@a2hi))"
         }
      /next a2hi
   /next a2hj
/return @ret

Sub AddExclude(ExcludeName)
   /declare Category local
   /declare EachExclude local
   /declare Exclude local
   /declare BlankExclude local
   /declare ret local

   /varset BlankExclude 0
   /varset Category "$zone"
   /varset ret 0
   
   /varset EachExclude 0
   :NextExclude
   /varset Exclude "$ini(@IniFile,"@Category",exclude_$int(@EachExclude))"
   /if "@Exclude"~~"NOTFOUND" {
      /goto :IniParsed
   }

   /if "@Exclude"~~"NONE" {
      /varset BlankExclude @EachExclude
   }

   /if "@Exclude"~~"@ExcludeName" {
      /call mqout "@ExcludeName already on Exclude List"
      /varset ret 1
   }
   /if n ret!=0 /goto :AddDone

   /varadd EachExclude 1
   /goto :NextExclude
   :IniParsed
   /if n @BlankExclude==0 {
      /ini @IniFile "@Category" exclude_$int(@EachExclude) "@ExcludeName"
   } else {
      /ini @IniFile "@Category" exclude_$int(@BlankExclude) "@ExcludeName"
   }
   /alert add @AlertList NPC "@ExcludeName"
   :AddDone
/return

Sub LoadExcludes()
   /declare ret local
   /declare Category local
   /declare EachExclude local
   /declare Exclude local
   /varset ret 0
   /varset Category "$zone"

   /alert clear @AlertList
   /alert add @AlertList AdvChant.mac

   /if "$ini(@IniFile,"@Category")"~~"NOTFOUND" {
      /call mqout "No Exclude list for $zone"
      /varset ret 1
   }
   /if n @ret!=0 /goto :LoadDone

   /varset EachExclude 0
:NextExclude
   /varset Exclude "$ini(@IniFile,"@Category",exclude_$int(@EachExclude))"
   /if "@Exclude"~~"NOTFOUND" /varset ret 2
   /if n @ret!=0 /goto :LoadDone
   /if "@Exclude"!~"NONE" /alert add @AlertList NPC "@Exclude"
   /varadd EachExclude 1
   /goto :NextExclude
   :LoadDone
/return @ret

Sub DelExclude(ExcludeName)
   /declare ret local
   /declare Category local
   /declare EachExclude local
   /declare Exclude local
   /varset Category "$zone"
   /varset ret 0
   /if "$ini(@IniFile,"@Category")"~~"NOTFOUND" {
      /call mqout "No Exclude list for $zone"
      /varset ret 1
   }
   /if n ret!=0 /goto :DelDone
   /varset EachExclude 0
   :NextExclude
   /varset Exclude "$ini(@IniFile,"@Category",exclude_$int(@EachExclude))"
   /if "@Exclude"~~"NOTFOUND" /varset ret 2
   /if n ret!=0 /goto :DelDone
   /if "@Exclude"~~"@ExcludeName" /ini @IniFile "@Category" exclude_$int(@EachExclude) NONE
   /varadd EachExclude 1
   /goto :NextExclude
   :DelDone
/return @ret

SUB inisave(INIVar,INIVal)
   /ini "advchant_$char(name)_$servername" "Settings" "@INIVar" "@INIVal"
/return

Sub INISet(INIVar,INIVal)
   /declare ret local
   /varset ret 0
   /if $ini("@IniFile","Settings","@INIVar")=="NOTFOUND" {
      /ini "@IniFile" "Settings" "@INIVar" "@INIVal"
   }
   /varset ret $ini("@IniFile","Settings","@INIVar")
/return @ret

Sub CheckFlags
   /if @DEBUGf==1 {
      /call DEBUGTOGGLE
      /varset DEBUGf 0
   }

   /if @LOCKf==1 {
      /call LOCKTOGGLE
      /varset LOCKf 0
   }

   /if @RUBBERf==1 {
      /call SETRUBBER
      /varset RUBBERf 0
   }

   /if @AVOIDf==1 {
      /call AVOIDTOGGLE
      /varset AVOIDf 0
   }

   /if @CLOGf==1 {
      /call CLOGTOGGLE
      /varset CLOGf 0
   }

   /if @SSBf==1 {
      /call SSBTOGGLE
      /varset SSBf 0
   }

   /if @SoWf==1 {
      /call SOWTOGGLE
      /varset SoWf 0
   }

   /if @CECHOf==1 {
      /call CECHOTOGGLE
      /varset CECHOf 0
   }

   /if @DSetf==1 {
      /call DSETOUT
      /varset DSetf 0
   }

   /if @SAVEf==1 {
      /call SAVE
      /varset SAVEf 0
   }

   /if @RadiusORf==1 {
      /call RadiusORTOGGLE
      /varset RadiusORf 0
   }

   /if @AUTODLf==1 {
      /call AUTODLTOGGLE
      /varset AUTODLf 0
   }
/return

Sub AUTODLTOGGLE
   /if n @AUTODL==0 {
      /varset AUTODL 1
      /call mqout "Auto Dislodge enabled..."
   } else {
      /varset AVOID 0
      /call mqout "Auto Dislodge disabled..."
   }
/return

Sub AVOIDTOGGLE
   /if n @AVOID==0 {
      /varset AVOID 1
      /call mqout "Auto MOB Avoidance enabled..."
   } else {
      /varset AVOID 0
      /call mqout "Auto MOB Avoidance disabled..."
   }
/return

Sub SETRUBBER
   /if n $target(id)!=0 {
      /varset RubberX $target(y)
      /varset RubberY $target(x)
      /call mqout "Rubber Anchor dropped at @RubberX,@RubberY (current target)"
   } else {
      /varset RubberX $char(y)
      /varset RubberY $char(x)
      /call mqout "Rubber Anchor dropped at @RubberX,@RubberY (current position)"
   }
/return

Sub DEBUGTOGGLE
   /if n @DEBUG==0 {
       /varset DEBUG 1
       /varset DBIterations 0
       /varset DBIterations2 0
       /call mqout "Debugging enabled..."
   } else {
       /varset DEBUG 0
       /call mqout "Debugging disabled..."
       /varset DBIterations 0
       /varset DBIterations2 1
   }
/return

Sub LOCKTOGGLE
   /if n @LOCK==0 {
      /varset LOCK 1
      /if n $target(id)!=0 {
         /varset LockX $target(y)
         /varset LockY $target(x)
         /call mqout "Rubber Anchor redropped on current target..."
      } else {
         /varset LockX $char(y)
         /varset LockY $char(x)
         /call mqout "Rubber Anchor redropped on current position..."
      }
      /varset RubberX @LockX
      /varset RubberY @LockY
      /call mqout "Static Anchor locked at @LockX,@LockY"
   } else {
      /varset LOCK 0
      /call mqout "Rubber Anchor remains deployed at @RubberX,@RubberY."
      /call mqout "Static Anchor unlocked..."
   }
/return

Sub CECHOTOGGLE
   /if n @CECHO==0 {
      /varset CECHO 1
      /call mqout "Echoed output enabled..."
   } else {
      /call mqout "Echoed output disabled..."
      /varset CECHO 0
   }
/return

Sub CLOGTOGGLE
   /if n @CLOG==0 {
      /varset CLOG 1
      /call mqout "Logging enabled..."
   } else {
      /call mqout "Logging disabled..."
      /varset CLOG 0
   }
/return

Sub RadiusORTOGGLE
   /if n @RadiusOR==0 {
      /varset RadiusOR 1
      /call mqout "Radius clip override enabled..."
   } else {
      /varset RadiusOR 0
      /call mqout "Radius clip override disabled..."
   }
/return

Sub SSBTOGGLE
   /if n @SSB==0 {
      /call mqout "Singing Steel Boot casting enabled..."
      /varset SSB 1
   } else {
      /call mqout "Singing Steel Boot casting disabled..."
      /varset SSB 0
   }
/return

Sub SOWTOGGLE
   /if n @SoW==0 {
      /call mqout "Blood of the Wolf casting enabled..."
      /varset SoW 1
   } else {
      /call mqout "Blood of the Wolf casting disabled..."
      /varset SoW 0
   }
/return

SUB DSETOUT
   /call mqout "DSET[H-:@HealthMin/H+:@HealthMax R:@RadiusReset R-:@RadiusMin/R+:@RadiusMax BCT:@BaseCastingTime]"
/return

Sub mqout(COutput)
   /if @CECHO==1 /echo @COutput
   /if @CLOG==1 /mqlog @COutput
/return

SUB SAVE
   /call inisave "AVOID" "@AVOID"
   /call inisave "CECHO" "@CECHO"
   /call inisave "CLOG" "@CLOG"
   /call inisave "BaseCastingTime" "@BaseCastingTime"
   /call inisave "HealthMin" "@HealthMin"
   /call inisave "HealthMax" "@HealthMax"
   /call inisave "RadiusMin" "@RadiusMin"
   /call inisave "RadiusMax" "@RadiusMax"
   /call inisave "SSB" "@SSB"
   /call inisave "SoW" "@SoW"
   /call inisave "CircDelay" "@CircDelay"
   /call inisave "AUTODL" "@AUTODL"

   /call mqout "Settings Saved..."
/return
Last edited by flightrecorder on Thu Mar 25, 2004 3:03 am, edited 3 times in total.
With knowledge comes power....so RTFM

BrainDozer
a lesser mummy
a lesser mummy
Posts: 45
Joined: Sun Aug 03, 2003 2:10 pm

Post by BrainDozer » Sat Mar 20, 2004 2:23 pm

Smilies....

kkmonte
orc pawn
orc pawn
Posts: 23
Joined: Sat Dec 14, 2002 2:52 pm

Post by kkmonte » Mon Mar 22, 2004 7:01 pm

My bard is only level 19 but i have found a few spots to use this.. works damn good i might say.. But sometimes durnig a kite, my bard just picks a direction and runs straight.. i have to manually end/start macro and then he fixes himself.. Why is this? anyone know?

Also heres another problem i've found. After a few mobs that it kills, i get this:

Image


Sorry for the jpg but i couldn't figure out how to copy and paste from the mq window or even to output that to a text file. =/
Last edited by kkmonte on Mon Mar 22, 2004 8:29 pm, edited 1 time in total.

RDPidb
a lesser mummy
a lesser mummy
Posts: 69
Joined: Mon Dec 15, 2003 1:14 am

just got cault

Post by RDPidb » Mon Mar 22, 2004 8:31 pm

My bard is damn near unstoppable now :)
Not realy, GMs r a big problem, I just got cault by one, and DELEVELED ROFL.

IMO, you need to implement a suicide function for when a GM enters zone or sends you a tell.
I.E. the macro ends , you stop and /q , you go LD. .. and u die... but small price to pay, u can just get rezzed when u log back in.

I just got cault using it in HoH on my 65 bard, and they said that they had watched me for awile, and sent me several tells, and the GM stood in my path and i kept running into him, so he summoned me to nexus, and deleveled me to 61 and said "dont do it again or u will be banned"

/cry


Maybe if someoen sends u a tell, u can do a /who and if it doesnt show up at all, or is a *GM* then u suicide.

also add a GM check in the program that checks for GM in zone.


Just my opinion
Last edited by RDPidb on Mon Mar 22, 2004 8:39 pm, edited 1 time in total.

BrainDozer
a lesser mummy
a lesser mummy
Posts: 45
Joined: Sun Aug 03, 2003 2:10 pm

Post by BrainDozer » Mon Mar 22, 2004 10:05 pm

I strongly discourage running this or any other macro while afk.

That aside, you should be smart about where you kite. HoH is nice experience, but it’s one of the number one spots people petition for afk macroing. And even though it takes 18 hours for a GM to respond to a petition, leaving a macro running for 3 days will drastically increase your chances of getting picked on.

RDPidb
a lesser mummy
a lesser mummy
Posts: 69
Joined: Mon Dec 15, 2003 1:14 am

yep

Post by RDPidb » Tue Mar 23, 2004 1:15 am

bard was just a twink on another accoutn with no gear really.. just wanted to see how fast i could lvl with the macro, not a huge loss. Still, I woudl be carefull runnign this AFK like BD said.

Im gonna run the script again and get back the exp they stole from me lol, but im gonna add a check for GMs in zone, and parse tells for the name, then do a /who on thjat name, and if it parses as *GM* or doesnt show up at all .. ill just have the macro /end and /q out of game.

better to take a rez, than get deleveled from 65 to 61 LOL.

Never even heard of gettign deleveled b4, I always thought u just got banned LOL. /shrug.

anyways, be carefull with it.
l8r