RUN FROM MONSTER Macro REVISED, MAY 08, 2010

Moderator: Moderators

Message
Author
gamenikko
The Way Of Human
The Way Of Human
Posts: 192
Joined: 16 Aug 2009, 03:47
Noob?: Yes
Location: Gonryun

RUN FROM MONSTER Macro REVISED, MAY 08, 2010

#1 Post by gamenikko »

EDIT:MAY 08, 2010
I revised my macro

Note: when you are avoiding monster, make sure that the monster name is in mon_control.txt!
ex:
Geographer -1 0 0

Code: Select all

automacro monster {
	monster Geographer < 7 ###put monster names here
	timeout 5
	overrideAI 1
	exclusive 1
	call avoid
}

macro avoid {
[
	$monpos = $.lastMonsterPos
	$mypos = $.pos
	$myx = @arg ("$mypos", 1)
	$myy = @arg ("$mypos", 2)
	$monx = @arg ("$monpos", 1)
	$mony = @arg ("$monpos", 2)
	$num = @rand (3, 10)
	$angle = @rand (3, 7)
	$move = @rand (3, 15)
	$sign = @random ("+", "-")
]
	do eval warning "[MonsterAvoid] $.lastMonster at ($monx,$mony) is near, avoiding contact...\n";
[
   if ($monx <= $myx) goto east
   if ($monx >= $myx) goto west
]
[
:east
[
   if ($mony >= $myy) goto southeast
   if ($mony <= $myy) goto northeast
]
	do east $num
	stop
[
	:southeast
		$direction = SouthEast
		$x = @eval ($myx $sign $angle)
		$y = @eval ($myy - $move)
		do eval $::Macro::Data::varStack{walkable} = $::field->isWalkable($x, $y) ? 1 : 0
		if ($walkable == 1) goto greatEscape
				goto rand
		stop
	:northeast
		$direction = NorthEast
		$x = @eval ($myx $sign $angle)
		$y = @eval ($myy + $move)
		do eval $::Macro::Data::varStack{walkable} = $::field->isWalkable($x, $y) ? 1 : 0
		if ($walkable == 1) goto greatEscape
				goto rand
		stop
]
:west
[
   if ($mony >= $myy) goto southwest
   if ($mony <= $myy) goto northwest
]
	do west $num
	stop
[
	:southwest
		$direction = SouthWest
		$x = @eval ($myx $sign $angle)
		$y = @eval ($myy - $move)
		do eval $::Macro::Data::varStack{walkable} = $::field->isWalkable($x, $y) ? 1 : 0
		if ($walkable == 1) goto greatEscape
				goto rand
		stop
	:northwest
		$direction = $NorthWest
		$x = @eval ($myx $sign $angle)
		$y = @eval ($myy + $move)
		do eval $::Macro::Data::varStack{walkable} = $::field->isWalkable($x, $y) ? 1 : 0
		if ($walkable == 1) goto greatEscape
				goto rand
		stop
]
[
			:rand
			do eval AI::clear("move", "route");
]
:greatEscape 
	do move $x $y
	do eval print "[MonsterAvoid] Moving $direction ($x, $y) to avoid $.lastMonster ($monx, $mony)\n";
}
	
 


 
You can add this monster list if you want

###########################
#####monsters to avoid#####
###########################
Amon Ra, Archangeling, Baphomet, Bacsojin, Dark Illusion, Dark Lord, Detale, Doppelganger, Dracula, Drake, Eddga, Dark Snake Lord, Garm, Egnigem Cenia, Golden Thief Bug, Incantation Samurai, Lady Tany, Lord of Death, Maya, Maya Purple, Mistress, Moonlight, Mutant Dragon, Orc Hero, Orc Lord, Osiris, Pharaoh, Phreeoni, RSX-0806, Stormy Knight, Tao Gunka, Thanatos, Turtle General, Vesper, Howard Alt-Eisen, Seyren Windsor, Eremes Guile, Margaretha Sorin, Cecil Damon, Kathryne Keyron, Lord Knight Seyren, Assassin Cross Eremes, Whitesmith Howard, High Priest Margaretha, Sniper Cecil, High Wizard Kathryne, Morroc's Shadow Angel, Vocal, Morroc's Shadow Human, Abysmal Knight, Thanatos, Memory of Thanatos, Thanatos Despero, Despero of Thanatos, Thanatos Dolor, Dolor of Thanatos, Thanatos Maero, Maero of Thanatos, Thanatos Odium, Odium of Thanatos, Incantation Samurai, Samurai Specter, Incarnation of Morroc, Incarnation of Morroc, Sniper Shecil, Sniper Cecil, Bloody Knight, Knight Guardian, Knight of Abyss, Abysmal Knight, Knight of Windstorm, Stormy Knight, Lord Knight Seyren, Archdam, Archer Guardian, Acidus, Agav Alicel, Aliot, Amon Ra, Ancient Mimic, Ancient Mummy, Ancient Worm, Anolian, Anubis, Apocalypse, Armaia, Armeyer Dinze, Assassin Cross Eremes, Atroce, Aunoe, Bacsojin, White Lady, Baphomet, Banshee, Beelzebub, Bloody Butterfly, Bloody Murderer, Bow Guardian, Bow Master, Byorgue, Cat o' Nine Tails, Chimera, Chung E, Green Maiden, Civil Servant, Mao Guai, Dark Illusion, Dark Lord, Dark Priest, Dark Snake Lord, Evil Snake Lord, Deathword, Death Word, Deleter, Detale, Detarderous, Deviling, Diabolic, Dimik, Doppelganger, Dracula, Drake, Dullahan, Echio, Eddga, Entweihen Crothen, Eremes, Eremes Guile, Erend, Errende Ebecee, Executioner, Fallen Bishop, Fallen Bishop Hibram, Fanat, Ferus, Frus, Garden Watcher, Garden Keeper, Garm, Garm Baby, Gazeti, Gemini-S58, Gloom Under Night, Gremlin, Gryphon, Harpy, Harword, Howard Alt-Eisen, Hell Fly, Hellion Revenant, High Priest Magaleta, High Priest Margaretha, High Wizard Katrinn, High Wizard Kathryne, Hodremlin, Hydro, Hydrolancer, Ice Titan, Ifrit, Imp, Fire Imp, Samurai Specter, Incubus, Isilla, Kasa, Katrinn, Kathryne Keyron, Kavac, Kavach Icarus, Kiel, Kiehl, Knight Guardian, Lady Tanee, Lava Golem, Leib Olmai, Loli Ruri, Lord Knight Seyren, Lord of Death, Lord of the Dead, Magaleta, Margaretha Sorin, Majoruros, Marozka's Guard, Mavka, Maya, Maya Purple, Medusa, Mini Demon, Monemus, Mutant Dragon, Mutant Dragonoid, Mysteltainn, Naght Seiger, Necromancer, Nightmare Terror, Observation, Dame of Sentinel, Owl Baron, Owl Duke, Penomena, Pharaoh, Phendark, Piamette, Ragged Zombie, Rawrel, Laurell Weinder, Retribution, Baroness of Retribution, RSX 0806, RSX-0806, Salamander, Satan Morroc, Seyren, Seyren Windsor, Shecil,Cecil Damon, Shelter, Mistress of Shelter,, Shinobi, Skeggiold, Skogul, Sniper Shecil, Sniper Cecil, Soldier Guardian, Succubus, Sword Guardian, Sword Master, Thanatos, Memory of Thanatos, The Immortal Koshei, Thorn of Magic, Thorn of Purification, Thorn of Recovery, Thorny Skeleton, Tirfing, Ogretooth, Tristan III, Dead King, Ungoliant, Valkyrie, Valkyrie Randgris, Vanberk, Venatu, Vesper, Violy, Whitesmith Harword, Mastersmith Howard, Wicked Nymph, Evil Nymph, Wish Maiden, Wounded Morroc, Ygnizem, Egnigem Cenia, Zombie Slaughter, Rideword, Morroc's Shadow Golem
Last edited by gamenikko on 07 May 2010, 18:28, edited 7 times in total.
Just like old times.

n00b
Human
Human
Posts: 33
Joined: 09 Dec 2009, 01:18
Noob?: No

Re: RUN FROM MONSTER Macro=)

