On skill delays in Renewal patch

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

ryanblonna3
Human
Human
Posts: 30
Joined: 29 Jul 2010, 11:53
Noob?: No

On skill delays in Renewal patch

#1 Post by ryanblonna3 »

Hi guys, I wrote this code during the pre-renewal days. It's a macro sub that adds a task to the task manager. This task is supposed to automate the warping sequence:

Code: Select all

sub WarpTo {
	require Task::Chained;
	require Task::Function;
	require Task::UseSkill;

	my $portal = shift;

	if (defined Misc::inInventory('Blue Gemstone') && defined $portal) {
		my $block = GetNearestWalkable(2, $::config{'followMaxDistance'});

		if (defined $block) {
			my $task = new Task::Chained(
			'name' => 'Warp Portal',
			'priority' => Task::USER_PRIORITY,
			'tasks' => [
			new Task::Function(
			'function' => sub {
				shift->setDone if !AI::inQueue('macro');
			}
			),

			new Task::UseSkill(
			'skill' => new Skill('idn' => 27),
			'target' => $block,
			'stopWhenHit' => 1
			),

			new Task::Function(
			'function' => sub {
				return if !Utils::timeOut($char->{'skills'}{'AL_WARP'}{'time_used'}, 1);

				$::config{'warpList'} = join(',', @{$::char->{'warp'}{'memo'}});

				my $map = $portal =~ /^[0123]$/?
				$::char->{'warp'}{'memo'}->[$portal]:
				$::config{'warpList'} =~ /$portal\s?,|,\s?$portal/? $portal: '';

				if ($map ne '') {
					Log::message("[Warp] Creating portal to $map\n");
				} else {
					Log::message("[Warp] $portal not in warp memo\n");
				}

				$::messageSender->sendWarpTele(27, $map.'.gat');
				shift->setDone;
			}
			)
			]
			);

			$::taskManager->add($task);
		}

		return $block;
	}
}
However, ever since the patch, this task would never get past the UseSkill subtask. How should I deal with this? I noticed that all of the skills in the new patch have "action delays", and this may be the culprit. Any input would be appreciated. :-)
DrKN
Developers
Developers
Posts: 79
Joined: 06 Oct 2010, 09:22
Noob?: No

Re: On skill delays in Renewal patch

#2 Post by DrKN »

The action delay is a status. You can have a look on that..
i have wrote in twRO you can have a look on that.