ADVDRUID.MAC Alpha

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

Moderator: MacroQuest Developers

User avatar
operat0r
RTFM, then ask again
Posts: 61
Joined: Thu Aug 28, 2003 2:04 am

ADVDRUID.MAC Alpha

Post by operat0r » Tue Jan 27, 2004 12:30 am

6:49 AM 5/29/2004 - this script is a joke ... I dont even play EQ

12:02 AM 3/3/2004 - scripts works ok but the keepaway sub is still broken it wont trigger cast right or come out of the loop or something no time ot test it but keep away script does not support obst ... end of zones etc ...


1:34 AM 2/14/2004 - dont know what the hell im doing so thinking from starting with advchant and going from there... I dont get any playtime to test any of the macros I dont even have the game :( poor :?:


druidfarm.mac was missing many things so im working on a lev49 druid mac

NOTES:


NONE of this is MY CODE this is all thanks to people on the forum !

include EDITED SpellCast.inc ( for keep away from mob )

PROBLEMS:
* missing good anti KS ( ignore mob list from advchant.mac )
* missing target array code
* missing check if mob is spellcaster
* keep away script does not support obst ... end of zones etc ...

Code: Select all


| ADVDruidFarm.mac 
| 12:02 AM 3/3/2004
| 
| Orginally written by:  orthodude 
| Re-worked and optimized by:  Bad Karma 
| Re-Re-worked by: operat0r  
| - BK's NOTE: This is best suited for farming lower level mobs, as its very basic in nature. 
|   - It's 100% automatic now.  Just define your varables at the top, and let it run! 
| 
| This macro will hunt for any particular target and loot 
| contents of specified number of slots of target inventory. 
| It will also med when mana low and gate when hp low. 
| This works best if you are bound in same zone targets. 


#turbo 50 

#Event GettingHit " YOU for " 
#Event GettingHit " YOU, but "  

#include SpellCast.inc 

#define DOT1 "Creeping Crud" 
#define DOT2 "Immolate"            
#define DOT3 "Drones of Doom"            

#define AnchorX "16.69"                | LOC for your Anchor Point X 
#define AnchorY "93.40"                | LOC for your Anchor Point Y 


#define ENEMY "spider"            | What you want to hunt. 
#define HEAL "Greater Healing"   | Spell to heal yourself with. 
#define ROOT "Enveloping Roots"      | Spell you want to Root with. 
#define NUKE "firestrike"           | Spell you want to Nuke with. 
#define SNARE "Ensnare"           | Spell you want to Snare with. 
#define HPEVAC "Ring of Commons"          | Spell to use to port out when your HP gets too low. 
#define MEDEVAC "Ring of Commons"          | Spell to use to port out when your Mana gets too low. 
#define KEEP "silk"               | Looted items you want to KEEP. 
#define NUMSLOTS 6                | Number of empty inventory slots you have available to fill up with loot. 


Sub Main 

   /declare AggTemp global 
   /declare mobface global 


/declare Combatstatus global 
/declare firstcast global 
/echo Main 
   /declare LootLoopVar global 
   /declare CheckStuckA global 
   /declare CheckStuckB global 
   /declare DIST global 
|   /call SetupSpells 

:MainLoop 
   /call CheckHP 
   /call CheckMana 
   /call GetTarget 
      /call KillMob 
   |/call GetCorpse 
   |/call LootCorpse 
   /goto :MainLoop 
/return 

Sub GetTarget 
/echo GetTarget 
   :TargetLoop 
      /press ESC 
      /echo Searching for a victim! 
| Selects the nearest target available AND makes sure we don't KS if we do find one. 
| NOTE: There is MUCH better anti-KS code out there!  Search the forums and find one that works best for you. 
|  /target npc ENEMY nopcnear 200 
/target npc range 1 20
 | /target npc bear
/tar npc kizd

/doevents 
/delay 1s 
| If unable to find an available target, sit and med for 15 seconds before trying again.  (May as well put the down time to use!) 
      /if ("$target()"=="FALSE" || n $target(hp,pct)<=95) { 
         /echo Unable to locate any targets nearby... Will try again in 15 seconds. 
|        /if "$char(state)"!="SIT" /sit 
/delay 15s 
         /goto :TargetLoop 
      } 
   /echo Closing in on $target(name,clean)... 
   /varset DIST 90 
   /call MoveToTarget 
/return 


Sub GetCorpse 
   /echo Looking for the corpse... 
   /target corpse ENEMY radius 500 
   /if "$target()"=="FALSE" { 
      /echo No lootable corpses within established range... 
      /return 
   } 
   /varset DIST 7 
   /call MoveToTarget 
/return 


Sub MoveToTarget 

/echo    MoveToTarget 
/varset Combatstatus 1 
/if "$char(state)"!="STAND" /stand 
   /face nolook 
   /delay 3s 
:Run 
   /varset CheckStuckA $target(distance) 
   /face fast nolook 
   /if n $target(distance)>=@DIST /sendkey down up 
   /if n $target(distance)<=@DIST { 
      /sendkey up up 
      /return 
   } 
   /delay 1 
   /varset CheckStuckB $target(distance) 
| If we are stuck move back and to the side and retry 
   /if n @CheckStuckA==n @CheckStuckB { 
      /sendkey up up 
      /sendkey down down 
      /delay 5 
      /sendkey up down 
      /sendkey down left 
      /delay 8 
      /sendkey up left 
      /sendkey down up 
      /delay 1s 
      /sendkey up up 
      /varset CheckStuckB 0 
   } 
| Move randomly side to side a bit to avoid obstacles 
   /if n $rand(50)==19 { 
      /sendkey down right 
      /delay 4 
      /sendkey up right 
      /delay 1s 
      /goto :Run 
   } 
   /if n $rand(50)==18 { 
      /sendkey down left 
      /delay 4 
      /sendkey up left 
      /delay 1s 
      /goto :Run 
   } 
| Make sure target is still there 
   /if "$target()"=="TRUE" /goto :Run 
   /echo I lost my target. 
/return 


Sub KillMob 
/echo killmob 
/varset Combatstatus 1 

| You can make this /face fast if you want.  I don't use it here, to give it a more "human" appearance to observers. 
   /face nolook 
   /echo Showing $target(name,clean) what dr00ds are made of! 
   /delay 13 
| Time snare 
   /echo SNARE:  $target(name,clean) 
/varset firstcast 0
   /delay 2s 
   /varset firstcast 1
   /call cast "SNARE" 
   /varset firstcast 0

| Time to park it! 
   /echo ROOT:  $target(name,clean) 
   /delay 2s 

   /call cast "ROOT" 


| Back up a little bit from the rooted mob. 
|   /sendkey down down 
|  /delay 2s 
|  /sendkey up down 
|  /delay 2s 
| Nuke that muth`a! 
   :nuke 
      /echo Nuking/dot:  $target(name,clean) 
      /call cast "DOT1" 
      /call cast "DOT2" 
      /call cast "DOT3" 
      /delay 3s 
   /if "$target()"=="TRUE" /goto :nuke 

/varset Combatstatus 0 

/return 


Sub LootCorpse 
/echo lootcorpse 
| Make sure we still have a lootable corpse targeted. 
| If we got an add or jumped on the way to the corpse, then it should automatically be on target now. 
| If this is the case, it will start the script over from the start: 
|    1. Check Health and Mana to make sure we are healthy enough to keep fighting. 
|    2. If so, kill the new mob.  If not, bug out to our safe spot. 
|    3. Rinse and repeat as necessary. 
|    4. After killing the add(s), it will loot all corpses in the area. 
:LootMainLoop 
   /if ("$target()"=="FALSE" || "$target(state)"!="DEAD") /return 
   /echo Collecting all the Phat little L3wtz, my precious! 
   /loot 
   /delay 3s 
   /varset LootLoopVar 0 

| Sort through corpse looting items and keep only what we want. 
| Can change to pick up with left click, check for NO DROP and LORE, and destroy if needed. 
:LootCorpseLoop 
   /mouseto corpse @LootLoopVar 
   /delay 3 
   /click left 
   /delay 1s 
| If the corpse is empty, we're done looting. 
   /if "$cursor()"=="FALSE" /goto :DoneLooting 
| Destroy the items unless we said we want to KEEP them, but give us a moment to change our mind. 
   /if "$cursor(name)"!~"KEEP" { 
      /echo Auto-Destroying $cursor(name) in 4 seconds... 
      /delay 3s 
      /mouseto destroy 
      /delay 1s 
      /click left 
   } 
   /mouseto auto 
   /delay 1s 
   /click left 
   /varadd LootLoopVar 1 
   /delay 1 
   /if n @LootLoopVar<=n @NUMSLOTS /goto :LootCorpseLoop 

| We're done looting now, so let's close everything up and check to see if there are any more corpses in the area. 
:DoneLooting 
   /press ESC 
   /press ESC 
   /press ESC 
   /delay 1s 
   /call GetCorpse 
   /goto :LootMainLoop 
/return 


Sub CheckHP 
/doevents 
/echo checkhp 
| Check our current Hit Points and Port out if below 20%. 
   /if n $char(hp,pct)<=20 { 
      /echo HEY!!!  I'm DIEING!!!  Time to bug out!!!  [HP: $char(hp,pct)%] 
      /call cast "HPEVAC" 
   } 
| Check our current Hit Points and if below 60%, Heal until we reach 90%. 
   /if n $char(hp,pct)<=95 { 
      /target myself 
      :HealLoop 
         /echo LOW HEALTH!!!  Healing to 90%...  [HP: $char(hp,pct)%] 
         /call cast "HEAL" 
         /if n $char(hp,pct)<=90 /goto :HealLoop 
   } 

/if n $char(hp,pct)<=95 { 
|/call cast "HEAL" 
/cast 1 
/delay 5s 
} 
/return 


Sub CheckMana 
/doevents 
/echo CheckMana 
| Check our current Mana and Port out if below 20%. 
   /if n $char(mana,pct)<=20 { 
      /echo HEY!!!  I'm almost OOM!!!  Time to bug out!!!  [MANA: $char(mana,pct)%] 
      /call cast "MEDEVAC" 
   } 
| Check our current Mana and if below 40%, Meditate until we reach 90%. 
   /if n $char(mana,pct)<=40 { 
      /echo LOW MANA!!!  Medding to 90%...  [MANA: $char(mana,pct)%] 
/call anchor 
      :MedLoop 
|         /if "$char(state)"!="SIT" /sit 
          
/echo delay 
/delay 15s 

         /if n $char(mana,pct)<=90 /goto :MedLoop 
   } 
/return 


Sub SetupSpells 
/echo setupspells 
| Memorize our spells if they are not already memorized. 
| You can put these in any slot you want by changing the # after /memspell. 
   /if n $char(gem,"HEAL")==0 { 
      /memspell 1 "HEAL" 
      /delay 5s 
   } 
   /if n $char(gem,"ROOT")==0 { 
      /memspell 6 "ROOT" 
      /delay 5s 
   } 
   /if n $char(gem,"NUKE")==0 { 
      /memspell 2 "NUKE" 
      /delay 5s 
   } 
   /if n $char(gem,"SNARE")==0 { 
      /memspell 8 "SNARE" 
      /delay 5s 
   } 
   /if n $char(gem,"HPEVAC")==0 { 
      /memspell 7 "HPEVAC" 
      /delay 5s 
   } 
   /if n $char(gem,"MEDEVAC")==0 { 
      /memspell 5 "MEDEVAC" 
      /delay 5s 
   } 
/return 


Sub End 
   /echo End of Routine 
   /endmacro 
/return 



Sub anchor 
/echo -====================================- 
/echo -=== On My Way to the Following Location: ===- 
/echo -====================================- 
/echo -============ X:[AnchorX] ==============- 
/echo -============ Y:[AnchorY] ==============- 
/echo -====================================- 
/call MoveToAnchor 
/return 

Sub MoveToAnchor 
:AnchorMoveLoop 
  /if "$char(state)"=="SIT" /stand 
   /face nolook loc AnchorX,AnchorY 
    /if n $distance(AnchorX,AnchorY)>11 /sendkey down up 
    /if n $distance(AnchorX,AnchorY)<=11 { 
     /sendkey up up 
      /return 
} 
/goto :AnchorMoveLoop 

/return 



Sub CheckPuller 
/echo CheckPuller 
   /varset mobface $char(heading) 
   /varadd mobface 180 
   /varcalc mobface @mobface%360 
   /if n $target(heading)<=$calc(@mobface+10) { 
      /if n $target(heading)>=$calc(@mobface-10) { 
         /attack off 
         /varset Combatstatus 0 
         /varset AggTemp @Aggressive 
         /varset Aggressive 0                                                                          /call combatsub 
/echo callcombatsub under check 
/target npc radius 20/ 
      } 
   } 
/return 


Sub Event_GettingHit 
/echo Event_GettingHit 
/call checkpuller 
/call killmob 
/return 


EDITED SpellCast.inc ( keepaway sub )

Code: Select all




| SpellCast.inc 
| This will cast a spell reliably for you... 
| 
| Usage: 
|      /call Cast "spellname" 
|   or 
|      /call Cast "itemname" [item] 
| 
| It will return the following values: 
|    CAST_SUCCESS 
|    CAST_UNKNOWNSPELL 
|    CAST_OUTOFMANA 
|    CAST_OUTOFRANGE 
|    CAST_CANNOTSEE 
|    CAST_STUNNED 
|    CAST_RESISTED 
|    FD_FAILED 
| 
| New Vars Modification 
| Plazmic's no globals needed version 
| 
| Oct 9, 2003 - Updated to work with new vars and $char(casting) - gf 
| Oct 11, 2003 - switched some logic, removed defines - gf 
| Oct 15, 2003 - Item support added by EqMule 
|  Modified to add automeming of spells. Goofmester1 
| Dec 26, 2003 fd fail 1 added by m0nk 
| Dec 28, 2003 Modded for functionality in a variety of macs for multiple classes - Bad Karma 
| 
|  NOTE:  All /echo commands are for debugging and feedback only.  They can be safely removed. 
| 

#turbo 50 

#event Collapse "Your gate is too unstable, and collapses." 
#event FDFail "You are no longer feigning death" 
#event Fizzle "Your spell fizzles" 
#event Interrupt "Your casting has been interrupted" 
#event Interrupt "Your spell is interrupted." 
#event NoLOS "You cannot see your target." 
#event NotHold "Your spell would not have taken hold on your target." 
#event OnlyAtNight "Spell can only be cast during the night." 
#event OutOfMana "Insufficient Mana to cast this spell!" 
#event OutOfRange "Your target is out of range, get closer!" 
#event Recover "You haven't recovered yet..." 
#event Recover "Spell recovery time not yet met." 
#event Resisted "You target resisted the " 
#event Standing "You must be standing to cast a spell" 
#event Standing "has fallen to the ground." 
#event Stunned "You cannot cast while stunned" 
#event TooPowerful "You spell is too powerful for your intended target." 

Sub Cast(SpellName,Item) 
   /sendkey up up 
   /sendkey up down 
/if n $char(gem,"@SpellName")==0 { 
  /memspell 7 "@SpellName" 
  /delay 5s 
} 
:StartCast 
/call keepaway
/varset firstcast 0

/delay 1s
   /if $char(state)!="STAND" /stand 
   /face fast 
   /look 0                                  | Temporary fix to the "stare at the sky" issue. 
   /echo Incoming @SpellName to %T 
   /if "@Item"=="Item" { 
     /call ClearReturnValue 
     /cast item "@SpellName" 
   } else { 
     /if n $char(gem,"@SpellName")==0 /return CAST_UNKNOWNSPELL 
     /call ClearReturnValue 
     /if n $char(gem,"@SpellName")<0 { 
       /delay 0 
       /goto :StartCast 
     } 
     /cast "@SpellName" 
   } 
   :WaitCast 
      /if "$char(casting)"=="TRUE" { 
      /delay 1 
      /goto :WaitCast 
      } 
   /doevents Fizzle 
   /doevents Interrupt 
   /doevents Recover 
   /doevents Resisted 
   /doevents OutOfMana 
   /doevents OutOfRange 
   /doevents NoLOS 
   /doevents Stunned 
   /doevents Standing 
   /doevents Collapse 
   /doevents OnlyAtNight 
   /doevents NotHold 
   /doevents TooPowerful 
   /doevents FDFail 

   /if "$return"=="CAST_RESTART" /goto :StartCast 
   /if "$return"!="CAST_SUCCESS" /return "$return" 
   /if "$return"=="CAST_OUTOFMANA" /goto :StartCast 
   /if "$return"=="CAST_STUNNED" /goto :StartCast 
   /if "$return"=="CAST_RESISTED" /goto :StartCast 
   /if "$return"=="CAST_OUTOFRANGE" /goto :StartCast 
   /if "$return"=="CAST_CANNOTSEE" /goto :StartCast 
   /if "$return"=="FD_FAILED" /return "$return" 
/return CAST_SUCCESS 

Sub ClearReturnValue 
/return CAST_SUCCESS 


Sub Event_Fizzle 
   /echo Event_Fizzle 
/return CAST_RESTART 

Sub Event_Interrupt 
   /echo Event_Interrupt 
/return CAST_RESTART 

Sub Event_Recover 
   /echo Waiting for recovery... 
   /delay 5 
/return CAST_RESTART 

Sub Event_Standing 
   /echo Event_Standing 
   /stand 
/return CAST_RESTART 

Sub Event_Collapse 
   /echo Event_Collapse 
/return CAST_RESTART 

Sub Event_OutOfMana 
   /echo Event_OutOfMana 
   /tell "@Sender" "I'm out of mana at the moment.  Let me med for 10 seconds and I'll try again!" 
   /sit 
   /delay 10s 
   /stand 
/return CAST_OUTOFMANA 

Sub Event_OutOfRange 
   /echo Event_OutOfRange 
   /tell "@Sender" "%T is out of range.  Waiting for it to get a little closer before casting again." 
|   /sit 
|   /delay 10s 
   /stand 
/return CAST_OUTOFRANGE 

Sub Event_NoLOS 
   /echo Event_NoLOS 
   /tell "@Sender" "I cannot see %T.  Waiting for it to get a little closer before casting again." 
   /sit 
   /delay 10s 
   /stand 
/return CAST_CANNOTSEE 

Sub Event_Stunned 
   /echo Event_Stunned 
   /tell "@Sender" "I am STUNNED at the moment!  I will try again in 5 seconds." 
   /sit 
   /delay 5s 
   /stand 
/return CAST_STUNNED 

Sub Event_Resisted 
   /echo Event_Resisted 
   /tell "@Sender" "%T resisted my spell.  Trying again..." 
   /sit 
   /delay 5s 
   /stand 
/return CAST_RESISTED 

Sub Event_OnlyAtNight 
   /echo Event_OnlyAtNight 
/return CAST_SUCCESS 

Sub Event_NotHold 
   /echo Event_NotHold 
/return CAST_SUCCESS 

Sub Event_TooPowerful 
   /echo Event_TooPowerful 
/return CAST_SUCCESS 

Sub Event_FDFail 
   /echo FD_FAILED 
   /stand 
/return FD_FAILED 

Sub KeepAway 
/if $char(class)!="druid" /return  | check your a druid before running 
/if firstcast==1 /return 
   :Loop 
/echo keepaway
/if Combatstatus==0 /return 
/if n $target(distance)<40 { 
/echo $target(distance) <40
/face fast heading $target(heading) 
/sendkey down up 
/delay 8s 
} 
/if n $target(distance)>120 { 
/echo $target(distance) >120
/face fast heading $target(heading) 
/sendkey up up 
/do events 
/return 
} 
      /delay 0 
   /if "$target()"=="TRUE" /goto :Loop 
/return 

Last edited by operat0r on Sat May 29, 2004 6:46 am, edited 26 times in total.
with love moron #6895423686

funkeymonk
decaying skeleton
decaying skeleton
Posts: 6
Joined: Tue Jan 27, 2004 11:51 pm

Post by funkeymonk » Tue Jan 27, 2004 11:54 pm

Hey there. Was checkin out this macro...looks sweet have not had a chance to try ityet, but jus tto let you know was lookin through other posted macros and the necrofarm.mac has a cool anti-KS and medding capability built into it. should check it out and see if it can be merged into the druid code. Just a thought. :D
I put the FUNK in MoNK

Funkey Monk

User avatar
Bad Karma
a snow griffon
a snow griffon
Posts: 346
Joined: Sat Nov 22, 2003 9:34 pm
Contact:

Post by Bad Karma » Thu Jan 29, 2004 6:31 am

Code: Select all

Sub keepaway

   :Loop
/face fast
/if n $target(distance)<40 /sendkey down down
/if n $target(distance)=100 /sendkey up down
/if n $target(distance)<99 /return

| reverse follow.mac      /if n $target(distance)>60 /sendkey down up
|      /if n $target(distance)<40 /sendkey up up

      /face fast
      /delay 0
   /if "$target()"=="TRUE" /goto :Loop
/return 
I'm rather curious as to how well this has been working for people, and what problems/quirks you've noticed when using it. I might incorporate a modified version of this into my SpellCast, or something like it, but want to know how it's working for everyone else first.
[b]- Bad Karma
________________________________________[/b]

In our own quest for excellence, we should strive to take the time to help those who help themselves.

All others should [b]RTFM[/b]!!!!!!!!!

User avatar
psychotik
a ghoul
a ghoul
Posts: 112
Joined: Mon Oct 06, 2003 3:48 am

Post by psychotik » Thu Jan 29, 2004 10:12 am

Code: Select all

:StartCast 
/call keepaway 
   /if $char(state)!="STAND" /stand 
   /face fast 
   /look 0                                  | Temporary fix to the "stare at the sky" issue.
change it to /face fast nolook