playerRecorder plugin

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
genuineopenkore
Plain Yogurt
Plain Yogurt
Posts: 52
Joined: 16 Jan 2011, 03:06
Noob?: Yes

Re: playerRecorder plugin

#31 Post by genuineopenkore »

thanks a lot sir KeplerBR

genuineopenkore
Plain Yogurt
Plain Yogurt
Posts: 52
Joined: 16 Jan 2011, 03:06
Noob?: Yes

Re: playerRecorder plugin

#32 Post by genuineopenkore »

Code: Select all

   return if ((time - $nickListTime{$targetName}) < 1);
   $nickListTime{$targetName} = time;
the code didn't work sir. it does not re-check the players around him...

Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

Re: playerRecorder plugin

#33 Post by Kaspy »

Fixed

I also added the command inform, that displays the list of players and how long were seen

Code: Select all

package ExamplePlugin;
	use strict;
	use warnings;
	use Plugins;
	use Log qw(message);
	use Globals;
	use Settings;
	use Actor;

Plugins::register('example', 'Example Plugin  ', \&Unload, \&Reload);
Plugins::addHook('player_exist', \&Called, undef);

my $commandHangmanGame = Commands::register(
		["inform", "Inform player list view", \&commandInform]
	);

my %nickListTime;

sub Unload {
Plugins::addHook('charNameUpdate', \&Called);
}

sub Reload {
Plugins::addHook('charNameUpdate', \&Called);
}

sub Called {
    my (undef, $args) = @_;
    my $targetName = $args->{player}{name};

   return if ($nickListTime{$targetName} && (time - $nickListTime{$targetName}) < 180);
   $nickListTime{$targetName} = time;
    
    Commands::run("p Player Seen: $targetName");
}

sub commandInform {
	my $message;
	
	for ( sort {$nickListTime{$b} <=> $nickListTime{$a}} keys %nickListTime) {
		$message .= "* $_ - " . (time - $nickListTime{$_}) . "\n";
	}
	
	message $message;
}

return 1;
Image

genuineopenkore
Plain Yogurt
Plain Yogurt
Posts: 52
Joined: 16 Jan 2011, 03:06
Noob?: Yes

Re: playerRecorder plugin

#34 Post by genuineopenkore »

Code: Select all

return if ($nickListTime{$targetName} && (time - $nickListTime{$targetName}) < 5);
its working sir but its not recording again on desired time...
i tried to adjust the time to see if its recording in every 5 seconds but still it records only for once and doe's not repeat it's process




Code: Select all

Plugins::addHook('player_exist', \&Called, undef);
this code sir its printing the names for once in a fast print like the use of the code in macro "[ ]"
It did only print for once just only when a newly logged bot and didn't record the players passing-by




Code: Select all

sub commandInform {
   my $message;
   
   for ( sort {$nickListTime{$b} <=> $nickListTime{$a}} keys %nickListTime) {
      $message .= "* $_ - " . (time - $nickListTime{$_}) . "\n";
   }
   
   message $message;
}
how thus this code triggered sir?





The difference in these codes

Code: Select all

Plugins::addHook('player_exist', \&Called, undef);
records only when newly logged in

Code: Select all

Plugins::addHook('charNameUpdate', \&Called, undef);
records when player is visble or whether its coming out or came back

Kaspy
Halfway to Eternity
Halfway to Eternity
Posts: 398
Joined: 08 Jun 2012, 15:42
Noob?: No
Location: Brazil

Re: playerRecorder plugin

#35 Post by Kaspy »

Change

Code: Select all

return if ($nickListTime{$targetName} && (time - $nickListTime{$targetName}) < 180)
to

Code: Select all

return if ((time - $nickListTime{$targetName}) < 180);
Regarding the hook, do not know what would be the ideal use.
genuineopenkore wrote:

Code: Select all

sub commandInform {
   my $message;
   
   for ( sort {$nickListTime{$b} <=> $nickListTime{$a}} keys %nickListTime) {
      $message .= "* $_ - " . (time - $nickListTime{$_}) . "\n";
   }
   
   message $message;
}
how thus this code triggered sir?
Enter the command inform in the console
Image

genuineopenkore
Plain Yogurt
Plain Yogurt
Posts: 52
Joined: 16 Jan 2011, 03:06
Noob?: Yes

Re: playerRecorder plugin

#36 Post by genuineopenkore »

return if ((time - $nickListTime{$targetName}) < 180);
still works the same sir :cry:

* PLAYERTEST - 34
This is what it printed when i type "inform" in the console. but when i'm not visible on the bot and when i type again the inform it still print the same

genuineopenkore
Plain Yogurt
Plain Yogurt
Posts: 52
Joined: 16 Jan 2011, 03:06
Noob?: Yes

Re: playerRecorder plugin

#37 Post by genuineopenkore »

Code: Select all

   return if ((time - $nickListTime{$targetName}) < 180);
forgot to mention sir. error on this line

Post Reply