#2 Post by n00b »

gamenikko wrote:okay lately i posted a macro here:http://forums.openkore.com/viewtopic.php?f=33&t=8510 which is NOT MINE
and for some reason some PMed me and said they got errors so iv decided to make mine, i did this with little math =) and iv got it working WELL /no1

Note : put avoidedmonsters.txt on your control folder!
the macro will log your encounter with the monster you avoided, with date and time and map, so you can monitor which map and what time the GM summon mobs (well in pRO valkyrie that the GM way of wiping bots hehe)

Code: Select all


#######################################
########Avoid Strong Monsters##########
#######################################


automacro AvoidStrongMonsters {
###########################
#####monsters to avoid#####
###########################
monster Amon Ra, Archangeling, Baphomet, Bacsojin, Dark Illusion, Dark Lord, Detale, Doppelganger, Dracula, Drake, Eddga, Dark Snake Lord, Garm, Egnigem Cenia, Golden Thief Bug, Incantation Samurai, Lady Tany, Lord of Death, Maya, Maya Purple, Mistress, Moonlight, Mutant Dragon, Orc Hero, Orc Lord, Osiris, Pharaoh, Phreeoni, RSX-0806, Stormy Knight, Tao Gunka, Thanatos, Turtle General, Vesper, Howard Alt-Eisen, Seyren Windsor, Eremes Guile, Margaretha Sorin, Cecil Damon, Kathryne Keyron, Lord Knight Seyren, Assassin Cross Eremes, Whitesmith Howard, High Priest Margaretha, Sniper Cecil, High Wizard Kathryne, Morroc's Shadow Angel, Vocal, Morroc's Shadow Human, Abysmal Knight, Thanatos, Memory of Thanatos, Thanatos Despero, Despero of Thanatos, Thanatos Dolor, Dolor of Thanatos, Thanatos Maero, Maero of Thanatos, Thanatos Odium, Odium of Thanatos, Incantation Samurai, Samurai Specter, Incarnation of Morroc, Incarnation of Morroc, Sniper Shecil, Sniper Cecil, Bloody Knight, Knight Guardian, Knight of Abyss, Abysmal Knight, Knight of Windstorm, Stormy Knight, Lord Knight Seyren, Archdam, Archer Guardian, Acidus, Agav Alicel, Aliot, Amon Ra, Ancient Mimic, Ancient Mummy, Ancient Worm, Anolian, Anubis, Apocalypse, Armaia, Armeyer Dinze, Assassin Cross Eremes, Atroce, Aunoe, Bacsojin, White Lady, Baphomet, Banshee, Beelzebub, Bloody Butterfly, Bloody Murderer, Bow Guardian, Bow Master, Byorgue, Cat o' Nine Tails, Chimera, Chung E, Green Maiden, Civil Servant, Mao Guai, Dark Illusion, Dark Lord, Dark Priest, Dark Snake Lord, Evil Snake Lord, Deathword, Death Word, Deleter, Detale, Detarderous, Deviling, Diabolic, Dimik, Doppelganger, Dracula, Drake, Dullahan, Echio, Eddga, Entweihen Crothen, Eremes, Eremes Guile, Erend, Errende Ebecee, Executioner, Fallen Bishop, Fallen Bishop Hibram, Fanat, Ferus, Frus, Garden Watcher, Garden Keeper, Garm, Garm Baby, Gazeti, Gemini-S58, Gloom Under Night, Gremlin, Gryphon, Harpy, Harword, Howard Alt-Eisen, Hell Fly, Hellion Revenant, High Priest Magaleta, High Priest Margaretha, High Wizard Katrinn, High Wizard Kathryne, Hodremlin, Hydro, Hydrolancer, Ice Titan, Ifrit, Imp, Fire Imp, Samurai Specter, Incubus, Isilla, Kasa, Katrinn, Kathryne Keyron, Kavac, Kavach Icarus, Kiel, Kiehl, Knight Guardian, Lady Tanee, Lava Golem, Leib Olmai, Loli Ruri, Lord Knight Seyren, Lord of Death, Lord of the Dead, Magaleta, Margaretha Sorin, Majoruros, Marozka's Guard, Mavka, Maya, Maya Purple, Medusa, Mini Demon, Monemus, Mutant Dragon, Mutant Dragonoid, Mysteltainn, Naght Seiger, Necromancer, Nightmare Terror, Observation, Dame of Sentinel, Owl Baron, Owl Duke, Penomena, Pharaoh, Phendark, Piamette, Ragged Zombie, Rawrel, Laurell Weinder, Retribution, Baroness of Retribution, RSX 0806, RSX-0806, Salamander, Satan Morroc, Seyren, Seyren Windsor, Shecil,Cecil Damon, Shelter, Mistress of Shelter,, Shinobi, Skeggiold, Skogul, Sniper Shecil, Sniper Cecil, Soldier Guardian, Succubus, Sword Guardian, Sword Master, Thanatos, Memory of Thanatos, The Immortal Koshei, Thorn of Magic, Thorn of Purification, Thorn of Recovery, Thorny Skeleton, Tirfing, Ogretooth, Tristan III, Dead King, Ungoliant, Valkyrie, Valkyrie Randgris, Vanberk, Venatu, Vesper, Violy, Whitesmith Harword, Mastersmith Howard, Wicked Nymph, Evil Nymph, Wish Maiden, Wounded Morroc, Ygnizem, Egnigem Cenia, Zombie Slaughter, Rideword, Morroc's Shadow Golem

	timeout 1
	exclusive 1
	call RunFromMonsters
}

