Mage Farming macro, need some help.

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

Moderator: MacroQuest Developers

webleader
decaying skeleton
decaying skeleton
Posts: 3
Joined: Sat Oct 12, 2002 1:36 am

Mage Farming macro, need some help.

Post by webleader » Sat Oct 12, 2002 1:22 pm

Okay, so you got a mage at lvl 8 with a pet and a pet healing spell, now you wanna create a macro that makes sure you pet stays alive right? Well i've been trying this out and this is what i've got so far. It checks to see if your mp is below 20% which means you would be healing the pet too much, but when i run the macro, it always does /cast 1 after the first if statement which pretty much says if v10 which i stored as the pet's hp is <= 50 to /cast 1 Well here's the code, plz help me out :)

Sub Main
:loopstart
/delay 20
/who all GM
/press esc
/press F1
/press F1
/varset v10 $target(hp,pct)
/if $v10<=50 {
/stand
/cast 1
/delay 100
/sit
} else /if $v10>=90 {
/sit
/press esc}

/press esc
/press F1
/varset v11 $char(mana,pct)
/if n $v11<=20 {
/stand
/cast 2
/delay 50
/goto :loopstart
/return
}else /if
/goto :loopstart
/return

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Post by Draekz » Sat Oct 12, 2002 1:41 pm

Code: Select all

|Mage Macro
|

Sub Main 

:loopstart 

  /delay 20 
  /who all GM 
  /press esc 
  /press F1 
  /press F1 

/varset v10 $target(hp,pct) 

  /if $v10<=50 { 
     /stand 
     /cast 1 
     /delay 100 
     /sit 

  }else /if $v10>=90 { 
     /sit 
     /press esc
} 

  /press esc 
  /press F1 

/varset v11 $char(mana,pct) 

  /if n $v11<=20 { 
     /stand 
     /cast 2 
     /delay 50 
     /goto :loopstart 
  }else /if n $v11>=21 { 
     /goto :loopstart 
}

/return 
Ok that should work, i havent tested it yet tho...also instead of cast <number> you can do /cast "spell name" note the quotes..its best if you keep them there and replace spell name with the name of the spell yhou cast.

One thing I changed that i noticed might affect your thing is } else (you had a space between the bracket and else) not sure if it matters but i changed that anyway..and a few other things i've forgotten already hehe

Give it a shot tho..I dont see why this wouldnt work :)

Draekz

Draekz
a hill giant
a hill giant
Posts: 263
Joined: Thu Aug 01, 2002 6:07 pm
Location: Winnipeg, Manitoba, Canada

Post by Draekz » Sat Oct 12, 2002 1:46 pm

EDIT: I dont think you can do $spawn(pet,hp,pct)...sorry ;)
All the same try checking out different functions in the README.HTML..should be something ther to help ya :)

Draekz

--------------------------
--------------------------
From The README.HTML

$spawn(id,xxx)
Returns information on a spawn
xxx can be: name[clean], surname, id, x, y, z, heading, headingto, speed, distance[,nopredict|x|y|z], type, level, gm, class, race, gender, pet, master
$spawn(id,hp,xxx) returns the spawn's hp: cur, max, pct
$spawn(id,next/prev) returns the id of the next/previous spawn.
Draekz

Valerian
a grimling bloodguard
a grimling bloodguard
Posts: 709
Joined: Sun Jul 28, 2002 3:29 am

Post by Valerian » Sat Oct 12, 2002 3:17 pm

Code: Select all

  /if $v10<=50 { 
should be:

Code: Select all

   /if n $v10<=50 {