L2Tower Discord Let's keep the community alive with discord. Discussions about plugins and scripts L2Tower Discord

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IsSkillAvailable() and CanBeUsed() question
Author Message
rORUMI Offline
Expired VIP Member
**

Posts: 278
Joined: May 2014
Reputation: 50
Version: 1.4.2.142
Post: #1
IsSkillAvailable() and CanBeUsed() question

I need help with these features:

I understand that CanBeUsed() I check if I can use the skill on the target me, or monster

I understand that IsSkillAvailable() verify that "this" skill is available within my skills

Now my question is whether CanBeUsed() includes internally verify if the skill is available or necessary to use both functions to be sure?


What would be the best verification? or when required to do these checks?

CASE:1

Code:
if (Skill:IsSkillAvailable()) and (Skill:CanBeUsed()) then
UseSkillRaw(id,false,false)


CASE:2

Code:
if (Skill:CanBeUsed()) then
UseSkillRaw(id,false,false)
08-17-2014 03:20 AM
Find all posts by this user Quote this message in a reply
benbt91 Offline
VIP Member
***

Posts: 694
Joined: Mar 2012
Reputation: 47
Version: 1.4.3.143
Post: #2
RE: IsSkillAvailable() and CanBeUsed() question

(08-17-2014 03:20 AM)rORUMI Wrote:  I need help with these features:

I understand that CanBeUsed() I check if I can use the skill on the target me, or monster

I understand that IsSkillAvailable() verify that "this" skill is available within my skills

Now my question is whether CanBeUsed() includes internally verify if the skill is available or necessary to use both functions to be sure?


What would be the best verification? or when required to do these checks?

CASE:1

Code:
if (Skill:IsSkillAvailable()) and (Skill:CanBeUsed()) then
UseSkillRaw(id,false,false)


CASE:2

Code:
if (Skill:CanBeUsed()) then
UseSkillRaw(id,false,false)
if that will easy get erro ! Try this and change id + name

    LUA Programming
ShowToClient("Won","Skill ON");
----------------------------------------------------------------------------------CONFIG
SkillNameId = 1234 -- skill id set here
SkillName = GetSkills():FindById(SkillNameId); -- Find Skill By ID
 
----------------------------------------------------------------------------------
repeat
 
if (GetTarget() ~= nil) then
 if (GetTarget():IsMonster() == true) and (GetTarget():IsAlikeDeath() == false) 
 and (GetMe():IsAlikeDeath() == false) then
-------------------------------------------------------------------------Skills
 if (SkillName ~= nil) and (SkillName:CanBeUsed()) then
  Sleep(800);
 UseSkillRaw(SkillNameId,false,false);
 -- don't set id here look upside
 Sleep(1200);
 end;
 
 end;
end;
Sleep(1000);
until false;



+2 if helpful and next time use search frist Smile
(This post was last modified: 08-17-2014 05:15 AM by benbt91.)
08-17-2014 05:14 AM
Find all posts by this user Quote this message in a reply
13dk13 Offline
VIP Member
***

Posts: 259
Joined: Apr 2012
Reputation: 9
Version: 1.4.2.142
Post: #3
RE: IsSkillAvailable() and CanBeUsed() question

avaiable is when skill is rdy to go no delay.

canbeuse is if something like debuff prevent you to cast.

so better use both, btw now 131 is out suggest to get it
(This post was last modified: 08-17-2014 05:23 AM by 13dk13.)
08-17-2014 05:16 AM
Find all posts by this user Quote this message in a reply
rORUMI Offline
Expired VIP Member
**

Posts: 278
Joined: May 2014
Reputation: 50
Version: 1.4.2.142
Post: #4
RE: IsSkillAvailable() and CanBeUsed() question

(08-17-2014 05:16 AM)13dk13 Wrote:  avaiable is when skill is rdy to go no delay.

canbeuse is if something like debuff prevent you to cast.

so better use both, btw now 131 is out suggest to get it

Thanks
I will check now the new version.131
08-17-2014 06:30 AM
Find all posts by this user Quote this message in a reply
ClockMan Offline
All Mighty
*******

Posts: 2,886
Joined: Jan 2011
Reputation: 499
Version: 1.4.3.143
Post: #5
RE: IsSkillAvailable() and CanBeUsed() question

CanBeUsed checks also IsSkillAvailable.
Also it checks for stuns, mp, hp, ...
You don't need to use both

[Image: owner.gif]
(This post was last modified: 08-17-2014 09:31 AM by ClockMan.)
08-17-2014 09:30 AM
Visit this user's website Find all posts by this user Quote this message in a reply
rORUMI Offline
Expired VIP Member
**

Posts: 278
Joined: May 2014
Reputation: 50
Version: 1.4.2.142
Post: #6
RE: IsSkillAvailable() and CanBeUsed() question

(08-17-2014 09:30 AM)ClockMan Wrote:  CanBeUsed checks also IsSkillAvailable.
Also it checks for stuns, mp, hp, ...

Ty ClockMan!
08-17-2014 22:23 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  L2 Dragon question about bot, working or not kaan22747 0 2,809 02-15-2017 21:10 PM
Last Post: kaan22747
  Question about bot kiciulica66 0 1,949 12-03-2016 01:00 AM
Last Post: kiciulica66
F.A.Q. Sources question teris19942 1 2,812 06-04-2016 02:41 AM
Last Post: gamias1
  Multi-Box software question.. plixplox 3 3,464 11-19-2015 23:17 PM
Last Post: valakas123
F.A.Q. Question (??) budarox 0 2,063 07-04-2015 07:49 AM
Last Post: budarox
  newbie question vipernestas 2 3,283 04-29-2015 16:35 PM
Last Post: tsounakas
  hi all 1 question botosu86 0 1,726 02-24-2015 20:09 PM
Last Post: botosu86
  Question about L2Tower akoaymaylobo 1 2,327 02-04-2015 03:17 AM
Last Post: Fox
  a weird pick up question.... soul2eat 3 3,202 01-07-2015 13:48 PM
Last Post: knutoz
  AIR RUSH question capucine 26 15,226 01-04-2015 10:32 AM
Last Post: tuansydney



User(s) browsing this thread: