Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ############################################################
- #
- # wrongPasswordSound
- #
- # This program is free software; you can redistribute it and/or
- # modify it under the terms of the GNU General Public License
- # as published by the Free Software Foundation; either version 2
- # of the License, or (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- #
- #
- # Plugin made by Henrybk from openkore Brasil
- #
- # What id does: When your openkore recieve a message of worng password from
- # the server it player a sound. By default the sound is 'SystemDefault' but
- # it can be changed using the key 'wrongPasswordAlertSound' on the config
- # Example:
- # wrongPasswordAlertSound C:\Users\Henrybk\Desktop\password.wav
- #
- # By Henrybk
- #
- ############################################################
- package wrongPasswordSound;
- use Plugins;
- use Globals;
- use Utils;
- use Log qw(message);
- use Network::Send;
- use Utils::Win32;
- Plugins::register('wrongPasswordSound', 'playes an alert sound when your kore inputs the wrong password', \&Unload);
- my $hooks = Plugins::addHooks(
- ['packet_pre/login_error', \&checkError, undef],
- );
- # onUnload
- sub Unload {
- message "Plugin wrongPasswordSound unloading\n", 'success';
- Plugins::delHooks($hooks);
- }
- sub checkError {
- my ($self, $args) = @_;
- if ($args->{type} == 1) {
- my $sound = $config{'wrongPasswordAlertSound'} ? $config{'wrongPasswordAlertSound'} : 'SystemDefault';
- Utils::Win32::playSound($sound);
- }
- }
- return 1;
Add Comment
Please, Sign In to add comment