Page 5 of 12

Re: waitForParty -- Don't get separeted! by Chontrad

Posted: 23 Sep 2008, 21:32
by Rumata
Hi, thanks for great plagin Mucilon ;)

couuld you make one more option in config? like "wait4party_Name BotNamme"?

because if there are 3 party members and one of them just sitting in safe place doing nothing and taking expa, i have to disable this plag else my
bot always returning to this member :(

help plzzz...

Re: waitForParty -- Don't get separeted! by Chontrad

Posted: 24 Sep 2008, 14:44
by Mucilon
Rumata
Try this version out...
Add this option at the config.txt:

Code: Select all

follow_wait_noPartyMember
You can only use one name of player party, to use more then one name, the plugin will must change!

[The extension pl has been deactivated and can no longer be displayed.]


Re: waitForParty -- Don't get separeted! by Chontrad

Posted: 24 Sep 2008, 23:19
by fco2783
@Mucilon
what is this follow_wait_noPartyMember for???

and if you can post a new guide for this plugin... beside from the first post...
like things needed to be added on the config... and etc... TIA...

Re: waitForParty -- Don't get separeted! by Chontrad

Posted: 25 Sep 2008, 10:07
by Mucilon
My bad...
About the options at the config.txt, with this new option you can make the master ignore one player in your party to the follow function, like a leech! (I think this is the right term)
So one player of your party can be seated at a corner of the map, just receiving the xp. And the master won't walk to him at any time, if the this player name are configured at this new option, so at the config.txt will be something like this:

Code: Select all

follow_wait 1
follow_wait_inLockOnly 0
follow_wait_timeOut 20
follow_wait_noPartyMember <partyname>
The new option follow_wait_noPartyMember can support only one name, if someone need more then one, tell me so I need to change the plugin. I did just one, because I think no one will need more then one!

About posting this version at the first post, I'll do it just after the test time. After at least 2 people test it and didn't found any problem... then I'll update the first post!
So, please, if you test it, post your comments...

Re: waitForParty -- Don't get separeted! by Chontrad

Posted: 27 Sep 2008, 06:05
by Rumata
it works fine! a lot of thanx to you ;)

Re: waitForParty -- Don't get separeted! by Chontrad

Posted: 28 Sep 2008, 20:19
by Mucilon
Thank you Rumata for test it and post the results!

Re: waitForParty -- Don't get separeted! by Chontrad

