(a very simple) playerAlert 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
newrobohead
Noob
Noob
Posts: 1
Joined: 20 Nov 2008, 02:52
Noob?: No

(a very simple) playerAlert plugin

#1 Post by newrobohead »

save as: detectPlayer.pl

Code: Select all

package detectPlayer;

use strict;
use Plugins;
use Globals;
use Misc;
use Utils;

Plugins::register('detectPlayer', 'detects other players', \&Unload);

my $hooks = Plugins::addHooks(
	['AI_pre', \&detectPlayers, undef]
);

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

sub detectPlayers {
	if (	$config{'playerAlert'}) {
		if (binSize(\@playersID) && timeOut($timeout{detectPlayer})) {
			Utils::Win32::playSound ($config{"playerBeep"});
			$timeout{detectPlayer}{time} = time;
}
}
}
1;
config.txt

Code: Select all

playerAlert 1
playerBeep C:\WINDOWS\Media\notify.wav
timeout.txt

Code: Select all

detectPlayer 2



This very simple plugin will give a sound alert whenever it detects another player on screen

problems:
it will also detect any of your other bots following it too =(


does anyone know how this may be used with IFF so that it doesn't falsely give alerts for friends/party/guild members?

Thanks!

-------------------------------
i know really little (as in none) about programming, but i'm very open to suggestions to make this plugin better =)
Last edited by newrobohead on 25 Nov 2008, 14:09, edited 1 time in total.

Bibian
Perl Monk
Perl Monk
Posts: 416
Joined: 04 Apr 2008, 03:08

Re: (a very simple) playerAlert plugin

#2 Post by Bibian »

uh there other hooks you can use you know... AI Pre is called a few thousand times per second, WAY too much overhead is created like this.

recollection
Noob
Noob
Posts: 1
Joined: 18 Mar 2009, 00:32
Noob?: Yes

Re: (a very simple) playerAlert plugin

#3 Post by recollection »

If this way of doing this is bad, what way should I do this? I only use the bot when I'm near the computer, and I'd like the bot to tell me when someone is around. Audio file would be the best way to do this, IMO. Other options besides this plugin?

Post Reply