Static Spawn Killer

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

Moderator: MacroQuest Developers

funmonkey
orc pawn
orc pawn
Posts: 16
Joined: Wed Mar 19, 2003 12:24 am

Static Spawn Killer

Post by funmonkey » Sun Sep 07, 2003 8:11 am

Would apprecaite it if anyone could help me make this macro functionable

--- THANKS TO CURIOUS FOR THE SCRIPT

Code: Select all

| StaticMobWacker.mac 
#define MobToWack v1 
#define SpellToCast v2 
#define HealSpell v3 
#define SafeX v4 
#define SafeY v5 
#define SafeH v6 
#define KillCount v7 
#define LootCount v8 
#define MobID v9 

Sub Main 
| Edit these variables to match your situation: 
/varset MobToWack "Thomas" 
/varset SpellToCast "Sha's Lethargy" 
/varset HealSpell "Healing" 
| End Edit 

/varset SafeX $char(100) 
/varset SafeY $char(100) 
/varset SafeH $char(south) 
/varset KillCount 0 
/varset LootCount 0 

:CampLoop 
   /if $char(state)=="stand" /sit 
   /doevents 
   /target $MobToWack 
   /if $target(name,clean)==$MobToWack /call KillIt 
   /if n $char(hp,pct)<90 /call HealUp 
/goto :CampLoop 

/Sub KillIt 
   /varset MobID $target(id) 
   /pet attack 
   /if n $char(mana,cur)>$spell("$SpellToCast",mana) { 
      /if $char(state)=="sit" /stand 
      /cast "$SpellToCast" 
   } 
   /if $char(state)=="stand" /sit 
   :WaitTill30 
      /doevents 
      /if n $target(hp,pct)>30 /goto :WaitTill30 
   /if $char(state)=="sit" /stand 
   /attack 
   :MeleeLoop 
      /if n $abs($char(heading)-$heading($target(y),$target(x)))>30 { 
         /sendkey up up 
         /face nopredict 
         /sendkey down up 
      } else { 
        /face nopredict 
      } 
      /if n $target(distance)<5 /press down 
      /if n $target(distance)>5 /press up 
      /if n $target(distance)>12 /sendkey down up 
      /if n $char(ability,"kick")>0 /doability "kick" 
      /doevents 
      /if n $target(id)!=0 /goto :MeleeLoop 
      /varadd KillCount 1 
      /echo $MobToWack has been wacked $KillCount times so far! 
      /sendkey up up 
      /delay 1 
      /target id $MobID 
      /call LootUp 
      /face heading $heading($SafeY,$SafeX) 
      /delay 1s 
      :GoHomeLoop 
         /face heading $heading($SafeY,$SafeX) 
         /if n $distance($SafeY,$SafeX)>5 /press up 
         /if n $distance($SafeY,$SafeX)>12 /sendkey down up 
         /if n $distance($SafeY,$SafeX)>5 /goto :GoHomeLoop 
      /face heading $SafeH 
/return 

/Sub LootUp 
   /loot 
   :WaitLoot 
      /doevents 
      /if $invpanel=="false" /goto :WaitLoot 
   /delay 1 
   /varset l1 0 
   :LootLoop 
      /if n $l1==9 /goto :Looted 
      /varset t1 10 
      /click left corpse $l1 
      :WaitLootClick 
         /doevents 
         /if $cursor()=="true" /goto :SnagLoot 
         /if n $t1>0 /goto :WaitLootClick 
      /delay 1 
      /if $cursor()!="true" /goto :Looted 
      :SnagLoot 
         /click left auto 
         /varadd LootCount 1 
         /varadd l1 1 
         /goto :LootLoop 
      :Looted 
         /click left corpse done 
         /echo $LootCount items snagged so far! 
/return 

Sub HealUp 
   :HealLoop 
   /if n $char(hp,pct)>90 /return 
   /if n $char(mana,cur)<$spell("$HealSpell",mana) /return 
   /if $char(state)=="sit" /stand 
   /cast "$HealSpell" 
   /goto :HealLoop 
/return 
"It gives me the error couldn't find comparison operator in Thomas"

when i change this;

Code: Select all

/if $target(name,clean)==$MobToWack /call KillIt 
to this;

Code: Select all

/if $target(name)==$MobToWack /call KillIt 
Removing the clean will allow me to successfullly target what I need, but it still wont continue onto the next sub routine.

Im pretty confused.

ALSO! Can anyone please help me insert a way to checked pets health, and if below 40% heal it. And for the macro to also check the 2 buffs that I use for my pet and cast them when needed? I think this could be way worth wild to all those pet classes out there. Would love to see if anyone can work this out.

Thanks and sorry my english sucks
Last edited by funmonkey on Mon Sep 08, 2003 2:06 am, edited 3 times in total.

User avatar
Curious
a ghoul
a ghoul
Posts: 88
Joined: Wed Aug 27, 2003 5:19 am

Post by Curious » Sun Sep 07, 2003 9:17 am

Why don't you ask the original author - who you failed to give credit to - to correct his script?

Mckorr
Developer
Developer
Posts: 2326
Joined: Fri Oct 18, 2002 1:16 pm
Location: Texas

Post by Mckorr » Sun Sep 07, 2003 9:57 am

I did this kind of thing to camp Hadden for a fishbone earring (which I never did get). Will try to find my script and post it for comparison.
MQ2: Think of it as Evolution in action.

funmonkey
orc pawn
orc pawn
Posts: 16
Joined: Wed Mar 19, 2003 12:24 am

Post by funmonkey » Mon Sep 08, 2003 2:00 am

I am genuinely SORRY for not posting the author of this script, please excuse my rudeness I am very greatful for your help!!

Thank You Curious, im sorry again.

MacroFiend
a grimling bloodguard
a grimling bloodguard
Posts: 662
Joined: Mon Jul 28, 2003 2:47 am

It looks like ...

Post by MacroFiend » Mon Sep 08, 2003 10:53 am

the script is correct ... except when ever you are dealing w/ things that could have spaces in them (like a mob or spell name), you should always put "" around each side ... i.e. "$target(name)"=="Thomas" so that it will account for spaces in the name and not break the comparison.

There could be a problem in part of the $target variable similar to another that was found in $pack but that is a long shot.

User avatar
Curious
a ghoul
a ghoul
Posts: 88
Joined: Wed Aug 27, 2003 5:19 am

Post by Curious » Mon Sep 08, 2003 2:56 pm

Code: Select all

/if $target(name,clean)==$MobToWack /call KillIt
Should read:

Code: Select all

/if "$target(name,clean)"=="$MobToWack" /call KillIt

Code: Select all

/varset SafeH $char(south)
should read:

Code: Select all

/varset SafeH 180
The original code read your characters x,y and heading when the script started and stored those values.
also, /Sub KillIt and /Sub LootUp need to lose the '/' - should be Sub KillIt and Sub LootUp.

Still working on the additions you asked for.