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

Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
проблемка (фарм коконов)
Author Message
different Offline
Elpy
*

Posts: 4
Joined: Aug 2013
Reputation: 0
Version: 1.4.2.132
Post: #1
проблемка (фарм коконов)

HIGHT MOB COUNT
PHP Code:
ShowToClient("FAIRY","FAIRY COCON FARM ON");
--------------------------------------------------------------------------------
-- 
BASIC CONFIG
--------------------------------------------------------------------------------
NpcName1 = "Large Cocoon";
NpcName2 = "Cocoon";
CocconId1 = 32919;
CocconId2 = 32920;
NpcName3 = "Contaminated Cocoon";
NpcName4 = "Large Contaminated Cocoon";
CocconId3 = 19394;
CocconId4 = 19395;
CocconId5 = 19396;
GlimmerId = 17374;

----------
Distance related settings-----------------------
rangeMobe = 100; --range from you to check for mobes
rangeMobe2 
= 800; --range from you to check for Contaminated Cocoons
rangeMobe3 
= 800; --range to check for mobes when not attacking to force toon to move
rangeCoco 
= 800; --if some mobes up and range to target cocons
CoordinateDeviationFromTarget 
= 100;-- will move between -100 and 100 on x and y axis when mobs in area. but you are not attacking
monZ
=450; --Z Range to check for monsters
monZ2
=450; --Z Range to check for Contaminated Cocoons

monZ3
=450; --Z Range to check for Large and regular cocoons


---------
--------------------------
---
How to attack cocoons section 
useGlimmer
="no";-- set to yes or no if you want to use Glimmer when you have it must be yes or no and not Yes/No

useAction
="yes";-- set yes if you want to use an action to force attack cocoon/set no if u do not want to use an action

useMagic
="no"; -- set yes if you want to use a skill to force attack cocoon/ set no if u do not want to use a skill

SkillId
=10763;--set skill id here

-----------------------------
-------
these fields below are for when you have target but cannot see bot will move close to monster
DistanceToGoClose 
= 1100; -- set here the minimum distance from target that would make bot try to go near target.
CoordinateDeviationFromTarget2 = 1100; -- set here the max range that could be picked by bot randomly when trying go near target. 
MinimumMPPercentCheck = 65; -- dont go near target if ur mp is less than this.
-----------------------------------
--------------------------------------------------------------------------------
-- 
FUNCTIONS -- dont change nothing under this line
--------------------------------------------------------------------------------
MakeCancel = false;
--------------------------------------------------------------------------------
function 
WhatClassAmI()
 if(
GetMe() ~= nil)then
 
if(GetMe():GetClass() == 176) or (GetMe():GetClass() == 177) or (GetMe():GetClass() == 178) then
 
return 22;
 
end;
 
end;
 return 
2;
end;
--------------------------------------------------------------------------------
function 
GetItemsNumber(ItemId)
 
local a = 0;
 
invList = GetInventory();
 for 
item in invList.list do
 if (
item.displayId == ItemId) then
 a 
= item.ItemNum;
 
 
end;
 
end;
 if(
a ~= nil)then
 
return a;
 
end
 
if (a == nil)then
 
return 0;
 
end;
end;


--------------------------------------------------------------------------------
function 
CountMonstersInRange(r,r2)
 
local l = GetMonsterList();
 
local c = 0;
 
local g = nil;
 
 for 
user in l.list do 
 
 if ((
user:IsAlikeDeath() == false) and (user:GetRangeTo(GetMe()) < r) and (user:GetLocation().Z <= monZ) and not ( (user:GetName() == NpcName1) or (user:GetName() == NpcName2) or (user:GetNpcId() == CocconId1) or (user:GetNpcId() == CocconId2) ) ) then
 c 
= c + 1;

 
end;

 if ( (
user:IsAlikeDeath() == false) and (user:GetRangeTo(GetMe()) < r2) and (user:GetLocation().Z <= monZ2) and ( (user:GetName() == NpcName3) or (user:GetName() == NpcName4) or (user:GetNpcId() == CocconId3) or (user:GetNpcId() == CocconId4) or (user:GetNpcId() == CocconId5) ) ) then
 g 
= user:GetId();
 
end;
 
 
 
end;
 
 return 
g,c;
end; 
--------------------------------------------------------------------------------
function 
GetCocon(r)
 
