Luna weekly Rank A - [Final Version] Updated: 04/12/2017

User avatar
smaion40
Posts: 83
Joined: Tue Apr 25, 2017 12:11 pm
Has thanked: 42 times
Been thanked: 16 times

Re: Luna weekly Rank A - [BETA Version] Updated: 29/10/2017

Post by smaion40 » Fri Dec 01, 2017 8:26 am

cooco wrote:
Tue Oct 31, 2017 1:19 am
this show you ALL entity in 100meters range

Code: Select all

function OnFrame()
	for ID, Entity in DictionaryIterator(EntityList:GetList()) do
		Write("Entity name: "..Entity:GetName().." EntityID: "..Entity:GetID().." EntityTypeID() - http://aiondatabase.net/en/npc/"..Entity:GetTypeID());
	end
end
Hey cooco, I'm using your function to check for entities. I have a question about skills being used inside that function.

I tried to use this routine that Diavolakos recommended:

Code: Select all

		
	--Healing Routine when Hp lower than 65%
	if Player:GetHealth() < 35 and CheckAvailable( "Cloak of Darkness" ) then
			CheckExecute( "Cloak of Darkness" );
			Write( "Healing up!")
			return true;
	end 
It works pretty good as long as there are no other skills being checked or used during that time.

My problem is that I'm trying to implement this:

Code: Select all

Summons = "Monster Name"

function OnFrame()
	for ID, Entity in DictionaryIterator(EntityList:GetList()) do
		if Entity:GetName() == Summons and CheckAvailable( "Terror's Restraint") then
			PlayerInput:Console("/Select "..Summons)
			PlayerInput:Console("/skill Soul Scream");
			PlayerInput:Console("/skill Wave of Darkness");
			PlayerInput:Console("/skill Terror's Restraint");
			Write( "Siege Watcher Summons Detected!")
			return true;
		end
	end
end	
In theory all these skills and Select monster name should trigger ONLY if both conditions are met, but in this case it spams the skill no matter if it is on cooldown.

This skill spam is giving me problems to execute the healing routine, any ideas about how to make it follow the conditions?, this is the last thing that I need to finish a definitive script with no timers :mrgreen:

PD: CheckAvailable function is as follows:

Code: Select all

function CheckAvailable( Name, SkipActivation )
	-- Retrieve the ability with the provided name.
	local Ability = AbilityList:GetAbility( Name );
	
	-- Check if the ability is valid and is not in cooldown.
	if Ability ~= nil and Ability:GetCooldown() == 0 and ( SkipActivation ~= nil or Ability:GetActivated()) then
		return true;
	end
	
	-- Either we do not have the ability or it is in cooldown.
	return false;
end

cooco
VIP
Posts: 218
Joined: Fri Feb 17, 2017 2:01 am
Has thanked: 58 times
Been thanked: 85 times

Re: Luna weekly Rank A - [BETA Version] Updated: 22/11/2017

Post by cooco » Fri Dec 01, 2017 3:19 pm

Code: Select all

function OnFrame()
	local Ability = AbilityList:GetAbility(""Terror's Restraint"" );
	
	-- Check if the ability is valid and is not in cooldown.
	if Ability ~= nil then
		Write("CD: "..Ability:GetCooldown()); 
	end
	Write("----------------");
end
Run this, u can see CD is wrong (always 0 second CD). Keep CD with a timer

Code: Select all

skillCD=Time();

if skillCD <Time() then
	PlayerInput:Console("/skill Terror's Restraint");
	skillCD = Time() + 8000; -- Time + 8second
end


User avatar
smaion40
Posts: 83
Joined: Tue Apr 25, 2017 12:11 pm
Has thanked: 42 times
Been thanked: 16 times

Re: Luna weekly Rank A - [BETA Version] Updated: 22/11/2017

Post by smaion40 » Sat Dec 02, 2017 11:38 pm

cooco wrote:
Fri Dec 01, 2017 3:19 pm
Run this, u can see CD is wrong (always 0 second CD). Keep CD with a timer

Exactly!, its showing 0 seconds all the time, after using the restriction with the timer started to work like a charm, I only had to add 1 extra second than the skill is showing, I.E Terror's restraint = 8 secs, and its working with 9 (Maybe casting ms are the reason). I'll be updating the script soon, thank you a lot :)

User avatar
Diavolakos
Posts: 114
Joined: Thu Apr 20, 2017 5:05 am
Has thanked: 31 times
Been thanked: 13 times

Re: Luna weekly Rank A - [BETA Version] Updated: 22/11/2017

Post by Diavolakos » Sun Dec 03, 2017 1:32 am

Reason why you need to add extra 1 second when you use a timer is because the moment AS tells the client to use the skill, he cient doesn't do it instantly due to lag and sometimes if the char is not in combat mode it takes about half a second to first enter the combat mode and then does the skill.

In case the skill's cooldown is viewable by AS, lags and delays of the client don't cause a problem because the skill will be used when ti is ready, so if it is ready 1 second later it will be done then.
I play on NA Server Siel

cooco
VIP
Posts: 218
Joined: Fri Feb 17, 2017 2:01 am
Has thanked: 58 times
Been thanked: 85 times

Re: Luna weekly Rank A - [BETA Version] Updated: 22/11/2017

Post by cooco » Sun Dec 03, 2017 1:53 am

smaion40 wrote:
Sat Dec 02, 2017 11:38 pm
cooco wrote:
Fri Dec 01, 2017 3:19 pm
Run this, u can see CD is wrong (always 0 second CD). Keep CD with a timer