macro RunFromMonsters {

	$lastmon = $.lastMonster
	$myPos = $.pos
	$monPos = $.lastMonsterPos
	$myPosX = @arg ("$myPos", 1)
	$myPosY = @arg ("$myPos", 2)
	$monPosX = @arg ("$monPos", 1)
	$monPosY = @arg ("$monPos", 2)
	$map = $.map
	$time = $.datetime

#monster pos eval|where to run#

	if ($myPosX >= $monPosX && $myPosy >= $monPosy) goto northeast
	if ($myPosX <= $monPosX && $myPosy >= $monPosy) goto northwest
	if ($myPosX <= $monPosX && $myPosy <= $monPosy) goto southwest
	if ($myPosX >= $monPosX && $myPosy <= $monPosy) goto southeast


:northeast

	do northeast 10
		pause 2
	log We Ran Towards Northeast Safetly, we avoided >>$lastmon<<
	do eval open(FILE, ">>", Settings::getControlFilename("avoidedmonsters.txt")); print FILE "Avoided $lastmon at $map | $time \n"; close FILE;
	stop

:northwest

	do northwest 10
		pause 2
	log We Ran Towards Northeast Safetly, we avoided >>$lastmon<<
	do eval open(FILE, ">>", Settings::getControlFilename("avoidedmonsters.txt")); print FILE "Avoided $lastmon at $map | $time \n"; close FILE;
	stop

:southwest

	do southwest 10
		pause 2
	log We Ran Towards Northeast Safetly, we avoided >>$lastmon<<
	do eval open(FILE, ">>", Settings::getControlFilename("avoidedmonsters.txt")); print FILE "Avoided $lastmon at $map | $time \n"; close FILE;
	stop

:southeast
	
	do southeast 10
		pause 2
	log We Ran Towards Northeast Safetly, we avoided >>$lastmon<<
	do eval open(FILE, ">>", Settings::getControlFilename("avoidedmonsters.txt")); print FILE "Avoided $lastmon at $map | $time \n"; close FILE;
	stop

}
in any scenarios your character will run at the opposite direction of the monster, and thus securing that u have a place to run, because you will simple go back, well the problem with this is when you met 2 monsters at your blacklist, well i guess any macros will not help with that if your dead ur dead(or you can disconnect, no not TP this is made for servers w/o TP), but of course yeah,... you can also escape from 2 or 3 monsters =) BECAUSE MONSTERS MOVE and when they move, your escape route will be changed, ^_^