local NpcL = GetNpcList();
 
local a = {};
 
local r1 = r;
 
 for 
user in NpcL.list do 
 
r2 = GetMe():GetRangeTo(user);
 
 if(
r2 <= r) and (r2 <= r1) then
 
if ( (user:GetLocation().Z <= monZ3) and (user:GetName() == NpcName1) or (user:GetName() == NpcName2) or (user:GetNpcId() == CocconId1)or (user:GetNpcId() == CocconId2)) then
 r1 
= r2;
 
a[0] = user:GetId();
 
 
end;
 
end;
 
end;
 return 
a;
end;
--------------------------------------------------------------------------------
-- 
Main loop
--------------------------------------------------------------------------------
repeat
 
if(IsPaused() == false) then

if (GetCocon(rangeCoco)[0] ~= nil) then
MyTr 
= GetTarget(); 
monsterId,rangeCount = CountMonstersInRange(rangeMobe,rangeMobe2);

-- if ( (
MyTr == nil) and (rangeCount <= 0 ) )then -- do not set lower that 2
 Target
(GetCocon(rangeCoco)[0]); --Target fouded cocon
 
 repeat
 
if (useGlimmer == "yes")then
 
if (GetItemsNumber(GlimmerId) ==0) then 
 
if (GetTarget()~=nil and GetTarget():IsPlayer() == false and GetTarget():IsPetOrSummon() == false ) then
 
if(useMagic == "yes")then
 UseSkillRaw
(SkillId, true, false);
 elseif(
useAction == "yes")then
 Action
(WhatClassAmI(), false, true);
 
end;
 
end; 
 elseif (
GetItemsNumber(GlimmerId) > 0) then 
 UseItem
(GlimmerId);
 
end;
 elseif (
useGlimmer == "no") then
 
if (GetTarget()~=nil and GetTarget():IsPlayer() == false and GetTarget():IsPetOrSummon() == false ) then
 
if(useMagic == "yes")then 
 UseSkillRaw
(SkillId, true, false); 
 elseif(
useAction == "yes")then
 Action
(WhatClassAmI(), false, true);
 
end;
 
end; 
 
end;
 
Sleep(500);

 
until GetTarget()~= nil and GetTarget():GetHp() == 0;
 
ClearTargets();
 
CancelTarget(false);
-- 
end;


 if ( (
MyTr ~= nil) and ( (MyTr:GetName() == NpcName1) or (MyTr:GetName() == NpcName2) or (MyTr:GetNpcId() == CocconId1) or (MyTr:GetNpcId() == CocconId2) ) )then
 Target
(GetCocon(rangeCoco)[0]); --Target found cocon 
 
 repeat
 
if (useGlimmer == "yes")then
 
if (GetItemsNumber(GlimmerId) ==0) then 
 
if (GetTarget()~=nil and GetTarget():IsPlayer() == false and GetTarget():IsPetOrSummon() == false ) then
 
if(useMagic == "yes")then 
 UseSkillRaw
(SkillId, true, false);
 elseif(
useAction == "yes")then
 Action
(WhatClassAmI(), false, true);
 
end;
 
end;
 elseif (
GetItemsNumber(GlimmerId) > 0) then 
 UseItem
(GlimmerId);
 
end;
 elseif (
useGlimmer == "no") then
 
if (GetTarget()~=nil and GetTarget():IsPlayer() == false and GetTarget():IsPetOrSummon() == false ) then
 
if(useMagic == "yes")then 
 UseSkillRaw
(SkillId, true, false);
 elseif(
useAction == "yes")then
 Action
(WhatClassAmI(), false, true);
 
end;
 
end; 
 
end;

 
Sleep(500); 
 
until GetTarget()~= nil and GetTarget():GetHp() == 0;
 
ClearTargets();
 
CancelTarget(false);
 
end;
 if(
MyTr ~= nil) and (MyTr:GetHp() == 0)then
 ClearTargets
();
 
CancelTarget(false);
 
Sleep(500);
 
end;
end;


monsterId,rangeCount = CountMonstersInRange(rangeMobe,rangeMobe2);
MyTr3 = GetTarget();

if 
monsterId ~=nil and MyTr3 == nil and rangeCount <= 0 then
Target
(monsterId); 
Sleep(500);

 if(
GetTarget() ~= nil) and (GetTarget():GetHp() == 0)then
 ClearTargets
