Page 1 of 1

Use "Task::UseSkill" Error Help!!

Posted: 23 Apr 2015, 15:28
by yuranansam

Code: Select all

sub processAutobuyingstore {
	if ($config{'BuyingStore'} && !AI::isIdle) {
		$timeout{ai_shop}{time} = time;
	}

	if ($config{'BuyingStore'} && AI::isIdle && $conState == 5 && !$char->{sitting} && timeOut($timeout{ai_shop}) && !$buyingstorestarted
		&& $field->baseName eq $config{'lockMap'} && !$taskManager->countTasksByName('OpenBuying')) {
		if ($config{'shop_useSkill'}) {
			my $skill = new Skill(auto => "ALL_BUYING_STORE");

			require Task::UseSkill;
			my $skillTask = new Task::UseSkill(
				actor => $skill->getOwner,
				skill => $skill,
				priority => Task::USER_PRIORITY
			);
			my $task = new Task::Chained(
				name => 'OpenBuying',
				tasks => [
					new Task::ErrorReport(task => $skillTask),
					Task::Timeout->new(
						function => sub {main::OpenBuying()},
						seconds => $timeout{ai_shop_useskill_delay}{timeout} ? $timeout{ai_shop_useskill_delay}{timeout} : 5,
					)
				]
			);
			$taskManager->add($task);
		} else {
			main::OpenBuying();
		}
	}
}
Error: Casting is supposed to be finished now, but nothing happened.