dcBeforeLevelUp

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
kingkevz
Human
Human
Posts: 25
Joined: 04 Apr 2008, 22:55

dcBeforeLevelUp

#1 Post by kingkevz »

Code: Select all

# dcBeforeLevelUp Plugin
# -whatisopenkore (Darkmoon Forums Member)
# (regards to punkpudding for his dcBefore99 Plugin)
# visit the official website at www.openkore.com
# Or join the discussion at the forums: darkmoon.ath.cx

package dcBeforeLevelUp;

use strict;
use Plugins;
use Globals;
use Log qw(message warning error);
use Misc;

Plugins::register('dcBeforeLevelUp', 'disconnect before leveling up', \&Unload);
my $hook = Plugins::addHook('AI_post', \&dcBefore99);

sub Unload {
   Plugins::delHook('AI_post', $hook);
}

my $timeout;

sub dcBeforeLevelUp {
   if (main::timeOut($timeout, 1)) {
      my $basePercent = ($chars[$config{'char'}]{'exp'} / $chars[$config{'char'}]{'exp_max'} * 100) if $chars[$config{'char'}]{'exp_max'};
      if ($chars[$config{'char'}]  && $basePercent >= 99.98) {
         message("Disconnecting before Leveling-Up!!\n", "system");
         quit();
      }
      $timeout = time;
   }
}

return 1;

You can change the exp % wherin kore will disconnect! Search this line: $basePercent >= 99.98) and change 99.98(default) into what % you want!

sli
Perl Monk
Perl Monk
Posts: 810
Joined: 04 Apr 2008, 17:26
Noob?: No

Re: dcBeforeLevelUp

#2 Post by sli »

Make the percentage a config value. Users shouldn't have to modify code.
cs : ee : realist

Post Reply