Swirling Shadow help

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

bardwithbadwrists
decaying skeleton
decaying skeleton
Posts: 6
Joined: Tue Jul 22, 2003 2:49 pm

Swirling Shadow help

Post by bardwithbadwrists » Tue Jul 22, 2003 2:52 pm

I'm having trouble with my swirling shadows macro (mostly came from macro depot, with slight modifications for a bard's use). What happens is it gets hung up attacking corpses. Is there something I can modify in the target selection code in order to run the loot sub if its a corpse? Thanks for your help.

(BTW, not real first post, but I realized I used my ingame name in my old one, heh)

Code: Select all

#define MyXLOC v40 
#define MyYLOC v41 
#define KSRadius v42 
#define NotSee v43 
#define TooFar v44 
#define MyTarget v45 
#define TargetDead v46 
#define HasTarget v47 
#define MobToHunt v48 
#define ObstCount v49 
#define LootSlot v50 
#define CheckLoot v51 
#define LootTotal v52 
#define MobArraySize v53 
#define MobDistance v54 
#define MobToLoot v55 
Sub Main 
   /zapvars 
   /press esc 
   /press esc 
   /press esc 
   /press esc 
   /press alt 
   /press shift 
   /press ctrl 
   /varset LootSlot 0 
   /varset CheckLoot 0 
   /varset a(1,0) "swirling shadow" 
    
   /varset LootTotal 1 
   /varset a(2,0) "#shadow" 
   /varset a(2,1) "#shadow" 
   /varset a(2,2) "#shadow" 
   /varset a(2,3) "#shadow" 
   /varset a(2,4) "Ranvin Darkwaters" 
   /varset KSRadius 60 
   /varset HasTarget 0 
   /varset ObstCount 0 
   /varset MobArraySize 5 
   /varset MobDistance 14 
   /delay 1s 
   /lootn never 
   :Start 
   /call GetTarget 
   /if $HasTarget=="1" /call MoveToMob 
|  /if $HasTarget=="1" /call CheckKs 
   /if $HasTarget=="1" /call CombatSub 
   /if $HasTarget=="1" /call MoveToMob 
   /if $HasTarget=="1" /call LootMob 
   /call ResetSub 
   /goto :Start 
/return 



sub GetTarget 
   :Aquire 
|  /target nopcnear $KSRadius npc "$a(2,$rand($MobArraySize))" 
   /target "shadow"
   /varset MyTarget $target(id) 
   /varset TargetDead 0 
   /if n $target(id)==0 /goto :Aquire 
    
   /if $target()=="False" /goto :Aquire 


   /varset HasTarget 1 
/return 



sub MoveToMob 
   /delay 2s 
   /varset MyXLOC $char(x) 
   /varset MyYLOC $char(y) 
   /if n $target(distance)<=$MobDistance { 
      /face fast nopredict 
      /return 
   } 
   /sendkey down up 
   :Movementloop 
   /varadd ObstCount 1 
   /if $target()=="FALSE" { 
      /varset HasTarget 0 
      /return 
   } 
   /face fast nopredict 
   /if n $target(distance)<=$MobDistance { 
      /face fast 
      /sendkey up up 
      /return 
   } 
   /if $ObstCount>=3 { 
      /call CheckObst 
      /goto :Movementloop 
   } 
   /if n $target(distance)>$MobDistance /goto :MovementLoop 
/return 



sub CheckKS 
   /if $target()=="FALSE" { 
      /varset HasTarget 0 
      /return 
   } 
   /target nopcnear $KSRadius npc "$MobToHunt" 
    
   /if $target(id)!=$MyTarget { 
      /echo Target $target(id) and MyTrgId $MyTarget does not match 
      /echo Starting fresh with new target. 
      /varset HasTarget 0 
      /return 
   } 
/return 


sub CombatSub 
   /if $target()=="FALSE" { 
      /varset HasTarget 0 
      /return 
   } 
|  /attack on 
/stop
/cast "wind of marr"
   :combatloop 
   /attack on 
   /face fast nopredict 
    

   /if n $target(distance)>13 { 
      /sendkey down up 
      /goto :combatloop 
   } 
   /if n $target(distance)<=$MobDistance /sendkey up up 
   /face fast nopredict 
   /varset MobToLoot $target(id) 
    
    

   /if n $target(id)==0 /varset TargetDead 1 
   /if n $TargetDead!=1 /goto :combatloop 
   /delay 2s 
 
  /target id $mobtohunt 

/return 



sub LootMob 
   /loot  
   /delay 2s 
   :lootloop 
   /click left corpse $LootSlot 
   /if n $LootSlot==9 /goto :doneloot 
   /delay 1s 
   /if "$cursor()"!="TRUE" /goto :doneloot 
   :lootChecker 
   /if "$cursor(name)"~~"$a(1,$CheckLoot)" { 
      /delay 1s 
      /click left auto 
      /varadd LootSlot 1 
      /goto :lootloop 
   } 
   /varadd CheckLoot 1 
   /if "$cursor()"=="TRUE" { 
      /if n $CheckLoot<$LootTotal /goto :lootchecker 
   } 
   /if "$cursor()"=="TRUE" { 
      /delay 1s 
      /click left destroy 
      /delay 1s 
   } 
   /varadd LootSlot 1 
   /varset CheckLoot 0 
   /goto :lootloop  
   :doneloot 
   /varset LootSlot 0 
/return 



sub ResetSub 
   /sendkey up up 
   /press esc 
   /press esc 
   /press esc 
   /press esc 
   /press alt 
   /press shift 
   /press ctrl 
   /varset CheckLoot 0 
   /varset HasTarget 0 
   /varset ObstCount 0 
   /delay 1s 
/return 



sub CheckObst 
   /if n $MyXLOC==$char(x) /if n $MyYLOC==$char(y) /call HitObst 5 
   /varset MyXLOC $char(x) 
   /varset MyYLOC $char(y) 
   /varset ObstCount 0 
/return 

sub HitObst 
   /sendkey up up 
   /sendkey down down  
   /if n $rand(99)>50 { 

      /delay 3s 
      /sendkey up down 
      /sendkey down Right 
      /delay $p0  
      /sendkey up Right 
      /sendkey down up 
      /delay 3s 
      /sendkey up up 
   } else { 
      /delay 3s 
      /sendkey up down 
      /sendkey down left 
      /delay $p0  
      /sendkey up left 
      /sendkey down up 
      /delay 3s 
      /sendkey up up        
   } 
   /sendkey up down 
   /sendkey up Right 
   /sendkey up Left 
   /sendkey down up 
/return 



/return 

somemage
a lesser mummy
a lesser mummy
Posts: 35
Joined: Mon May 12, 2003 7:44 pm

Post by somemage » Tue Jul 22, 2003 8:08 pm

Yeah you need to specify that you're targetting a npc or it will target a corpse if it matches and is nearer.

So, either uncomment out the /target line to put it back the way it was, or change

Code: Select all

/target "shadow"
to

Code: Select all

/target npc "shadow"

platdaddy
decaying skeleton
decaying skeleton
Posts: 4
Joined: Tue Jul 29, 2003 5:01 pm

Post by platdaddy » Tue Jul 29, 2003 5:05 pm

You could also try something like:
/target corpse Shadow

You may also want to specify a distance so if its outside of say 30 ticks or so you don't target it.

/if n $target(distance)>30 /return :D
Plat
I break out the Fizzle for Shizzle!