Public Heal slave Macro

Moderator: Moderators

Message
Author
Pornograffitti
Noob
Noob
Posts: 18
Joined: 02 Apr 2011, 07:22
Noob?: No

Public Heal slave Macro

#1 Post by Pornograffitti »

author: KM
so i wanted to make a free-for-all healer slave
################################KM autohealer########################
automacro autoheal2{
pubm /h(eal|il)/i
call heal
}

macro heal{
do sp 28 $.lastpub
}

automacro autoheal{
pubm /h(eal|il) (\d+)/i
call {
$maxHeal = 10
$maxHealAmount = 20000
$healStrength = 1300

if ($.lastMatch2 <= $maxHeal && $.lastMatch2 >= 1) goto amount1
if ($.lastMatch2 <= $maxHealAmount && $.lastMatch2 >= $healStrength) goto amount2
stop

:amount1
$amount = @eval ($.lastMatch2)
$amountHeal = @arg ("$amount", 1)
call heal $amountHeal
stop

:amount2
$amount = @eval ($.lastMatch2/$healStrength)
$amountHeal = @arg ("$amount", 1)
call heal $amountHeal
stop

}
}

#######################################################################
#p.s can anyone make this simpler?
Edit: Fixed somthing

Pornograffitti
Noob
Noob
Posts: 18
Joined: 02 Apr 2011, 07:22
Noob?: No

Re: Public Heal slave Macro

#2 Post by Pornograffitti »

when ppl say:
heal= 1 heal
*help*= 1 heal
heal 9 = 9 heals
heal 19000 = heals about 19k worth

$maxHeal = max number of heals
$maxHealAmount = max heal amout someone cud ask for
$healStrength = the strength of 1 heal, << you should change this

-i also have a public buff macro but im to lazy to post it.
-any questions?

namek0e2
Noob
Noob
Posts: 1
Joined: 26 May 2011, 04:43
Noob?: Yes

Re: Public Heal slave Macro

#3 Post by namek0e2 »

Pornograffitti wrote:when ppl say:
heal= 1 heal
*help*= 1 heal
heal 9 = 9 heals
heal 19000 = heals about 19k worth

$maxHeal = max number of heals
$maxHealAmount = max heal amout someone cud ask for
$healStrength = the strength of 1 heal, << you should change this

-i also have a public buff macro but im to lazy to post it.
-any questions?

sir, do u have warp macro?

nothingtodo4
Noob
Noob
Posts: 7
Joined: 04 Jun 2013, 02:17
Noob?: Yes

Re: Public Heal slave Macro

#4 Post by nothingtodo4 »

Is it possible to have heal three times per each call.
For example, when I say heal, then my priest will heal me three times.

Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

Re: Public Heal slave Macro

#5 Post by Kaspy »

Replace the goto/label the if/elsif

Code: Select all

automacro autoheal2{
	pubm /h(eal|il)/i
	call heal
}

macro heal{
	do sp 28 $.lastpub
}

automacro autoheal{
	pubm /h(eal|il) (\d+)/i
	call {
		$maxHeal = 10
		$maxHealAmount = 20000
		$healStrength = 1300

		if ($.lastMatch2 <= $maxHeal && $.lastMatch2 >= 1) {
			$amount = @eval ($.lastMatch2)
			$amountHeal = @arg ("$amount", 1)
			call heal $amountHeal
		} elsif ($.lastMatch2 <= $maxHealAmount && $.lastMatch2 >= $healStrength) {
			$amount = @eval ($.lastMatch2/$healStrength)
			$amountHeal = @arg ("$amount", 1)
			call heal $amountHeal
		}
	}
}
Image

Post Reply