Hunter.Mac

Macro depository for macros written before the user variable changes that broke all of them.

Moderator: MacroQuest Developers

seeker
decaying skeleton
decaying skeleton
Posts: 6
Joined: Sun Jun 16, 2002 2:07 pm
Location: Seattle, WA

Hunter.Mac

Post by seeker » Sun Jun 16, 2002 2:20 pm

Since I'm still learning the ropes of Macroquest, I've found one of the macros and modified it...

I've modified the ECMining.mac, removing the alerts (Since they weren't working.. I found it had worked better if I switched the /alerts to /alert add 0 <item> the 1 wasn't working.. And removed them, so that I can manually change the alerts as I go..

What I want to add to the script: Know when my spells fizzle (like my pet).. Also, want to know if there is a way to make it know when my packs are full, and then return it to manual so that I can process my inventory based on what I've collected.. This is based on me being a magician.. I also want to make a variant of this script that will stop me from a certain distance from the creature, send my pet in, after a delay cast my attack spell (so I do some damage) and then keep healing my pet w/ my pet heal spell. And add to the rest sequence to let me med and regain my spells..

Any suggestions would be greatly appreciated.

Code: Select all

| - Hunter.mac -
| Semi-intelligent hunting & autoloot macro
|
|
#include routines.mac

Sub Main
   /varset v80 0

   :Autokill
      /if $t1==0 /call Buff
      /call SelectTarget
      /if "$target()"=="FALSE" /goto :WaitASec
      /if "$target(type)"=="NPC" /call AttackAndFollow
      /call AutoLoot
      :WaitASec
      /call Rest
   /goto :AutoKill
/return


Sub SelectTarget
   /press esc
   /for v81 1 to 5
      /if "$target()"=="TRUE" /return
      /delay 5
   /next v81

   /target alert
   /if "$target()"=="FALSE" /call HeadRandom
   
/return

Sub AttackAndFollow
   /varset v90 $target(id)
   /echo Going after $target(name)...
   /face
   /attack on
   /varset t0 4m
   :CloserAF
      /if "$target(id)"!="$v90" /goto :EndAF
      /if n $target(distance)>14 /call AutoRun 1
      /if n $target(distance)<15 /call AutoRun 0
      /if n $target(distance)<5 /call BackPedal 0
      /if n $target(distance)>4 /call BackPedal 1
      /if n $t0==0 /press esc
      /face
   /goto :CloserAF

   :EndAF
   /call AutoRun 0
   /attack off
/return

Sub AutoLoot
   /press esc
   /target mycorpse
   /if "$target()"!="FALSE" /goto :TargetMyCorpse
   /target s corpse

   :TargetMyCorpse
   /face
   /if n $target(distance)<15 /goto :CloseEnough
   /call AutoRun 1
   /varset t0 3m
   :CloserAL
      /face
   /if n $target(distance)>14 /if n $t0>0 /goto :CloserAL

   :CloseEnough
   /call AutoRun 0
   /loot
   /Delay 10
   /for v1 0 to 9
      /Delay 5
      /click left corpse $v1
      /Delay 5
      /if "$cursor(name)"=="NULL" /goto :continue
      /if "$cursor(name)"!="NULL" /click left auto
   /next v1
   :continue
   /press esc
/return   


Sub Rest
   /if n $hp(pct)>50 /goto :DontMove
   /call AutoRun 1
   :CloserRest
      /face loc -280,100
   /if n $distance(-280,100)>20 /goto :CloserRest
   /call AutoRun 0
   :DontMove
   /if n $hp(pct)>80 /return
   /sit
   :KeepResting
      /if "$target()"!="FALSE" /return
   /if n $hp(pct)<80 /goto :KeepResting
   /stand
/return


Sub HeadRandom
   /varset v1 $rand(4000)
   /varset v2 $rand(2000)
   /varsub v1 500
   /varsub v2 1000
   /echo Heading towards $v1,$v2
   /face loc $v1,$v2
   /press q
   /varset t0 20s
   :RandLoop
   /if "$target()"=="TRUE" /return
   /if n $t0>0 /goto :RandLoop
   /press q
/return

Sub Buff
   /press esc
   /target myself
   /delay 3

   | Cast 1 spells on self
   /cast 8
   /delay 12s

   | Summon pet if not out
   /if $char(pet)==0 /cast 3
   /if $char(pet)==0 /delay 10s

   /varset t1 15m
/return

| End of Hunter.mac
Edit by L124RD:put macro in

Code: Select all

[./code] brackets

Plazmic
The One
The One
Posts: 800
Joined: Fri Jun 14, 2002 12:31 am
Contact:

Fizzles...

Post by Plazmic » Sun Jun 16, 2002 5:57 pm

The following will keep recasting fizzles...

Code: Select all

...
| Usage: /call CastSpell <spellgem> <delay>
| Uses globals v98, v99, and t9
Sub CastSpell
   /varset v98 $p0
   /varset v99 $p1
   /call Event_CastFizzle
   :WaitCast
     /doevents
   /if n t9>0 /goto :WaitCast
/return
...
Sub Event_CastFizzle
   /cast $v98
   /varset t9 $v99s
/return
- Plazmic

Edgy
orc pawn
orc pawn
Posts: 14
Joined: Wed Aug 21, 2002 8:28 pm

Post by Edgy » Tue Aug 27, 2002 4:56 am

Plazmic,

Can you please explain where you get these global values from? I am tryying to write more and more complex macro's that need variables, but am not quite understanding how it works.

My understanding is that you made up v98 and v99 and t9, then set the values of v98 and v99 to $p0 and $p1 respectively. After this (assuming I am correct) I get lost.

Perhaps you could explain this simple sequence explaining each line and what it does? I bet there are others that need to know too :)

Thanks in advance.

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Tue Aug 27, 2002 5:12 am

Salutations,
You just have to find v# variables (and/or t# variables) which have not been used yet in the macro, and set it to something that can be used between subroutines, as in Plazmic's code.

User avatar
Imperfect
Macro Author
Macro Author
Posts: 319
Joined: Fri Jun 14, 2002 1:52 am

Post by Imperfect » Tue Aug 27, 2002 5:19 am

Perhaps we should make a move for some standardization similar to what was do0ne with ACTool for Asheron's Call...

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Tue Aug 27, 2002 6:15 am

Salutations,
Perhaps... but getting people to follow it?

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Tue Aug 27, 2002 6:15 am

Salutations,
actually, if you just use defines, everything should work fine, you know what each variable is.