Exactly!, its showing 0 seconds all the time, after using the restriction with the timer started to work like a charm, I only had to add 1 extra second than the skill is showing, I.E Terror's restraint = 8 secs, and its working with 9 (Maybe casting ms are the reason). I'll be updating the script soon, thank you a lot :)
;)

User avatar
smaion40
Posts: 83
Joined: Tue Apr 25, 2017 12:11 pm
Has thanked: 42 times
Been thanked: 16 times

Re: Luna weekly Rank A - [Final Version] Updated: 03/12/2017

Post by smaion40 » Sun Dec 03, 2017 4:58 am

Update:

*Timers were deleted and replaced by verification routines with entities names.
*Skill are now used with their respective CD for higher DMG output.
*All possible scenarios were estimated, (Boss pulls, Random monster aggro, etc)
*Rank A chances increased to 100%.

Pending:
There's only one thing that its giving me problems. Currently I'm using a name verification to do several actions depending on what entities are in range, this is usefull when only one entity is in range, in example:

Code: Select all

	
for ID, Entity in DictionaryIterator(EntityList:GetList()) do
	if Entity:GetName() == "Entity Name" then               <- If entity is in range
			PlayerInput:Console("/Select "..QuestBox) <- Select it
			PlayerInput:Console("/Skill Loot")             <- And do this
			return true;
	end
end
So, my problem begins when two entities that I must treat differently are in range. In this case is the Teleport to leave the instance, and the box that gives the quest item. If I use the same verification routine it will end leaving the instance before looting the box, because the portal is initially closer to your character.

As a solution I included a timer after the instance has finished (around 21 minutes) and then the box loot will be executed. This is not completely bad, but I want to remove it so my script can be executed at any time and a crash / Enable / Disable will not interfere with anything.

I have an idea about how to fix this, but it requires a verification for an entity that has disappeared. Example

Code: Select all

if Entity:GetName() == "Quest Box" and Entity:GetName() == "Exit Teleport"  then
	--Loot Quest Box because both exist and are in range
	--After this Quest Box will disappear
end
Then I need to do a verification including a flag or something that shows that certain entity is not in range.

Code: Select all

if Entity:GetName() == "Exit Teleport" and QuestBoxIsGone==True then
	--Use Exit Teleport
end
That way the script will work everytime, no matter if you started it at the end of the instance :).

User avatar
Diavolakos
Posts: 114
Joined: Thu Apr 20, 2017 5:05 am
Has thanked: 31 times
Been thanked: 13 times

Re: Luna weekly Rank A - [Final Version] Updated: 03/12/2017

Post by Diavolakos » Sun Dec 03, 2017 8:50 pm

If the instance is over you need to loot the box and then exist.

Wouldn't a few variables acting like a switch help? Like:
BoxLooted = false; then turned into true if you loot it

If BoxLooted = true then it means you can use the portal.

~~~~~~~~~~~

You could benefit from switch-type variables in many things that would be initialized like this:

FirstBossDead = false;
SecondBossDead = false;
BoxLooted = false;



and in case you died, is there any way you could "see" via the script if the instance is done? Like see the instance windows that says Rank A or Rank S etc?
I play on NA Server Siel

User avatar
smaion40
Posts: 83
Joined: Tue Apr 25, 2017 12:11 pm
Has thanked: 42 times
Been thanked: 16 times

Re: Luna weekly Rank A - [Final Version] Updated: 03/12/2017

Post by smaion40 » Sun Dec 03, 2017 9:29 pm

Diavolakos wrote:
Sun Dec 03, 2017 8:50 pm
If the instance is over you need to loot the box and then exist.

Wouldn't a few variables acting like a switch help? Like:
BoxLooted = false; then turned into true if you loot it

If BoxLooted = true then it means you can use the portal.
In theory is possible, but I'm not completely sure about how to make a flag inside a recurrent loop such as the EntityList iterator, the flag will change inmediately after the entity is in range, I would need to add some delay otherwise the next action that include the flag will be executed inmediately.
Diavolakos wrote:
Sun Dec 03, 2017 8:50 pm
You could benefit from switch-type variables in many things that would be initialized like this:

FirstBossDead = false;
SecondBossDead = false;
BoxLooted = false;
Ye, in fact there's something similar to FirstBossDead = false; early on this thread, it work for monsters, I need to test it for that box.
Diavolakos wrote:
Sun Dec 03, 2017 8:50 pm
and in case you died, is there any way you could "see" via the script if the instance is done? Like see the instance windows that says Rank A or Rank S etc?
It's possible, the other day I was practicing with the Dialog Inspector, there must be a section showing the instance Rank Notification and several actions could be made according to it. I didnt implement it because is really unlikely to die with this script (without external manipulation, clicks, attacks, character movement, etc).

amad
Posts: 26
Joined: Wed Mar 08, 2017 3:09 pm
Has thanked: 6 times

Re: Luna weekly Rank A - [Final Version] Updated: 03/12/2017

Post by amad » Mon Dec 04, 2017 2:23 pm

I tried some runs but i have a problem,basically all chars just go in the boss room and spam /skill loot without doing nothing,i already changed automatic loot on false,but it keep doing it.

User avatar
smaion40
Posts: 83
Joined: Tue Apr 25, 2017 12:11 pm
Has thanked: 42 times
Been thanked: 16 times

Re: Luna weekly Rank A - [Final Version] Updated: 03/12/2017

Post by smaion40 » Mon Dec 04, 2017 4:02 pm

amad wrote:
Mon Dec 04, 2017 2:23 pm
I tried some runs but i have a problem,basically all chars just go in the boss room and spam /skill loot without doing nothing,i already changed automatic loot on false,but it keep doing it.
EU version fixed and tested.

*Some entity names were not correct.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest