Plan to walk in lock map !

Other plugins for extending OpenKore's functionality. This forum is only for posting new plugins and commenting on existing plugins. For support, use the Support forum.

Moderator: Moderators

Message
Author
zCasanova
Noob
Noob
Posts: 19
Joined: 01 Jul 2009, 13:18
Noob?: No

Re: Plan to walk in lock map !

#11 Post by zCasanova »

Image

OpenKore version what-will-become-2.1
SVN revision: 7650
Loaded plugins:
plugins/Macro/macro.pl (macro)
plugins/petFeeder.pl (petFeeder)
plugins/planWalk.pl (planLockMapWalk)

Error message:
Cannot load control file planwalk.txt

Stack trace:
Trace begun at C:\KORE\src\Settings.pm line 438
Settings::loadByHandle(55) called at C:\KORE\plugins\planWalk.pl line 66
planLockMapWalk::on_start3('start3', undef, undef) called at src\Plugins.pm line 431
Plugins::callHook('start3') called at src\functions.pl line 287
main::loadDataFiles at src\functions.pl line 80
main::mainLoop at src\Interface.pm line 75
Interface::mainLoop('Interface::Console::Win32=HASH(0x12183e4)') called at openkore.pl line 97
main::__start at start.pl line 136

Died at this line:
$filename = $object->{name} || $object->{internalName} if (!defined $filename);
* if ($object->{type} == CONTROL_FILE_TYPE) {
FileNotFoundException->throw(

sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

Re: Plan to walk in lock map !

#12 Post by sofax222 »

zCasanova wrote:Image

OpenKore version what-will-become-2.1
SVN revision: 7650
Loaded plugins:
plugins/Macro/macro.pl (macro)
plugins/petFeeder.pl (petFeeder)
plugins/planWalk.pl (planLockMapWalk)

Error message:
Cannot load control file planwalk.txt

Stack trace:
Trace begun at C:\KORE\src\Settings.pm line 438
Settings::loadByHandle(55) called at C:\KORE\plugins\planWalk.pl line 66
planLockMapWalk::on_start3('start3', undef, undef) called at src\Plugins.pm line 431
Plugins::callHook('start3') called at src\functions.pl line 287
main::loadDataFiles at src\functions.pl line 80
main::mainLoop at src\Interface.pm line 75
Interface::mainLoop('Interface::Console::Win32=HASH(0x12183e4)') called at openkore.pl line 97
main::__start at start.pl line 136

Died at this line:
$filename = $object->{name} || $object->{internalName} if (!defined $filename);
* if ($object->{type} == CONTROL_FILE_TYPE) {
FileNotFoundException->throw(
You should add a text file name "planwalk.txt" into your control folder, even a empty text file !
The "planwalk.txt" format like this:

Code: Select all

[cmd_fild06]
365:205
360:96
332:180
365:140
332:180
365:140
360:96

[um_fild02]
195:120
120:205
216:221
294:195
239:290
152:365
298:322
294:195
216:221
120:205
195:65
59:125
35:275
59:125
195:120
294,59
340:203
365:319
363:290
329:95

zCasanova
Noob
Noob
Posts: 19
Joined: 01 Jul 2009, 13:18
Noob?: No

Re: Plan to walk in lock map !

#13 Post by zCasanova »

Awesome, thanks.

Amarock
Noob
Noob
Posts: 8
Joined: 26 Jun 2010, 15:37
Noob?: Yes
Location: France

Re: Plan to walk in lock map !

#14 Post by Amarock »

Does this plugin in compatible with CoreLogic.pm revision 7389 ?

I'v got an error with

Code: Select all

!$field->isCity
In revision 7389 I have

Code: Select all

!$cities_lut{$field{name}.'.rsw'}
I try to make some change but without sucess. What's wrong ?

Edit: Finaly, I modify the processRandomWalk function by merge:

Code: Select all

##### RANDOM WALK #####
sub processRandomWalk {
	if (AI::isIdle && (AI::SlaveManager::isIdle()) && $config{route_randomWalk} && !$ai_v{sitAuto_forcedBySitCommand}
		&& (!$cities_lut{$field{name}.'.rsw'} || $config{route_randomWalk_inTown})
		&& length($field{rawMap}) ) {

		my %hookArgs;
		$hookArgs{prefix} = "pref_RandomWalk";
		$hookArgs{return} = 1;
		Plugins::callHook('pref_RandomWalk', \%hookArgs);

		if ($hookArgs{return}) {
			my ($randX, $randY);
			my $i = 500;
			do {
				$randX = int(rand($field{width} + 1));
				$randX = int($config{'lockMap_x'} - $config{'lockMap_randX'} + rand(2*$config{'lockMap_randX'}+1)) if ($config{'lockMap_x'} ne '' && $config{'lockMap_randX'} ne '');
				$randY = int(rand($field{height} + 1));
				$randY = int($config{'lockMap_y'} - $config{'lockMap_randY'} + rand(2*$config{'lockMap_randY'}+1)) if ($config{'lockMap_y'} ne '' && $config{'lockMap_randY'} ne '');
			} while (--$i && !$field->isWalkable($randX, $randY));
			if (!$i) {
				error T("Invalid coordinates specified for randomWalk (coordinates are unwalkable); randomWalk disabled\n");
				$config{route_randomWalk} = 0;
			} else {
				message TF("Calculating random route to: %s(%s): %s, %s\n", $maps_lut{$field{name}.'.rsw'}, $field{name}, $randX, $randY), "route";
				ai_route($field{name}, $randX, $randY,
					maxRouteTime => $config{route_randomWalk_maxRouteTime},
					attackOnRoute => 2,
					noMapRoute => ($config{route_randomWalk} == 2 ? 1 : 0) );
			}
      }

      $hookArgs{prefix} = "post_RandomWalk";
      $hookArgs{return} = 1;
      Plugins::callHook('post_RandomWalk', \%hookArgs);
	}
}
Last edited by Amarock on 19 Mar 2011, 07:32, edited 1 time in total.

sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

Re: Plan to walk in lock map !

#15 Post by sofax222 »

Amarock wrote:Does this plugin in compatible with CoreLogic.pm revision 7389 ?

I'v got an error with

Code: Select all

!$field->isCity
In revision 7389 I have

Code: Select all

!$cities_lut{$field{name}.'.rsw'}
I try to make some change but without sucess. What's wrong ?
The "!$field->isCity" is not my code.
In the "sub processRandomWalk" of src/AI/CoreLogic.pm,
The 2 blocks of codes ad following, is the code I added:

Code: Select all

		my %hookArgs;
		$hookArgs{prefix} = "pref_RandomWalk";
		$hookArgs{return} = 1;
		Plugins::callHook('pref_RandomWalk', \%hookArgs);

		if ($hookArgs{return}) {
And

Code: Select all

		}

		$hookArgs{prefix} = "post_RandomWalk";
		$hookArgs{return} = 1;
		Plugins::callHook('post_RandomWalk', \%hookArgs);
So, could you give me the error message what you got !
And the code lines whet you change.

Amarock
Noob
Noob
Posts: 8
Joined: 26 Jun 2010, 15:37
Noob?: Yes
Location: France

Re: Plan to walk in lock map !

#16 Post by Amarock »

Sorry, I have edited my post but without send it :?

sofax222, I have merge the existing function with your modification and it work now.

The CoreLogic.pm revision should not be the same.

sofax222
Developers
Developers
Posts: 214
Joined: 24 Nov 2010, 03:08
Noob?: Yes

Re: Plan to walk in lock map !

#17 Post by sofax222 »

Do you still mainten the revision 7386 ?
I start with SVN 7573...
But now, I upgrade to 7677.

So, I think the "!$cities_lut{$field{name}.'.rsw'}" is old code.
now is the "!$field->isCity".

Amarock
Noob
Noob
Posts: 8
Joined: 26 Jun 2010, 15:37
Noob?: Yes
Location: France

Re: Plan to walk in lock map !

#18 Post by Amarock »

Well, I'm not yet skilled with SVN, I'm thinking I was up to date (most icons are green) but It's seems I'm not.

I'm afraid to update and risk to lost all my configuration :?

Anyway I have to do because the plug-in doesn't work (I'm still with random walk).

Edit: :x I have updated OpenKore to the last version but I'm still in random Walk. There is no error message. :?:

Edit 2:
With

Code: Select all

autoPlanLockMapWalk 1
in config.txt, it's better :geek:

pxoto
Noob
Noob
Posts: 9
Joined: 04 Apr 2011, 18:56
Noob?: Yes

Re: Plan to walk in lock map !

#19 Post by pxoto »

How do you stop the bot from going in and out of the portal when moving from outside aldeba_in to lockmap with this plugin?
Portal Exists: aldeba_in -> aldebaran (94, 38) - (0)
Calculating lockMap route to: Juno Field
Map Change: aldebaran.gat (197, 68)
Portal Exists: aldebaran -> aldeba_in (197, 70) - (0)
Map Change: aldeba_in.gat (94, 41)
Portal Exists: aldeba_in -> aldebaran (94, 38) - (0)
Calculating lockMap route to: Juno Field(yuno_fild11)
Map Change: aldebaran.gat (197, 68)
Portal Exists: aldebaran -> aldeba_in (197, 70) - (0)
Map Change: aldeba_in.gat (94, 41)
Portal Exists: aldeba_in -> aldebaran (94, 38) - (0)

Mr_M
Noob
Noob
Posts: 10
Joined: 31 Mar 2011, 22:35
Noob?: No

Re: Plan to walk in lock map !

#20 Post by Mr_M »

I wander if this plugins use at master bot with setting of FollowBot enable.
When slave bot call master bot,the next route will jump to another one without reach the route destination.
If the slave calls more then the route will jump more.
Will it possible to make it stick the next route without jumping to another one, then try to reach to that destination after slave call complete.

Post Reply