Страница 1 из 1

Проблема с Autobuy

Добавлено: Вт ноя 16, 2010 9:57 pm
ЗаБОТливый
buyAuto Свиток копейщика-6 {
npc prontera 41 337 c r0 r5 r0
standpoint prontera 48 330
distance 6
minAmount 1
maxAmount 15
price 42000
}


Где ошибка, почему не покупает ?

Re: Проблема с Autobuy

Добавлено: Вт ноя 16, 2010 11:45 pm
manticora
http://wiki.openkore.com/index.php/BuyAuto

Вот это сто пудов неверно:

Код: Выделить всё

npc prontera 41 337 c r0 r5 r0
Вместо этого следует написать что-то типа следующего:

Код: Выделить всё

npc prontera 41 337
npc_steps c r0 r5 r0

Re: Проблема с Autobuy

Добавлено: Ср ноя 17, 2010 12:20 am
EternalHarvest
buyAuto сейчас работает только с обычным магазином, npc_steps задаёт диалог до открытия этого магазина.

Можно легко добавить поддержку такого NPC, как совсем быстрый вариант просто закомментировать в AI::CoreLogic вот это:

Код: Выделить всё

			my $maxbuy = ($config{"buyAuto_$args->{index}"."_price"}) ? int($char->{zeny}/$config{"buyAuto_$args->{index}"."_price"}) : 1000000; # we assume we can buy 1000000, when price of the item is set to 0 or undef
			my $needbuy = $config{"buyAuto_$args->{index}"."_maxAmount"};
			$needbuy -= $char->inventory->get($args->{invIndex})->{amount} if ($args->{invIndex} ne ""); # we don't need maxAmount if we already have a certain amount of the item in our inventory
			$messageSender->sendBuyBulk([{itemID  => $args->{itemID}, amount => ($maxbuy > $needbuy) ? $needbuy : $maxbuy}]); # TODO: we could buy more types of items at once
и добавить нужный диалог вместе с покупкой некоторого количества вещей в npc_steps. При этом maxAmount работать не будет.

Re: Проблема с Autobuy

Добавлено: Ср ноя 17, 2010 3:17 am
ЗаБОТливый
сделал макрос методом тыка, использовал :
automacro aSell {
inventory "Meat" < 10
run-once 1
call {
pause 1
if (@invamount(Meat) > 9) goto end
do autosell
:end
release aSell
}
}
получилось:
automacro regalium {
inventory "Свиток копейщика-6" < 1
call buymerce
run-once 1
}

macro buymerce {
do move 48 330 prontera
pause 3
do talknpc 41 337 c r0 r5 r0
release regalium
}