Page 1 of 2

tankMode on Homunculus (and Mercenary?) | SVN

Posted: 28 Nov 2009, 23:05
by midnytblu
Brief description of the problem:
    Openkore Manual wrote:tankMode [<boolean flag>]
    tankModeTarget [<player name>]
      If tankMode is set to 1, and the player specified in tankModeTarget is found on screen, Kore will tank for the player by only hitting monsters once.
    apparenly, homunculus is no longer tagged as a 'player' thus tankMode doesn't work.

What you have done so far:
    reverted back to 2.0.6.1 with the same config and it works.

Portion of config that is relevant to the problem:

    Code: Select all

    tankMode 1
    tankModeTarget Vanilmirth
    where Vanilmirth is (obviously) the homunculus' name. :geek:

Any other useful information:
    NONE.

Re: tankMode on Homunculus (and Mercenary?) | SVN

Posted: 29 Nov 2009, 07:05
by help_us
need to change something on coreLogic.pm

Code: Select all

      my $foundTankee;
      if ($config{'tankMode'}) {
         foreach (@playersID) {
            next if (!$_);
            if ($config{'tankModeTarget'} eq $players{$_}{'name'}) {
               $foundTankee = 1;
               last;
            }
         }
      }


waiting to developer to make some change

note : i try to merge from something on sub processPartySkillUse, not yet sure working because i dont have homunculus

Re: tankMode on Homunculus (and Mercenary?) | SVN

Posted: 29 Nov 2009, 18:37
by Scarya
Moved to bug reports.

Re: tankMode on Homunculus (and Mercenary?) | SVN

Posted: 30 Nov 2009, 16:39
by kLabMouse
Check out modifier:

Code: Select all