i think it failed :(

my master bot keeps dying :( i dnt know why i thought its going to avoid the monster.. but it calculate route very slow.. i guess

cannot calculate route etc...

gamenikko
The Way Of Human
The Way Of Human
Posts: 192
Joined: 16 Aug 2009, 03:47
Noob?: Yes
Location: Gonryun

Re: RUN FROM MONSTER Macro=)

#3 Post by gamenikko »

i think it failed :(

my master bot keeps dying :( i dnt know why i thought its going to avoid the monster.. but it calculate route very slow.. i guess

cannot calculate route etc...
maybe u are encountering many monsters at ur blacklist at once, you can check if this macro works buy changing monster to player values,

^_^
Just like old times.

n00b
Human
Human
Posts: 33
Joined: 09 Dec 2009, 01:18
Noob?: No

Re: RUN FROM MONSTER Macro=)

#4 Post by n00b »

gamenikko wrote:
i think it failed :(

my master bot keeps dying :( i dnt know why i thought its going to avoid the monster.. but it calculate route very slow.. i guess

cannot calculate route etc...
maybe u are encountering many monsters at ur blacklist at once, you can check if this macro works buy changing monster to player values,

^_^
well? not that..

ill post this SS

Image
heres my macro

Code: Select all

#######################################
########Avoid Strong Monsters##########
#######################################


automacro AvoidStrongMonsters {
###########################
#####monsters to avoid#####
###########################
monster Mutant Dragon, Mutant Dragonoid
   timeout 1
   exclusive 1
   call RunFromMonsters
}

macro RunFromMonsters {

   $lastmon = $.lastMonster
   $myPos = $.pos
   $monPos = $.lastMonsterPos
   $myPosX = @arg ("$myPos", 1)
   $myPosY = @arg ("$myPos", 2)
   $monPosX = @arg ("$monPos", 1)
   $monPosY = @arg ("$monPos", 2)
   $map = $.map
   $time = $.datetime

#monster pos eval|where to run#

   if ($myPosX >= $monPosX && $myPosy >= $monPosy) goto northeast
   if ($myPosX <= $monPosX && $myPosy >= $monPosy) goto northwest
   if ($myPosX <= $monPosX && $myPosy <= $monPosy) goto southwest
   if ($myPosX >= $monPosX && $myPosy <= $monPosy) goto southeast


:northeast

   do northeast 10
      pause 2
   log We Ran Towards Northeast Safetly, we avoided >>$lastmon<<
   do eval open(FILE, ">>", Settings::getControlFilename("avoidedmonsters.txt")); print FILE "Avoided $lastmon at $map | $time \n"; close FILE;
   stop

:northwest

   do northwest 10
      pause 2
   log We Ran Towards Northeast Safetly, we avoided >>$lastmon<<
   do eval open(FILE, ">>", Settings::getControlFilename("avoidedmonsters.txt")); print FILE "Avoided $lastmon at $map | $time \n"; close FILE;
   stop

:southwest

   do southwest 10
      pause 2
   log We Ran Towards Northeast Safetly, we avoided >>$lastmon<<
   do eval open(FILE, ">>", Settings::getControlFilename("avoidedmonsters.txt")); print FILE "Avoided $lastmon at $map | $time \n"; close FILE;
   stop

:southeast
   
   do southeast 10
      pause 2
   log We Ran Towards Northeast Safetly, we avoided >>$lastmon<<
   do eval open(FILE, ">>", Settings::getControlFilename("avoidedmonsters.txt")); print FILE "Avoided $lastmon at $map | $time \n"; close FILE;
   stop

}
my monster control

Code: Select all

Thara Frog 0
Mutant Dragon -1 0 0
Pest 1 0 0 0 0
Hydra 0 0 0
Anolian 1 0 0


gamenikko
The Way Of Human
The Way Of Human
Posts: 192
Joined: 16 Aug 2009, 03:47
Noob?: Yes
Location: Gonryun

Re: RUN FROM MONSTER Macro=)

#5 Post by gamenikko »

i see, cmd_fild03 is a map with many narrow points thats why you are always stuck, for now you can lower

Code: Select all

do northeast 10
to 5 or something, i am working on a sub routine to check for walkable points, ill update this thread soon =), but the macro will work fine on large maps with few narrow points
Just like old times.

n00b
Human
Human
Posts: 33
Joined: 09 Dec 2009, 01:18
Noob?: No

Re: RUN FROM MONSTER Macro=)

#6 Post by n00b »

gamenikko wrote:i see, cmd_fild03 is a map with many narrow points thats why you are always stuck, for now you can lower

Code: Select all

do northeast 10
to 5 or something, i am working on a sub routine to check for walkable points, ill update this thread soon =), but the macro will work fine on large maps with few narrow points

