Macro for Auto dc when mob and Auto storage Problem

All resolved question will be found here. It is recommended that you browse / search through this section first and see if your question has been answered before

Moderators: Moderators, Documentation Writers

Message
Author
niko123
Plain Yogurt
Plain Yogurt
Posts: 88
Joined: 11 Sep 2010, 19:00
Noob?: Yes

Macro for Auto dc when mob and Auto storage Problem

#1 Post by niko123 »

Macro for Auto dc when mob by monsters or when low HP?? help pls

my problem about storage is..yung char ko pinipilit na dumikit sa katawan ng kafra ..anu po solution for this??
if I close the kore and start it again mag iistorage na siya...

my problem about storage is..yung char ko pinipilit na dumikit sa katawan ng kafra ..anu po solution for this??

Thanks in advance,, malapit na renewal!
Image

kaldabog
Plain Yogurt
Plain Yogurt
Posts: 83
Joined: 08 Sep 2010, 13:45
Noob?: No

Re: Macro for Auto dc when mob and Auto storage Problem

#2 Post by kaldabog »

use the antimob plugin not macro
http://forums.openkore.com/viewtopic.ph ... mob#p34057

post your autostorage block there's something wrong there
like your storageAuto_distance it maybe set to 0 or 1

niko123
Plain Yogurt
Plain Yogurt
Posts: 88
Joined: 11 Sep 2010, 19:00
Noob?: Yes

Re: Macro for Auto dc when mob and Auto storage Problem

#3 Post by niko123 »

kaldabog wrote:use the antimob plugin not macro
http://forums.openkore.com/viewtopic.ph ... mob#p34057

post your autostorage block there's something wrong there
like your storageAuto_distance it maybe set to 0 or 1
no its set to 5
Image

niko123
Plain Yogurt
Plain Yogurt
Posts: 88
Joined: 11 Sep 2010, 19:00
Noob?: Yes

Re: Macro for Auto dc when mob and Auto storage Problem

#4 Post by niko123 »

Code: Select all

Code:
#-------------------------------------------------------------------------------
# AntiMob
# *  for servers that have their teleport skill disabled (pRO Valkyrie/Valhala)
# coded by RJ (vmkjwan)
#
# This source code is licensed under the
# GNU General Public License, Version 2.
# See http://www.gnu.org/licenses/gpl.html
# -----------------------------------------------------------------------------
# Change Log:
# v0.1 (05/17/08) - Initial
# v0.2 (05/18/08) - Added computation based on HP:Aggro ratio
# v0.3 (06/04/08) - Added Life Insurance option
# -----------------------------------------------------------------------------
# How to use this plugin:
#
# in control\config.txt, put:
#
# antiMob (1|0)            
# antiMob_useInsu (1|0)   
#
#------------------------------------------------------------------------------

package antiMob;

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

Plugins::register("antiMob", "Relog when getting Mobbed", \&unload);

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

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

# default relogTime
my $relogTime = 60;

sub onAttack {
   return unless ($config{'antiMob'});
   my ($self, $args) = @_;
   my $aggros = scalar AI::ai_getAggressives();

   if ($args->{'targetID'} eq $accountID) {
      return if($args->{'dmg'} == 0);
      my $hp = $char->hp_percent();

      # I havent really tweaked the HP:Aggro ratio.. But it did saved me a lot of times
      if( $hp < 50 && ((ceil($hp/10)-1) >= $aggros) ) {
         Log::message(sprintf("Too many aggressives. HP: %s Aggro: %s\n", $hp, $aggros));

         # Should we use insu?
         if($config{'antiMob_useInsu'}) {
            # Check if theres an active Life Insurance status
            if(!$char->{statuses}{'Life Insurance'}) {
               my $insu = Actor::Item::get('Life Insurance', undef, 1);
               # Check if you really have the Life Insurance item
               if(defined $insu) {
                  Log::message("Using Life Insurance..\n");
                  $insu->use();
                  return;
               # You dont have it.. Relog
               } else {
                  Log::message("We dont have any Life Insurance item left.\n");
               }

            } else {         
               Log::message("Good thing we still have Life Insurance status.\n");
               return;
            }
         }
         Log::message("Relogging..\n");
         relog($relogTime);
      }
   }

}

