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

Thread Closed 
 
Thread Rating:
  • 7 Vote(s) - 2.86 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Try to write Script for PK
Author Message
vdm89 Offline
VIP Member
***

Posts: 78
Joined: Oct 2012
Reputation: 2
Version: 1.4.2.138
Post: #1
Try to write Script for PK

I try to write one script for Target and hit only PK's Char , finaly i have this script
    LUA Programming
ReputationPoint=0;
RangeLimit=800;
repeat 
Sleep(10000); 
 
me=GetMe();
 
local playerlist = GetPlayerList();
for player in playerlist.list do
	if (player:GetReputation()<ReputationPoint)and(GetMe():GetRangeTo(me)<RangeLimit) then
 Target(player);
 Command("/useshortcut 2 3");
 Command("/attack");
 Sleep(10000);
 end;
 if (player:IsAlikeDeath())then
 Command("/useshortcut 2 2");
 end;end;
 until false;


In line 12 equip one BOW for hit PK , and in line 17 equip one sword ( when pk is death ) for continue to farm .
Only One problem , in GC don't work this script because my char ( she is in second floor) target char in first and 3 floor..
Any good solution ?
02-13-2013 03:54 AM
Find all posts by this user
TheBl4ckPhoenix Offline
(^.^)
****

Posts: 1,887
Joined: Mar 2012
Reputation: 601
Version: 1.4.3.143
Post: #2
RE: Try to write Script for PK

1) you wrote 2 time "end;" at the end of the script before "until falese;"
2) take down RangeLimit from 800 to mmh 500/400 ??
02-13-2013 04:08 AM
Find all posts by this user
vdm89 Offline
VIP Member
***

Posts: 78
Joined: Oct 2012
Reputation: 2
Version: 1.4.2.138
Post: #3
RE: Try to write Script for PK

if leave one "end;" have this error
[Image: 21HQl]
and i try with RangeLimit=100; but my char target other char in first and 3 floor

I tried setting the ReputationPoint to 500 to check which Char i have in target ..
Maybe i can try with static Coordinate like (X,Y,Z) and set Rangelimit to this Static Coordinate, what do you think?
(This post was last modified: 02-13-2013 04:25 AM by vdm89.)
02-13-2013 04:18 AM
Find all posts by this user
TheBl4ckPhoenix Offline
(^.^)
****

Posts: 1,887
Joined: Mar 2012
Reputation: 601
Version: 1.4.3.143
Post: #4
RE: Try to write Script for PK

Mmh yes, maybe that will fix the problem
02-13-2013 04:28 AM
Find all posts by this user
 Reputed by : chrisleche01(+1)
vdm89 Offline
VIP Member
***

Posts: 78
Joined: Oct 2012
Reputation: 2
Version: 1.4.2.138
Post: #5
RE: Try to write Script for PK

I don't have idea what command to use to set the static coordinate and verify (into if's comand) coordinated static < rangelimit

try with
    LUA Programming
StaticPoint(190704,59447,-4979);


and
    LUA Programming
StaticPoint<RangeLimit


but have this error [Image: 21ICN]


try with
    LUA Programming
GetDistanceVector(GetMe():GetLocation()<RangeLimit


but have this error[Image: 21IGq]

and try with
    LUA Programming
Point=GetMe():GetLocation();

and
    LUA Programming
Point<RangeLimit

but have this error[Image: 21IJt]

Problem done , finaly this is the script
    LUA Programming
ReputationPoint=0;
RangeLimit=500;
repeat 
Sleep(10000); 
Point=GetMe():GetLocation();
me=GetMe();
 
local playerlist = GetPlayerList();
for player in playerlist.list do
	if (player:GetReputation()<ReputationPoint)and(GetDistanceVector(GetMe():GetLocation(),Point)<RangeLimit) then
 Target(player);
 Command("/useshortcut 2 3");
 Command("/attack");
 Sleep(10000);
 end;
 if (player:IsAlikeDeath())then
 Command("/useshortcut 2 2");
 end;end;
 until false;

(This post was last modified: 02-13-2013 04:55 AM by vdm89.)
02-13-2013 04:48 AM
Find all posts by this user
 Reputed by : chrisleche01(+1) , TheBl4ckPhoenix(+2)
TheBl4ckPhoenix Offline
(^.^)
****

Posts: 1,887
Joined: Mar 2012
Reputation: 601
Version: 1.4.3.143
Post: #6
RE: Try to write Script for PK

Smile



One question, how you will kill the Pk guy? I mean, bow's bot vs a manually played Pk?
02-13-2013 11:39 AM
Find all posts by this user
cobra8co Offline
Unknown
***

Posts: 410
Joined: Sep 2012
Reputation: 67
Version: 1.4.3.143
Post: #7
RE: Try to write Script for PK

can be this like a plugin ?

but usig what wepon you have...if a pk in range you just atack him with what you are in hand...

--- +1 or +2 me if I was helped you! try Google is your friend!
(This post was last modified: 02-13-2013 12:23 PM by cobra8co.)
02-13-2013 12:22 PM
Find all posts by this user
TheBl4ckPhoenix Offline
(^.^)
****

Posts: 1,887
Joined: Mar 2012
Reputation: 601
Version: 1.4.3.143
Post: #8
RE: Try to write Script for PK

You can do everything, with right knowledge...
02-13-2013 12:27 PM
Find all posts by this user
vdm89 Offline
VIP Member
***

Posts: 78
Joined: Oct 2012
Reputation: 2
Version: 1.4.2.138
Post: #9
RE: Try to write Script for PK

Quote:One question, how you will kill the Pk guy? I mean, bow's bot vs a manually played Pk?
The script was done thinking about a pk with a lot of karma and therefore has the debuff which decreases p. def. , However you can change the target to take pk and attach it with the skill , septate with nuke attack.

Quote:can be this like a plugin ?
I don't know how to use this script like plugin , i'm sorry
02-13-2013 16:18 PM
Find all posts by this user
cooler Offline
Expired VIP Member
**

Posts: 2
Joined: Jan 2013
Reputation: 0
Version: 1.4.2.133
Post: #10
RE: Try to write Script for PK

can you modify the script in order we attack the PK char, but without changing any weapons ? just attack the PK char with the weapon we already have equipped..
02-14-2013 03:32 AM
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Where did you guys learn to write scripts? jamesisawesom 2 4,269 07-30-2014 16:21 PM
Last Post: eustach3
  Newspapers - what others write about us ... ClockMan 9 35,569 12-15-2013 17:17 PM
Last Post: bogdanel
Bug Sorry if I do not write in that branch BalanaRRR 2 2,232 03-25-2013 23:29 PM
Last Post: Forsakendeamon
  help me write a script lowbob 5 4,014 07-24-2012 23:07 PM
Last Post: iglaras22



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