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

Thread Closed 
 
Thread Rating:
  • 65 Vote(s) - 2.95 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with Scripting
Author Message
D0nnieDarko Offline
Elpy
*

Posts: 4
Joined: Apr 2011
Version: None
Post: #1
Help with Scripting

Hi,

i am trying to make a Script which uses skills on mobs while being on melee attack.

Probably i am just too stupid to find that option but if it really doesnt exist how does a script has to look like to use skills?

I have gotten this far but it aint working. Actually i adopted pretty much the style of the sample script with CH-BSOE

Code:
repeat
Sleep(10);

until GetMe():GetHpPrecent()<1.0;

if (GetMe():IsAttacking() == true) then
    UseSkill(400);
end;

I hope u can help me!

Greetings
D0nnieDarko
04-14-2011 10:03 AM
Find all posts by this user
ClockMan Offline
All Mighty
*******

Posts: 2,886
Joined: Jan 2011
Reputation: 499
Version: 1.4.3.143
Post: #2
RE: Help with Scripting

You can add those skills to Nuke Attack and enable also nuke attack settings....

GetMe():IsAttacking() this function may be "bugged" and don't have to work very well, it will be changed in future. But you can check if your target is mob and his hp is bellow 100%, and if distance to him isn't more than for example 100...

[Image: owner.gif]
04-14-2011 10:51 AM
Visit this user's website Find all posts by this user
Geddys Offline
Administrator
*******

Posts: 265
Joined: Dec 2010
Reputation: 89
Version: 1.4.1.93
Post: #3
RE: Help with Scripting

(04-14-2011 10:03 AM)D0nnieDarko Wrote:  Hi,

i am trying to make a Script which uses skills on mobs while being on melee attack.

Probably i am just too stupid to find that option but if it really doesnt exist how does a script has to look like to use skills?

I have gotten this far but it aint working. Actually i adopted pretty much the style of the sample script with CH-BSOE

Code:
repeat
Sleep(10);

until GetMe():GetHpPrecent()<1.0;

if (GetMe():IsAttacking() == true) then
    UseSkill(400);
end;

I hope u can help me!

Greetings
D0nnieDarko

You script has logic error.

main loop sleeps until you are under 1% of hp, and then u use skill.
04-14-2011 11:16 AM
Find all posts by this user
D0nnieDarko Offline
Elpy
*

Posts: 4
Joined: Apr 2011
Version: None
Post: #4
RE: Help with Scripting

(04-14-2011 11:16 AM)Geddys Wrote:  
(04-14-2011 10:03 AM)D0nnieDarko Wrote:  Hi,

i am trying to make a Script which uses skills on mobs while being on melee attack.

Probably i am just too stupid to find that option but if it really doesnt exist how does a script has to look like to use skills?

I have gotten this far but it aint working. Actually i adopted pretty much the style of the sample script with CH-BSOE

Code:
repeat
Sleep(10);

until GetMe():GetHpPrecent()<1.0;

if (GetMe():IsAttacking() == true) then
    UseSkill(400);
end;

I hope u can help me!

Greetings
D0nnieDarko

You script has logic error.

main loop sleeps until you are under 1% of hp, and then u use skill.

Omg, as i read it i saw it xD ... anyways i tried diffrent ways of that i also made a infinite loop instead of the repeat-until construct and it didnt work aswell

Code:
while true do
if (GetMe():IsAttacking() == true) then
    UseSkill(400);
end;
This other try was looking like that (I typed that right now, so it may contain syntax bugs)

So probably what Clock said is correct, i am going to try out the nuke setting things.

@Clock
How is the syntax to check target-type and target-hp status? I wanted to do that but didnt find the correct syntax. Would be nice for skills which can be activated at certain levels of hp (target or self).


Thanks for ur fast replies Big Grin ... its awesome to have such a fast "support".

Greetings
(This post was last modified: 04-14-2011 12:43 PM by D0nnieDarko.)
04-14-2011 12:40 PM
Find all posts by this user
Sakaszli Offline
I'm too pro to be pro.
*******

Posts: 1,189
Joined: Jan 2011
Reputation: 484
Version: 1.4.2.134.5b
Post: #5
RE: Help with Scripting

http://forum.l2tower.eu/showthread.php?tid=178

What do you mean by saying target-type?
04-14-2011 13:30 PM
Visit this user's website Find all posts by this user
D0nnieDarko Offline
Elpy
*

Posts: 4
Joined: Apr 2011
Version: None
Post: #6
RE: Help with Scripting

(04-14-2011 13:30 PM)sakaszli Wrote:  http://forum.l2tower.eu/showthread.php?tid=178

What do you mean by saying target-type?

player or npc or monster i mean with target type
04-14-2011 13:33 PM
Find all posts by this user
Sakaszli Offline
I'm too pro to be pro.
*******

Posts: 1,189
Joined: Jan 2011
Reputation: 484
Version: 1.4.2.134.5b
Post: #7
RE: Help with Scripting

bool IsPlayer();
bool IsMyPartyMember();
bool IsFriend();
bool IsMe();
bool IsNpc();

In user, mob i NPC too. Bool= true/false.
(This post was last modified: 04-14-2011 13:39 PM by Sakaszli.)
04-14-2011 13:38 PM
Visit this user's website Find all posts by this user
D0nnieDarko Offline
Elpy
*

Posts: 4
Joined: Apr 2011
Version: None
Post: #8
RE: Help with Scripting

(04-14-2011 13:38 PM)sakaszli Wrote:  bool IsPlayer();
bool IsMyPartyMember();
bool IsFriend();
bool IsMe();
bool IsNpc();

In user, mob i NPC too. Bool= true/false.

ah ... k npc = mob aswell xD that is what i missed here ... ty
04-14-2011 14:24 PM
Find all posts by this user
ClockMan Offline
All Mighty
*******

Posts: 2,886
Joined: Jan 2011
Reputation: 499
Version: 1.4.3.143
Post: #9
RE: Help with Scripting

Use bool IsEnemy(); to detect if it is mob or npc. You can also use this bool CanSeeMe();

[Image: owner.gif]
04-14-2011 15:00 PM
Visit this user's website Find all posts by this user
Thread Closed 




User(s) browsing this thread: 1 Guest(s)