React to "missed attacks"?

All about the macro plugin can be found in this forum. This forum is intended for the macro plugin only.

Moderator: Moderators

Message
Author
WAZAAAAA
Noob
Noob
Posts: 6
Joined: 18 Jul 2014, 22:14
Noob?: No

  React to "missed attacks"?

#1 Post by WAZAAAAA »

I want to create an automacro that quits the game when my character misses 3 attacks in a row on monsters, but I don't understand how to express the "missed 3 times" condition. Basically, I need a "dcOnAtkMiss 3" (would be great if OpenKore had this implemented by default btw). This is for anti-ban purposes.

This is an example of what I need:

Code: Select all

automacro Thisisatest {
???????????miss attack 3 times???????????
call {
do ai off
pause 4
do quit
}
}
Thanks in advance.
YOU'RE NOT ALEXANDER

User avatar
SkylorD
Moderators
Moderators
Posts: 1167
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil
Contact:

Re:   React to "missed attacks"?

#2 Post by SkylorD »

Anyway, check this :

http://www.openkore.com/index.php/TeleportAuto_atkMiss


This is the condition :

Code: Select all

eval $::monster->{atkMiss} >= 3
Tested.

PS :

Code: Select all

automacro Thisisatest {
eval $::monster->{atkMiss} >= 3
call {
do ai off
pause 4
do quit
}
}
Maybe it fails because I'm attacking an immovable target (Ant Egg aka Andre Egg)?
Maybe not.
Learn rules

WAZAAAAA
Noob
Noob
Posts: 6
Joined: 18 Jul 2014, 22:14
Noob?: No

Re:   React to "missed attacks"?

#3 Post by WAZAAAAA »

I can't seem to make it work... my other automacro that logs out when the map is changed works, which means that "my macro plugin" should be alright, but I can't use that one.
Can you give me the exact code that you've used to test? Maybe it fails because I'm attacking an immovable target (Ant Egg aka Andre Egg)?

EDIT 1:
I did some troubleshooting today, re-downloaded openkore_ready to the newest revision with default settings and attempted to fire the automacro, with no success. Did you test it in a "clean" installation of OpenKore? Do I need to replace "monster" with the monster name or its ID? I'm lost :\

EDIT 2:
Ok problem solved with some workarounds.
At first I solved the problem by making the automacro react to the console text sent by the function teleportAuto_atkMiss (using console /Teleporting because of attack miss/) and it worked, but that was "Teleport-reliant" and also unreliable according to the documentation ("Furthermore, format of console output isn't frozen and can change in future versions and/or in translations. It's not a good idea to rely on console condition."). So I went to edit Misc.pm directly and wrote the dcOnAtkMiss. Here I will share the code to add to the file src\Misc.pm BEFORE the line if (AI::action eq "attack" && mon_control($monster->{name},$monster->{nameID})->{attack_auto} == 3 && $damage)

Code: Select all

			if ($config{dcOnAtkMiss} && $monster->{atkMiss} >= $config{dcOnAtkMiss}) {
				warning TF("*** Disconnecting after missing a monster %d times ***\n", $config{dcOnAtkMiss});
				warning TF("Disconnect for %s seconds...\n", $config{dcOnAtkMiss_reconnect});
				relog($config{dcOnAtkMiss_reconnect}, 1);
in order to make it work, it needs this on config.txt:
dcOnAtkMiss NUMBER OF MISSES
dcOnAtkMiss_reconnect NUMBER OF SECONDS

there's also the "quit without relogging" version that only needs dcOnAtkMiss:

Code: Select all

			if ($config{dcOnAtkMiss} && $monster->{atkMiss} >= $config{dcOnAtkMiss}) {
				message TF("*** Disconnecting after missing a monster %d times ***\n", $config{dcOnAtkMiss});
				quit();
Thanks SkylorD.
YOU'RE NOT ALEXANDER

Post Reply