$config{$slave->{slave_configPrefix}

As result....

The config options can be next.
Homunculus only:

Code: Select all

homunculus_attackAuto
homunculus_attackAuto_party
homunculus_attackAuto_onlyWhenSafe
homunculus_attackAuto_notInTown
homunculus_attackDistance
homunculus_attackMaxDistance
homunculus_attackMaxRouteTime
homunculus_attackNoGiveup
homunculus_attackCanSnipe
homunculus_attackCheckLOS

homunculus_followDistanceMax
homunculus_followDistanceMin

homunculus_route_step

homunculus_runFromTarget
homunculus_runFromTarget_dist

homunculus_tankMode
homunculus_tankModeTarget

homunculus_teleportAuto_unstuck
homunculus_teleportAuto_dropTarget
homunculus_teleportAuto_dropTargetKS


Mercenary only:

Code: Select all

mercenary_attackAuto
mercenary_attackAuto_party
mercenary_attackAuto_onlyWhenSafe
mercenary_attackAuto_notInTown
mercenary_attackDistance
mercenary_attackMaxDistance
mercenary_attackMaxRouteTime
mercenary_attackNoGiveup
mercenary_attackCanSnipe
mercenary_attackCheckLOS

mercenary_followDistanceMax
mercenary_followDistanceMin

mercenary_route_step

mercenary_runFromTarget
mercenary_runFromTarget_dist

mercenary_tankMode
mercenary_tankModeTarget

mercenary_teleportAuto_unstuck
mercenary_teleportAuto_dropTarget
mercenary_teleportAuto_dropTargetKS


All other Slaves:

Code: Select all

slave_attackAuto
slave_attackAuto_party
slave_attackAuto_onlyWhenSafe
slave_attackAuto_notInTown
slave_attackDistance
slave_attackMaxDistance
slave_attackMaxRouteTime
slave_attackNoGiveup
slave_attackCanSnipe
slave_attackCheckLOS

slave_followDistanceMax
slave_followDistanceMin

slave_route_step

slave_runFromTarget
slave_runFromTarget_dist

slave_tankMode
slave_tankModeTarget

slave_teleportAuto_unstuck
slave_teleportAuto_dropTarget
slave_teleportAuto_dropTargetKS


Please Check out, and document.

Re: tankMode on Homunculus (and Mercenary?) | SVN

Posted: 03 Dec 2009, 03:25
by kLabMouse
Hmm.
Try:

Code: Select all

tankMode 1
tankModeTarget @homunculus


Or:

Code: Select all

tankMode 1
tankModeTarget @mercenary

Re: tankMode on Homunculus (and Mercenary?) | SVN

Posted: 04 Dec 2009, 20:28
by midnytblu
^sadly, it didn't work :(

Re: tankMode on Homunculus (and Mercenary?) | SVN

Posted: 28 Dec 2009, 15:18
by Technology
How about after applying this patch?

Code: Select all

Index: src/AI/CoreLogic.pm
===================================================================
--- src/AI/CoreLogic.pm   (revision 7029)
+++ src/AI/CoreLogic.pm   (working copy)
@@ -2605,9 +2605,12 @@
       # If we're in tanking mode, only attack something if the person we're tanking for is on screen.
       my $foundTankee;
       if ($config{'tankMode'}) {
-         foreach (@playersID) {
+         foreach (@playersID, @slavesID) {
             next if (!$_);
-            if ($config{'tankModeTarget'} eq $players{$_}{'name'}) {
+            if ($config{'tankModeTarget'} eq $players{$_}{'name'} ||
+               $config{'tankModeTarget'} eq '@homunculus' && $_ eq $char->{homunculus}{ID} ||
+               $config{'tankModeTarget'} eq '@mercenary' && $_ eq $char->{mercenary}{ID})
+            {
                $foundTankee = 1;
                last;
             }
Index: src/Commands.pm
===================================================================
--- src/Commands.pm   (revision 7029)
+++ src/Commands.pm   (working copy)
@@ -4609,8 +4609,8 @@
    $arg =~ s/ .*//;
 
    if ($arg eq "") {
-      error T("Syntax Error in function 'tank' (Tank for a Player)\n" .
-         "Usage: tank <player #|player name>\n");
+      error T("Syntax Error in function 'tank' (Tank for a Player/Slave)\n" .
+         "Usage: tank <player #|player name|\@homunculus|\@mercenary>\n");
 
    } elsif ($arg eq "stop") {
       configModify("tankMode", 0);
@@ -4625,21 +4625,25 @@
       }
 
    } else {
-      my $found;
-      foreach my $ID (@playersID) {
+      my $name;
+      foreach my $ID (@playersID, @slavesID) {
          next if !$ID;
          if (lc $players{$ID}{name} eq lc $arg) {
-            $found = $ID;
+            $name = $players{$ID}{name};
             last;
+         } elsif($ID eq $char->{homunculus}{ID} && $arg eq '@homunculus' ||
+               $ID eq $char->{mercenary}{ID} && $arg eq '@mercenary') {
+            $name = $arg;
+            last;
          }
       }
 
-      if ($found) {
+      if ($name) {
          configModify("tankMode", 1);
-         configModify("tankModeTarget", $players{$found}{name});
+         configModify("tankModeTarget", $name);
       } else {
-         error TF("Error in function 'tank' (Tank for a Player)\n" .
-            "Player %s does not exist.\n", $arg);
+         error TF("Error in function 'tank' (Tank for a Player/Slave)\n" .
+            "Player/Slave %s does not exist.\n", $arg);
       }
    }
 }

Re: tankMode on Homunculus (and Mercenary?) | SVN

Posted: 28 Dec 2009, 16:39
by kLabMouse
Technology wrote:How about after applying this patch?


May-be commit to SVN?

Re: tankMode on Homunculus (and Mercenary?) | SVN

Posted: 28 Dec 2009, 16:45
by Technology
comitted to svn, who will test this?

Re: tankMode on Homunculus (and Mercenary?) | SVN

Posted: 29 Dec 2009, 01:41
by midnytblu
just tried and it's partially working now.
i do, somehow, get this error:

Code: Select all

OpenKore version what-will-become-2.1 (SVN Version) 
@ai_seq = attack items_take attack skill_use
Network state = 5
Network handler = Network::DirectConnection
SVN revision: 7030
Loaded plugins:
  plugins/autopsy.pl (Autopsy)
  plugins/autoSpell.pl (autoSpell)
  plugins/dcBefore99.pl (dcBefore99)
  plugins/dcBeforej70.pl (dcBeforeJob70)
  plugins/greed.pl (greedPlugin)
  plugins/macro.pl (macro)
  plugins/tele-search v2.pl (Tele-Search v2)

Error message:
player: 1 + 1 != 1
List:
$VAR1 = [];

Hash:
$VAR1 = {
          'ð8  ' => {}
        };

ObjectList:
Unknown #6256085 (0)

Stack trace:
player: 1 + 1 != 1
List:
$VAR1 = [];

Hash:
$VAR1 = {
          'ð8  ' => {}
        };

ObjectList:
Unknown #6256085 (0)
 at src/Misc.pm line 943
   Misc::actorAdded(undef, 'ActorList=HASH(0x4c4ca2c)', 'ARRAY(0x5019e74)', undef) called at src/Utils/CallbackList.pm line 202
   CallbackList::call('CallbackList=ARRAY(0x4bad76c)', 'ActorList=HASH(0x4c4ca2c)', 'ARRAY(0x5019e74)') called at src/Utils/ObjectList.pm line 140
   ObjectList::add('ActorList=HASH(0x4c4ca2c)', 'Actor::Player=HASH(0x501645c)') called at src/ActorList.pm line 100
   ActorList::add('ActorList=HASH(0x4c4ca2c)', 'Actor::Player=HASH(0x501645c)') called at src/Network/Receive/ServerType0.pm line 1114
   Network::Receive::ServerType0::actor_display('Network::Receive::ServerType22=HASH(0x4c3692c)', 'HASH(0x5019f44)') called at src/Network/Receive.pm line 173
   Network::Receive::parse('Network::Receive::ServerType22=HASH(0x4c3692c)', '\x{ec}\x{2}\x{0}\x{d5}u_\x{0}p\x{0}\x{0}\x{0}\x{0}\x{0} \x{0}\x{0}\x{0}\x{7}\x{0}\x{16}\x{0}\x{85}\x{4}\x{0}\x{0}\x{0}\x{0}J\x{cb}\x{10}\x{1}f\x{2}N\x{0}\x{2}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{1}\x{0}\x{0}\x{0}\x{0}\x{1}&\x{c9}\x{c2}l\x{9b}\x{8e}...') called at src/functions.pl line 1210
   main::parseIncomingMessage('\x{ec}\x{2}\x{0}\x{d5}u_\x{0}p\x{0}\x{0}\x{0}\x{0}\x{0} \x{0}\x{0}\x{0}\x{7}\x{0}\x{16}\x{0}\x{85}\x{4}\x{0}\x{0}\x{0}\x{0}J\x{cb}\x{10}\x{1}f\x{2}N\x{0}\x{2}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{0}\x{1}\x{0}\x{0}\x{0}\x{0}\x{1}&\x{c9}\x{c2}l\x{9b}\x{8e}...') called at src/functions.pl line 555
   main::mainLoop_initialized() called at src/functions.pl line 70
   main::mainLoop() called at src/Interface.pm line 75
   Interface::mainLoop('Interface::Console::Win32=HASH(0x39bdc5c)') called at openkore.pl line 96
   main::__start() called at start.pl line 129


and this;

Code: Select all

OpenKore version what-will-become-2.1 (SVN Version) 
@ai_seq = route
Network state = 5
Network handler = Network::DirectConnection
SVN revision: 7030
Loaded plugins:
  plugins/autopsy.pl (Autopsy)
  plugins/autoSpell.pl (autoSpell)
  plugins/dcBefore99.pl (dcBefore99)
  plugins/dcBeforej70.pl (dcBeforeJob70)
  plugins/greed.pl (greedPlugin)
  plugins/macro.pl (macro)
  plugins/tele-search v2.pl (Tele-Search v2)

Error message:
player:2 - 1 != 0
List:
$VAR1 = [
          'cÅ '
        ];

Hash:
$VAR1 = {
          'cÅ ' => bless( {
                             'onNameChange' => bless( [], 'CallbackList' ),
                             'opt1' => 0,
                             'lv' => 99,
                             'dmgFromMonster' => {
                                                   '‹ì  ' => 201
                                                 },
                             'walk_speed' => '0.15',
                             'onUpdate' => bless( [], 'CallbackList' ),
                             'sitting' => 0,
                             'deltaHp' => -201,
                             'disappeared' => 1,
                             'headgear' => {
                                             'mid' => 152,
                                             'top' => 40,
                                             'low' => 53
                                           },
                             'name' => 'Barackiel Shadowbane',
                             'hair_color' => 6,
                             'weapon' => 1108,
                             'time_move' => '1262064615.71739',
                             'type' => 4015,
                             'emblemID' => '    ',
                             'ID' => 'cÅ ',
                             'time_move_calc' => 0,
                             'appear_time' => '1262064615.71734',
                             'shield' => 2106,
                             'gone_time' => '1262064620.56334',
                             'nameID' => 8766307,
                             'look' => {
                                         'head' => 0
                                       },
                             'opt3' => 0,
                             'actorType' => 'Player',
                             'pos' => {
                                        'y' => 193,
                                        'x' => 206
                                      },
                             'option' => 0,
                             'hair_style' => 14,
                             'binID' => 0,
                             'dmgToMonster' => {
                                                 '‹ì  ' => 3410
                                               },
                             'pos_to' => {
                                         'y' => 193,
                                         'x' => 206
                                       },
                             'jobID' => 4015,
                             'sex' => 1,
                             'opt2' => 0,
                             'guildID' => '    ',
                             'missedFromMonster' => {
                                                      '‹ì  ' => 3
                                                    },
                             'statuses' => {}
                           }, 'Actor::Player' ),
          ';=  ' => {}
        };

ObjectList:

Stack trace:
player:2 - 1 != 0
List:
$VAR1 = [
          'cÅ '
        ];

Hash:
$VAR1 = {
          'cÅ ' => bless( {
                             'onNameChange' => bless( [], 'CallbackList' ),
                             'opt1' => 0,
                             'lv' => 99,
                             'dmgFromMonster' => {
                                                   '‹ì  ' => 201
                                                 },
                             'walk_speed' => '0.15',
                             'onUpdate' => bless( [], 'CallbackList' ),
                             'sitting' => 0,
                             'deltaHp' => -201,
                             'disappeared' => 1,
                             'headgear' => {
                                             'mid' => 152,
                                             'top' => 40,
                                             'low' => 53
                                           },
                             'name' => 'Barackiel Shadowbane',
                             'hair_color' => 6,
                             'weapon' => 1108,
                             'time_move' => '1262064615.71739',
                             'type' => 4015,
                             'emblemID' => '    ',
                             'ID' => 'cÅ ',
                             'time_move_calc' => 0,
                             'appear_time' => '1262064615.71734',
                             'shield' => 2106,
                             'gone_time' => '1262064620.56334',
                             'nameID' => 8766307,
                             'look' => {
                                         'head' => 0
                                       },
                             'opt3' => 0,
                             'actorType' => 'Player',
                             'pos' => {
                                        'y' => 193,
                                        'x' => 206
                                      },
                             'option' => 0,
                             'hair_style' => 14,
                             'binID' => 0,
                             'dmgToMonster' => {
                                                 '‹ì  ' => 3410
                                               },
                             'pos_to' => {
                                         'y' => 193,
                                         'x' => 206
                                       },
                             'jobID' => 4015,
                             'sex' => 1,
                             'opt2' => 0,
                             'guildID' => '    ',
                             'missedFromMonster' => {
                                                      '‹ì  ' => 3
                                                    },
                             'statuses' => {}
                           }, 'Actor::Player' ),
          ';=  ' => {}
        };

ObjectList:
 at src/Misc.pm line 978
   Misc::actorRemoved(undef, 'ActorList=HASH(0x4b9ca2c)', 'ARRAY(0x4f4494c)', undef) called at src/Utils/CallbackList.pm line 202
   CallbackList::call('CallbackList=ARRAY(0x4bf3f74)', 'ActorList=HASH(0x4b9ca2c)', 'ARRAY(0x4f4494c)') called at src/Utils/ObjectList.pm line 215
   ObjectList::remove('ActorList=HASH(0x4b9ca2c)', 'Actor::Player=HASH(0x4f463ac)') called at src/ActorList.pm line 133
   ActorList::remove('ActorList=HASH(0x4b9ca2c)', 'Actor::Player=HASH(0x4f463ac)') called at src/Network/Receive/ServerType0.pm line 779
   Network::Receive::ServerType0::actor_died_or_disappeared('Network::Receive::ServerType22=HASH(0x4b8692c)', 'HASH(0x4f45764)') called at src/Network/Receive.pm line 173
   Network::Receive::parse('Network::Receive::ServerType22=HASH(0x4b8692c)', '\x{80}\x{0}c\x{c3}\x{85}\x{0}\x{0}') called at src/functions.pl line 1210
   main::parseIncomingMessage('\x{80}\x{0}c\x{c3}\x{85}\x{0}\x{0}') called at src/functions.pl line 555
   main::mainLoop_initialized() called at src/functions.pl line 70
   main::mainLoop() called at src/Interface.pm line 75
   Interface::mainLoop('Interface::Console::Win32=HASH(0x390dc5c)') called at openkore.pl line 96
   main::__start() called at start.pl line 129