();
 
CancelTarget(false);
 
Sleep(500);
 
end;


end;


me= GetMe();
MyTr2 = GetTarget();
monsterId,rangeCount = CountMonstersInRange(rangeMobe3,rangeMobe2);

if ( 
MyTr2 == nil and not me:IsInCombat() and rangeCount > 2 )then
 loc
= me:GetLocation();
 
lX= loc.X + math.random(-CoordinateDeviationFromTarget, CoordinateDeviationFromTarget);
 
lY= loc.Y + math.random(-CoordinateDeviationFromTarget, CoordinateDeviationFromTarget);
 
MoveToNoWait(lX, lY , loc.Z);
 
Sleep(500);
end;


if (
IsPaused() == false) and (GetTarget() ~= nil) and (GetTarget():IsAlikeDeath() == false or ( ((GetTarget():GetName() == NpcName1) or (GetTarget():GetName() == NpcName2) or (GetTarget():GetNpcId() == CocconId1)or (GetTarget():GetNpcId() == CocconId2) ) and not GetTarget():GetHp() == 0) ) and (GetMe() ~= nil) and (GetMe():GetMpPercent() > MinimumMPPercentCheck) and (GetDistanceVector(GetTarget():GetLocation(),GetMe():GetLocation()) < 8000) and (GetDistanceVector(GetTarget():GetLocation(),GetMe():GetLocation()) > DistanceToGoClose) then
 loc 
= GetTarget():GetLocation();
 
lX = loc.X + math.random(-CoordinateDeviationFromTarget2, CoordinateDeviationFromTarget2);
 
lY = loc.Y + math.random(-CoordinateDeviationFromTarget2, CoordinateDeviationFromTarget2);
 
MoveToNoWait(lX, lY, loc.Z);
end;

Sleep(800);
end;

Sleep(1000);
until false; 



бьет ближайшие коконы потом прекращает, скрипт юзаю на исе (баф онли)
взял скрипт который должен перезапускать 1-ый скрипт но вроде не пашет



PHP Code:
ScriptFile = "тут имя скрипта"; -- name of script
MinutesOut 
= 5; -- Time for repeat
a
=nil;


repeat
charStatus
= GetMe():IsAlikeDeath();
 if ( 
charStatus == false) then
 ProcessCommand
("/scriptStop "..ScriptFile);
 
Sleep(2000);
 if 
ProcessCommand("/scriptStart "..ScriptFile) then
 a
=0;
 
Sleep(60*1000*MinutesOut);
 
end;
 elseif ( 
charStatus == true) and (a==0 or a ==nil) then
 ProcessCommand
("/scriptStop "..ScriptFile);
 
a=1;
 
Sleep(2000);
 
end;
until 1<1; 


че делаю не так)?
09-03-2014 16:19 PM
Find all posts by this user Quote this message in a reply
different Offline
Elpy
*

Posts: 4
Joined: Aug 2013
Reputation: 0
Version: 1.4.2.132
Post: #2
RE: проблемка (фарм коконов)

апппппппппппппппп
09-04-2014 22:07 PM
Find all posts by this user Quote this message in a reply
phuntik Offline
VIP Member
***

Posts: 68
Joined: Feb 2013
Reputation: 5
Version: 1.4.1.102
Post: #3
RE: проблемка (фарм коконов)

На какой максимальной дистанции бьет мобов?
По скрипту стоит 800 клеток. Может просто увеличить дистанцию?
09-05-2014 08:26 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Реализуемо ли? Фарм лабы hesoyammi 0 6,235 04-19-2016 05:50 AM
Last Post: hesoyammi
  Проблемка со входом quix2012 2 4,899 06-21-2014 13:52 PM
Last Post: Nevka
  помогите проблемка... serega191 3 6,245 05-05-2014 07:34 AM
Last Post: Lordbl4
  Фарм GamerViP 2 6,555 12-16-2013 14:54 PM
Last Post: vladuska94
  баф и тп к фарм зоне sonata13x 2 7,182 10-10-2013 15:49 PM
Last Post: freemanpro
  фарм фреи alberthofman 5 9,988 09-03-2013 15:23 PM
Last Post: alberthofman
  Проблемка с пикапом pfuhepbvtyz 12 11,185 08-13-2013 14:06 PM
Last Post: VinsDEAD



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