Page 1 of 4

Protect The Priest Macro=)

Posted: 15 Jan 2010, 03:45
by gamenikko
Protect The Priest
-Using Status Recovery
-or/or both-
-Commanding the master

Update : May 09, 2010

This will cast status recovery on the aggressive monster that attacks your priest, thus changing the target of the monster.
Warning : turn this off if you will use tank mode, and you will use priest as your tanker!

macro for SLAVE

Code: Select all

automacro statusRecover {
	timeout 3
	console /Monster (.*) \((\d+)\) attacks you /i
	call {
	$m = $.lastMatch2
	do sm 72 $m
	}
}
READ:
Thx to Mushroom for correcting my codes =)

UPDATE : OR this macro =0

it will send an attack command to the MASTER to attack a monster that attacks the SLAVE
this will not work 100% of all time as bots will see different monster IDs,but in some case they are the same, so its cool =)

Updated May 09, 2010

macro for MASTER
you should use this if u are using advance party search macro, coz ur priest shall not be authorized by the master,

Code: Select all

################################
######COMMAND###################
################################

automacro Command {
   console /\(From: (.*)\) : xd (.*)/
   call {
#####NOTE : edit $town to the map you are using storage and auto buys!####
        $town = Geffen #edit this!
        $mymap = $.map
   $xd = $.lastMatch1
   $xd2 = $.lastMatch2
        if ($mymap == $town) stop
   do $xd2
	}
}

macro for SLAVE

Code: Select all

################################
######PROTECT ME################
################################

automacro protectMe {
   timeout 3
   console /Monster (.*) \((\d+)\) attacks you/
   call {
   $mymap = $.map
   $lockmap = @config (lockMap)
   $master = @config (followTarget)
   $follow = @config (follow)
   $mon = $.lastMatch2
   if ($follow = 0) stop
   if ($mymap != $lockmap) stop
   do pm "$master" xd a $mon
   }   
}
ok the only prob here is, when ur slave is lost, and ur master is far away, im recommending you, to use my party search macro =)
Advance Party Search Macro :
http://forums.openkore.com/viewtopic.ph ... 795#p32795

thx Mushroom =)

Re: Protect the priest macro

Posted: 15 Jan 2010, 05:29
by koodpzok
ithink u should use $.lastMonsterID instead of $.lastMonster1

Re: Protect the priest macro

Posted: 15 Jan 2010, 09:05
by gamenikko
skill fails if i used $.lastMonsterID

Re: Protect the priest macro

Posted: 15 Jan 2010, 14:36
by Mushroom
$.lastMonster is only when using the monster syntax.

For backreference in console syntax, use $.lastMatchN

$.lastMatch1 = backreference for the first pair of brackets
$.lastMatch2 = backreference for the second pair of brackets
$.lastMatch3 = backreference for the third pair of brackets

and so on..

Re: Protect The Priest Macro=)

Posted: 24 Jan 2010, 07:07
by googley71

Code: Select all

Syntax error in function 'sm' (Use Skill on Monster)
Usage: sm <skill #> <monster #> [level]
I get this message at my slave, I already have the skill
Any help with this?
Thanks

Re: Protect The Priest Macro=)

Posted: 24 Jan 2010, 13:56
by Mushroom
It's because of this:
$m = $.lastMatchN
N should be a number according to the backreference.

Because you want to get the monster binID and in the regex (/Monster (.*) \((\d+)\) attacks you /i) the monster binID is the sencond pair of brackets, you should use $.lastMatch2. So, if you want get the monster's name, use $.lastMatch1.

Re: Protect The Priest Macro=)

Posted: 25 Jan 2010, 14:26
by gamenikko
UPDATED added another method

Re: Protect The Priest Macro=)

Posted: 25 Jan 2010, 14:35
by Mushroom
Just a note, you can change:

Code: Select all

 $lockmap = YourLockMap
to

Code: Select all

$lockmap = @config(lockMap)
So you won't need to change the macro everytime your lockMap changes.

Re: Protect The Priest Macro=)

Posted: 27 Jan 2010, 21:59
by n00b
the macros protect priest is not working when PM asd a 1-0 command the master bot wont react.

Re: Protect The Priest Macro=)

Posted: 28 Jan 2010, 09:20
by gamenikko
n00b wrote:the macros protect priest is not working when PM asd a 1-0 command the master bot wont react.
my bad hehehe i forgot to change a character, its ok now ^_^