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;
Code: Select all
playerAlert 1
playerBeep C:\WINDOWS\Media\notify.wav
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 =)