Wzard grp'ing macro - need feedback..

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

zosmatix
decaying skeleton
decaying skeleton
Posts: 7
Joined: Tue Jan 20, 2004 10:12 am

Wzard grp'ing macro - need feedback..

Post by zosmatix » Tue Jan 20, 2004 10:22 am

Sub Main
/Declare tankname global

/echo Wiz-Mac-no.-1 Is <--!!RUNNING (woot)!!-->

/if "@Param1"=="" {
/echo Error! - Syntax: /macro test.mac [tankname] [start nukin at %] [stop nukin at %]
/endmacro
}
/varset tankname @Param0
/echo Assisting: @tankname
/echo Nukin at -> @Param1 - stopping at -> @Param2

/goto :start

:restart

/if $char(mana,pct)<=70 {
/echo Casting Harvest
/cast 6
}

/delay 60
/if $char(mana,pct)<=70 {
/echo Casting Druzzil Harvest
/press F10
}


:start

/if n $char(mana,pct)<=20 {
/echo Lom - Medding to 80
/goto :med
}

/assist @tankname
/delay 1
/if $target(hp,cur)<@Param2 /goto :gorestart
/if $target(hp,cur)<=@Param1 {
/if $target(hp,cur)>@Param2 {

/echo Nuking $target(name) with $char(gem,1).
/delay 1
/cast 1
/delay 120
/if $target(id)==0 /goto :gorestart
/if $target(hp,cur)<@Param2 /goto :gorestart
/echo Nuking $target(name) with $char(gem,3).
/cast 3
/delay 60
/echo Cast cycle restart..
}
}
}


/if $target(id)==0 {
/echo Target Dead - Restarting...
:gorestart
/goto :restart


}

/goto :restart

:med
/if n $char(mana,pct)<=80 {
/cast 6
/delay 120
/goto :med
}
/echo Done medding - restarting..
/goto :start
I have a problem with the target hp check and char mana check..

If mana goes to 100% the /if $char(mana,pct)<=70 reports TRUE.. I cant figure out why..

Also when the targets HP gets below 10 the macro starts the Nuking cycle again..

Any ideas on how to fix this?

Im pretty new to MQ-scripting, as you can imagine.. :roll:

daerck
a ghoul
a ghoul
Posts: 134
Joined: Mon Jan 12, 2004 8:44 pm

Post by daerck » Tue Jan 20, 2004 12:14 pm

Numerical comparison uses

Code: Select all

/if [color=red]n[/color] <comparison>
So make sure you include the "n" on all numerical if statements. You seem to include it in some of them but not all.

You may also want to make subroutines for the different things to do as it allows for cleaner code and better readability.

/Cast can be called per /cast "Spellname" to allow for more flexibility with your spell gem set up

Harvest of Druzzil can be triggered with the "/alt activate 172" command which also allows for greater flexibility than calling a hotkey. (Double check this actually)
Also you would want a timer var for both Harvests to avoid clicking it when not available. Somethign like this

Code: Select all

/declare HarvestTimer timer
/declare HarvestAATimer timer

Code: Select all

Sub Harvest
  /if n $char(mana,pct)<=70 {
    /if n @HarvestTimer<=1 {
      /cast "Harvest"
      /varset HarvestTimer 8m
    }
  }
  /if n $char(mana,pct)<=70 {
    /if n @HarvestAATimer<=1 {
      /alt activate 172
      /varset HarvestAATimer 8m
    }
  }
/return