i tried but still my char cannot move lol :O calculating failed and also died :(

User avatar
help_us
Testers Team
Testers Team
Posts: 106
Joined: 04 Apr 2008, 21:53
Noob?: No
Location: Asia
Contact:

Re: RUN FROM MONSTER Macro=)

#7 Post by help_us »

Code: Select all

automacro avoid {
    monster Geographer < 5
    timeout 1
    exclusive 1
    set move 7
    call avoiding
}

macro avoiding {
	[
	$lastMon = $.lastMonster
	$monID = $.lastMonsterID
	$pPos = $.pos
	$mPos = $.lastMonsterPos
	$dist = $.lastMonsterDist
	$pPosX = @arg ("$pPos", 1)
	$pPosY = @arg ("$pPos", 2)
	$mPosX = @arg ("$mPos", 1)
	$mPosY = @arg ("$mPos", 2)
	$map = $.map
	$calc = @random ("+", "-")
	$rSeed = @rand(1,10)
	]
	log $lastMon ($monID) is on $mPos [Dist = $dist]
	if ($pPosX >= $mPosX) goto east
	if ($pPosX <= $mPosX) goto west
		:X0
			if ($pPosY <= $mPosY) goto X0south
			if ($pPosY >= $mPosY) goto X0north
				#log We have the same co-ord to the Monster;log Move Random
				do @random ("east", "west", "south", "north", "southeast", "northeast", "southwest", "northwest") $rSeed
				stop
			:X0south
				;#log Monster Loc: North X-axis0;log Move South;#do south $move
				$herex = $mPosX
				$herey = @eval ($mPosY - $move)
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable
					$herex = @eval($mPosX $calc $rSeed)
					$herey = @eval($mPosY $calc $rSeed)
					goto verifyAgain
					stop
			:X0north
				#log Monster Loc: South X-axis0;log Move North;#do south $move
				$herex = $mPosX
				$herey = @eval ($mPosY + $move)
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable
					$herex = @eval($mPosX $calc $rSeed)
					$herey = @eval($mPosY $calc $rSeed)
					goto verifyAgain
					stop
		:east
			if ($pPosY <= $mPosY) goto eastSouth
			if ($pPosY >= $mPosY) goto eastNorth

			:Y0east
				#log Monster Loc: West Y-axis0;#log Move East;#do east $move
				$herex = @eval ($mPosX + $move)
				$herey = $mPosY
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable
					$herex = @eval($mPosX $calc $rSeed)
					$herey = @eval($mPosY $calc $rSeed)
					goto verifyAgain
					stop
			:eastSouth
				#log Monster Loc: NorthWest;#log Move South East;#do southeast $move
				$herex = @eval ($mPosX + $move)
				$herey = @eval ($mPosY - $move)
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable
					$herex = @eval($mPosX $calc $rSeed)
					$herey = @eval($mPosY $calc $rSeed)
					goto verifyAgain
					stop
			:eastNorth
				#log Monster Loc: SouthWest;#log Move North East;#do northeast $move
				$herex = @eval ($mPosX + $move)
				$herey = @eval ($mPosY + $move)
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable
					$herex = @eval($mPosX $calc $rSeed)
					$herey = @eval($mPosY $calc $rSeed)
					goto verifyAgain
					stop
		:west
			if ($pPosY <= $mPosY) goto westSouth
			if ($pPosY >= $mPosY) goto westNorth

			:Y0west
				#log Monster Loc: East Y-axis0;#log Move West;#do west $move
				$herex = @eval ($mPosX - $move);
				$herey = $mPosY
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable
					$herex = @eval($mPosX $calc $rSeed)
					$herey = @eval($mPosY $calc $rSeed)
					goto verifyAgain
					stop
			:westSouth
				#log Monster Loc: NorthEast;#log Move South West;#do southwest $move
				$herex = @eval ($mPosX - $move);
				$herey = @eval ($mPosY - $move)
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable
					$herex = @eval($mPosX $calc $rSeed)
					$herey = @eval($mPosY $calc $rSeed)
					goto verifyAgain
					stop
			:westNorth
				#log Monster Loc: NorthEast;#log Move South West;#do southwest $move
				$herex = @eval ($mPosX - $move);
				$herey = @eval ($mPosY + $move)
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable
					$herex = @eval($mPosX $calc $rSeed)
					$herey = @eval($mPosY $calc $rSeed)
					goto verifyAgain
					stop
			:verifyAgain
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable again...
					do @random ("east", "west", "south", "north", "southeast", "northeast", "southwest", "northwest") $rSeed
					stop

	:moveNow
		#log moving to coordinate;#log move to coordinate $herex $herey $map
		do move $herex $herey $map
		stop
}
i already make for checking use isWalkable fields, but still sometimes bot still unable to calculate route (some map got route on rail that bot only have a few step to move)
example map
Image

