Openkore.com

OpenKore Forums
It is currently 20 Oct 2018, 22:05

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 119 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 12  Next
Author Message
 Post subject: Re: waitForParty -- Don't get separeted! by Chontrad
PostPosted: 23 Sep 2008, 21:32 
Offline
Noob
Noob
User avatar

Joined: 09 Apr 2008, 17:22
Posts: 9
Location: Russia
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...

_________________
if ($MANYquestions) {
brain enable 1;
} else {DIE!!!}


Top
 Profile  
 
 Post subject: Re: waitForParty -- Don't get separeted! by Chontrad
PostPosted: 24 Sep 2008, 14:44 
Offline
Cybernatic Entity
Cybernatic Entity
User avatar

Joined: 04 Apr 2008, 13:15
Posts: 249
Location: Brazil
Rumata
Try this version out...
Add this option at the config.txt:
Code:
follow_wait_noPartyMember

You can only use one name of player party, to use more then one name, the plugin will must change!
Attachment:
File comment: Need to test!
waitParty11.pl [3.69 KiB]
Downloaded 523 times

_________________
Old Openkore Manual | Macro Plugin Manual | Old Forum | My Perl Bible | Guide to figuring out server information


Top
 Profile  
 
 Post subject: Re: waitForParty -- Don't get separeted! by Chontrad
PostPosted: 24 Sep 2008, 23:19 
Offline
Plain Yogurt
Plain Yogurt
User avatar

Joined: 05 Apr 2008, 05:15
Posts: 95
Location: in place where you cant go
@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...


Top
 Profile  
 
 Post subject: Re: waitForParty -- Don't get separeted! by Chontrad
PostPosted: 25 Sep 2008, 10:07 
Offline
Cybernatic Entity
Cybernatic Entity
User avatar

Joined: 04 Apr 2008, 13:15
Posts: 249
Location: Brazil
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:
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...

_________________
Old Openkore Manual | Macro Plugin Manual | Old Forum | My Perl Bible | Guide to figuring out server information


Top
 Profile  
 
 Post subject: Re: waitForParty -- Don't get separeted! by Chontrad
PostPosted: 27 Sep 2008, 06:05 
Offline
Noob
Noob
User avatar

Joined: 09 Apr 2008, 17:22
Posts: 9
Location: Russia
it works fine! a lot of thanx to you ;)

_________________
if ($MANYquestions) {
brain enable 1;
} else {DIE!!!}


Top
 Profile  
 
 Post subject: Re: waitForParty -- Don't get separeted! by Chontrad
PostPosted: 28 Sep 2008, 20:19 
Offline
Cybernatic Entity
Cybernatic Entity
User avatar

Joined: 04 Apr 2008, 13:15
Posts: 249
Location: Brazil
Thank you Rumata for test it and post the results!

_________________
Old Openkore Manual | Macro Plugin Manual | Old Forum | My Perl Bible | Guide to figuring out server information


Top
 Profile  
 
 Post subject: Re: waitForParty -- Don't get separeted! by Chontrad
PostPosted: 03 Oct 2008, 04:05 
Offline
Noob
Noob
User avatar

Joined: 09 Apr 2008, 17:22
Posts: 9
Location: Russia
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:

_________________
if ($MANYquestions) {
brain enable 1;
} else {DIE!!!}


Top
 Profile  
 
 Post subject: Re: waitForParty -- Don't get separeted! by Chontrad
PostPosted: 03 Oct 2008, 07:41 
Offline
Cybernatic Entity
Cybernatic Entity
User avatar

Joined: 04 Apr 2008, 13:15
Posts: 249
Location: Brazil
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!

_________________
Old Openkore Manual | Macro Plugin Manual | Old Forum | My Perl Bible | Guide to figuring out server information


Top
 Profile  
 
 Post subject: Re: waitForParty -- Don't get separeted! by Chontrad
PostPosted: 03 Oct 2008, 08:05 
Offline
Noob
Noob
User avatar

Joined: 09 Apr 2008, 17:22
Posts: 9
Location: Russia
Yes? i've tested, it's working very good enough, no more useless running.

Code:
###########################
# 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;

_________________
if ($MANYquestions) {
brain enable 1;
} else {DIE!!!}


Top
 Profile  
 
 Post subject: Re: waitForParty -- Don't get separeted! by Chontrad
PostPosted: 03 Oct 2008, 10:27 
Offline
Cybernatic Entity
Cybernatic Entity
User avatar

Joined: 04 Apr 2008, 13:15
Posts: 249
Location: Brazil
Thanks for the help...
I'll update the first post soon!

_________________
Old Openkore Manual | Macro Plugin Manual | Old Forum | My Perl Bible | Guide to figuring out server information


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 119 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7, 8 ... 12  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group