Posted: 03 Oct 2008, 04:05
by Rumata
2Mucilon
i've tested one more in xcore mode, there is one more bad thing - master return to x,y of slave remembed last time and even if he have found the slave ("Party Found") he is contenuing moving to this coordinates, he may run long to there and then will run back, frrrrr it is very fu....ing 'PALEVO' (sorry 'big trouble'), it's very need to add this string to plug

} elsif ($findParty && ($actor = $playersList->getByID($_))) {
warning "Party Found.\n", "waitParty";
$findParty = 0;
AI::clear("move", "route");
} elsif ($findParty) {

ps - sorry for my english :mrgreen:

Re: waitForParty -- Don't get separeted! by Chontrad

Posted: 03 Oct 2008, 07:41
by Mucilon
Did you add this line to the code and test it?
If so, can you post it?
If it is working fine, I'll post it at the first post.
Thanks!

Don't worry about your english, it isn't my native language either! Since we can understand each other, it's ok!

Re: waitForParty -- Don't get separeted! by Chontrad

Posted: 03 Oct 2008, 08:05
by Rumata
Yes? i've tested, it's working very good enough, no more useless running.

Code: Select all

###########################
# Name of Plugin: waitParty.pl
# Version: 1.0 (9/05/2008)
# Version of Openkore Required: OpenKore  2.0.5.1

#follow_wait 1
#follow_wait_inLockOnly 1
#follow_wait_timeOut 5
#follow_wait_noPartyMember NNNNNNName



package waitParty;

use Plugins;
use Globals;
use Log qw(message error warning debug);

our $findParty;
our $temp;
my %Timecount;

Plugins::register('waitParty', 'Wait and come back for party', \&unload, \&unload);
my $hooks = Plugins::addHooks(   ['actor_player_add', \&waitForOthers, undef],
            ['actor_player_remove', \&waitForOthers, undef],
            ['party_share', \&waitForOthers, undef],
            ['party_move', \&waitForOthers, undef],
            ['AI_pre', \&waitForOthers, undef],
            ['actor_action_sit', \&waitForOthers, undef],
            ['actor_action_stand', \&waitForOthers, undef]);

sub unload { 
	Plugins::delHooks($hooks);
}

sub waitForOthers {
	return unless $config{'follow_wait'};
	return unless defined @partyUsersID;

	#return if bot isn't at lockmap
	return if (($config{'follow_wait_inLockOnly'} > 0) && ($field{name} ne $config{lockMap}));

	my $actor;
	foreach (@partyUsersID) {
		next if $_ eq $accountID;
		next if $_ eq "";
		$actor = $playersList->getByID($_);
		
		next if ($char->{'party'}{'users'}{$_}{'name'} eq $config{'follow_wait_noPartyMember'});
		
		if(!$actor && $char->{'party'}{'users'}{$_}{'online'}) {
			my %party;

			$party{x} = $char->{party}{users}{$_}{pos}{x};
			$party{y} = $char->{party}{users}{$_}{pos}{y};
			($party{map}) = $char->{party}{users}{$_}{map} =~ /([\s\S]*)\.gat/;

			if ($party{map} ne $field{name} || $party{x} == 0 || $party{y} == 0) {
				delete $party{x};
				delete $party{y};
			}

			return unless ($party{map} ne $field{name} || exists $party{x});

			if ($Timecount{start} eq ''){
				$Timecount{start} = time;
			}
			$Timecount{current} = time;

			$Timecount{toreset} = $config{'follow_wait_timeOut'};
			if ($Timecount{toreset} eq '') {
				$Timecount{toreset} = 30;
			}
			$Timecount{after} = $Timecount{start} + $Timecount{toreset};
			if ($Timecount{current} >= $Timecount{after}){
				$Timecount{start} = time;
			}

			if (($Timecount{current} >= $Timecount{after})
				&& ((exists $ai_v{party} && AI::distance(\%party, $ai_v{party}) > 15)
				|| $party{map} != $ai_v{party}{map}
				|| (AI::timeOut($ai_v{party}{time}, 15) && AI::distance(\%party, $char->{pos_to}) > $config{followDistanceMax}))) {
			
	            $ai_v{party}{x} = $party{x};
	            $ai_v{party}{y} = $party{y};
	            $ai_v{party}{map} = $party{map};
	            $ai_v{party}{time} = time;

	            warning "Party is far way.\n", "waitParty";

	            if ($ai_v{party}{map} ne $field{name}) {
					message "Searching party: $ai_v{party}{map}\n", , "follow";
	            } elsif (AI::distance(\%party, $char->{pos_to}) > $config{followDistanceMax} ) {
					message "Searching party: $ai_v{party}{map} ($ai_v{party}{x},$ai_v{party}{y})\n", "follow";
	            } else {
					return;
	            }
	            AI::clear("move", "route", "mapRoute");
	            AI::ai_route($ai_v{party}{map}, $ai_v{party}{x}, $ai_v{party}{y}, distFromGoal => $config{followDistanceMin});
	            my $followIndex = AI::findAction("follow");
	            if (defined $followIndex) {
					$ai_seq_args[$followIndex]{ai_follow_lost_end}{timeout} = $timeout{ai_follow_lost_end}{timeout};
	            }
	        }
	        $findParty = 1;
	        return;
	    } elsif ($findParty && ($actor = $playersList->getByID($_))) {
	        warning "Party Found.\n", "waitParty";
	        $findParty = 0;
		
	AI::clear("move", "route");


	    } elsif ($findParty) {
	        warning "Party is offline.\n", "waitParty";
	        $findParty = 0;
	        return;
	    }
	}
}
1;

Re: waitForParty -- Don't get separeted! by Chontrad

Posted: 03 Oct 2008, 10:27
by Mucilon
Thanks for the help...
I'll update the first post soon!