so its not 100% gurantee that bot wont die in that situation.
example :

Code: Select all

[macro] automacro avoid triggered.
[macro log] Geographer (2) is on 150 315 ein_fild04 [Dist = 3.6]
[macro log] coordinate is not walkable
[macro log] coordinate is not walkable again...
note : its only scratch, maybe my macros is incorrect. You can modify it to improve it
Image
Image

n00b
Human
Human
Posts: 33
Joined: 09 Dec 2009, 01:18
Noob?: No

Re: RUN FROM MONSTER Macro=)

#8 Post by n00b »

help_us wrote:

Code: Select all

automacro avoid {
    monster Geographer < 5
    timeout 1
    exclusive 1
    set move 7
    call avoiding
}

macro avoiding {
	[
	$lastMon = $.lastMonster
	$monID = $.lastMonsterID
	$pPos = $.pos
	$mPos = $.lastMonsterPos
	$dist = $.lastMonsterDist
	$pPosX = @arg ("$pPos", 1)
	$pPosY = @arg ("$pPos", 2)
	$mPosX = @arg ("$mPos", 1)
	$mPosY = @arg ("$mPos", 2)
	$map = $.map
	$calc = @random ("+", "-")
	$rSeed = @rand(1,10)
	]
	log $lastMon ($monID) is on $mPos [Dist = $dist]
	if ($pPosX >= $mPosX) goto east
	if ($pPosX <= $mPosX) goto west
		:X0
			if ($pPosY <= $mPosY) goto X0south
			if ($pPosY >= $mPosY) goto X0north
				#log We have the same co-ord to the Monster;log Move Random
				do @random ("east", "west", "south", "north", "southeast", "northeast", "southwest", "northwest") $rSeed
				stop
			:X0south
				;#log Monster Loc: North X-axis0;log Move South;#do south $move
				$herex = $mPosX
				$herey = @eval ($mPosY - $move)
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable
					$herex = @eval($mPosX $calc $rSeed)
					$herey = @eval($mPosY $calc $rSeed)
					goto verifyAgain
					stop
			:X0north
				#log Monster Loc: South X-axis0;log Move North;#do south $move
				$herex = $mPosX
				$herey = @eval ($mPosY + $move)
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable
					$herex = @eval($mPosX $calc $rSeed)
					$herey = @eval($mPosY $calc $rSeed)
					goto verifyAgain
					stop
		:east
			if ($pPosY <= $mPosY) goto eastSouth
			if ($pPosY >= $mPosY) goto eastNorth

			:Y0east
				#log Monster Loc: West Y-axis0;#log Move East;#do east $move
				$herex = @eval ($mPosX + $move)
				$herey = $mPosY
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable
					$herex = @eval($mPosX $calc $rSeed)
					$herey = @eval($mPosY $calc $rSeed)
					goto verifyAgain
					stop
			:eastSouth
				#log Monster Loc: NorthWest;#log Move South East;#do southeast $move
				$herex = @eval ($mPosX + $move)
				$herey = @eval ($mPosY - $move)
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable
					$herex = @eval($mPosX $calc $rSeed)
					$herey = @eval($mPosY $calc $rSeed)
					goto verifyAgain
					stop
			:eastNorth
				#log Monster Loc: SouthWest;#log Move North East;#do northeast $move
				$herex = @eval ($mPosX + $move)
				$herey = @eval ($mPosY + $move)
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable
					$herex = @eval($mPosX $calc $rSeed)
					$herey = @eval($mPosY $calc $rSeed)
					goto verifyAgain
					stop
		:west
			if ($pPosY <= $mPosY) goto westSouth
			if ($pPosY >= $mPosY) goto westNorth

			:Y0west
				#log Monster Loc: East Y-axis0;#log Move West;#do west $move
				$herex = @eval ($mPosX - $move);
				$herey = $mPosY
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable
					$herex = @eval($mPosX $calc $rSeed)
					$herey = @eval($mPosY $calc $rSeed)
					goto verifyAgain
					stop
			:westSouth
				#log Monster Loc: NorthEast;#log Move South West;#do southwest $move
				$herex = @eval ($mPosX - $move);
				$herey = @eval ($mPosY - $move)
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable
					$herex = @eval($mPosX $calc $rSeed)
					$herey = @eval($mPosY $calc $rSeed)
					goto verifyAgain
					stop
			:westNorth
				#log Monster Loc: NorthEast;#log Move South West;#do southwest $move
				$herex = @eval ($mPosX - $move);
				$herey = @eval ($mPosY + $move)
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable
					$herex = @eval($mPosX $calc $rSeed)
					$herey = @eval($mPosY $calc $rSeed)
					goto verifyAgain
					stop
			:verifyAgain
				do eval $::Macro::Data::varStack{walkableBool} = $::field->isWalkable($::Macro::Data::varStack{herex},$::Macro::Data::varStack{herey}) ? 1 : 0
				if ($walkableBool == 1) goto moveNow
					log coordinate is not walkable again...
					do @random ("east", "west", "south", "north", "southeast", "northeast", "southwest", "northwest") $rSeed
					stop

	:moveNow
		#log moving to coordinate;#log move to coordinate $herex $herey $map
		do move $herex $herey $map
		stop
}
i already make for checking use isWalkable fields, but still sometimes bot still unable to calculate route (some map got route on rail that bot only have a few step to move)
example map
Image

so its not 100% gurantee that bot wont die in that situation.
example :

Code: Select all

[macro] automacro avoid triggered.
[macro log] Geographer (2) is on 150 315 ein_fild04 [Dist = 3.6]
[macro log] coordinate is not walkable
[macro log] coordinate is not walkable again...
note : its only scratch, maybe my macros is incorrect. You can modify it to improve it
huhu i tried your macro sir but still when it sees the monster it will say avoiding the monster but i can see that it damges already the bot...
:(

n00b
Human
Human
Posts: 33
Joined: 09 Dec 2009, 01:18
Noob?: No

Re: RUN FROM MONSTER Macro=)

#9 Post by n00b »

bump? :(

User avatar
help_us
Testers Team
Testers Team
Posts: 106
Joined: 04 Apr 2008, 21:53
Noob?: No
Location: Asia
Contact:

Re: RUN FROM MONSTER Macro=)

#10 Post by help_us »

make sure you change your macro plugin, follow up this link

note : im not sure your macro plugin version, but please do read 1st that link before asking anything

edit : btw, after i check macro plugin SVN version, they didnt add few thing such getmonsterID for Parser.pm and Utilities.pm.
so i suggest you patch it manually
Image
Image

Post Reply