sub ceil {
   my $r = shift;
   my $frac = $r - int($r);
   if($frac<=0) {
      return int($r);
   } else {
      return 1+int($r);
   }
}

1;
do i have to put that in any notepad??if not..where should i put that code?
Image

niko123
Plain Yogurt
Plain Yogurt
Posts: 88
Joined: 11 Sep 2010, 19:00
Noob?: Yes

Re: Macro for Auto dc when mob and Auto storage Problem

#5 Post by niko123 »

kaldabog wrote:use the antimob plugin not macro
http://forums.openkore.com/viewtopic.ph ... mob#p34057

post your autostorage block there's something wrong there
like your storageAuto_distance it maybe set to 0 or 1
heres my auto storage block

Code: Select all

######## Autostorage/autosell ########

buyAuto {
	npc
	standpoint
	distance 5
	minAmount 2
	maxAmount 3
}

sellAuto 0
sellAuto_npc
sellAuto_standpoint
sellAuto_distance 5

storageAuto 1
storageAuto_npc izlude 134 88 Kafra Employee
storageAuto_distance 5
storageAuto_npc_type 1
storageAuto_npc_steps c r1 n
storageAuto_password  <<dont worry about that
storageAuto_keepOpen 0
storageAuto_useChatCommand 0
relogAfterStorage 1
minStorageZeny

getAuto {
	minAmount
	maxAmount
	passive
}
Image

benj1320
Moderators
Moderators
Posts: 403
Joined: 25 Aug 2008, 14:56
Noob?: No
Location: CyberOne Building , Eastwood
Contact:

Re: Macro for Auto dc when mob and Auto storage Problem

#6 Post by benj1320 »

Code: Select all

storageAuto_npc izlude 134 88 Kafra Employee
is it really good to include the NPC name in the autoStorage block??? .. mine only has <map_name> <coordinates, coordinates> and its working perfectly fine....


and... I'd like to restrain posters from QUOTING a configuration/code block.... use BBCode

Code: Select all

 if you'll be posting long configuration blocks....
“The moon shines to both guilty and innocent alike..”
The Openkore Manual---Global Forum Rules--The Template

niko123
Plain Yogurt
Plain Yogurt
Posts: 88
Joined: 11 Sep 2010, 19:00
Noob?: Yes

Re: Macro for Auto dc when mob and Auto storage Problem

#7 Post by niko123 »

benj1320 wrote:

Code: Select all

storageAuto_npc izlude 134 88 Kafra Employee
is it really good to include the NPC name in the autoStorage block??? .. mine only has <map_name> <coordinates, coordinates> and its working perfectly fine....


and... I'd like to restrain posters from QUOTING a configuration/code block.... use BBCode

Code: Select all

 if you'll be posting long configuration blocks....[/quote]thank you..i will try that. can you help about the code??where should i put it??
 :D  Thank you po
Image

benj1320
Moderators
Moderators
Posts: 403
Joined: 25 Aug 2008, 14:56
Noob?: No
Location: CyberOne Building , Eastwood
Contact:

Re: Macro for Auto dc when mob and Auto storage Problem

#8 Post by benj1320 »

its a plugin... so put it inside the PLUGINS Folder...

http://wiki.openkore.com/index.php?title=Macro_plugin
“The moon shines to both guilty and innocent alike..”
The Openkore Manual---Global Forum Rules--The Template

niko123
Plain Yogurt
Plain Yogurt
Posts: 88
Joined: 11 Sep 2010, 19:00
Noob?: Yes

Re: Macro for Auto dc when mob and Auto storage Problem

#9 Post by niko123 »

thank you I will try it tomorrow I gotta go..time to sleep
:D :D :D
Image

kaldabog
Plain Yogurt
Plain Yogurt
Posts: 83
Joined: 08 Sep 2010, 13:45
Noob?: No

Re: Macro for Auto dc when mob and Auto storage Problem

#10 Post by kaldabog »

storageAuto_npc izlude 134 88 Kafra Employee

this is the error in your storage block proper is

Code: Select all

storageAuto_npc <map name> <x> <y>
    Specifies the NPC location for auto storage. 
read the manual carefully so you won't have errors

Locked