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 areabut 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 do not want to use an action

useMagic
="no"; -- set yes if you want to use a skill to force attack cocoonset no if 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() == 178then
 
return 22;
 
end;
 
end;
 return 
2;
end;
--------------------------------------------------------------------------------
function 
GetItemsNumber(ItemId)
 
local a 0;
 
invList GetInventory();
 for 
item in invList.list do
 if (
item.displayId == ItemIdthen
 a 
item.ItemNum;
 
 
end;
 
end;
 if(
~= nil)then
 
return a;
 
end
 
if (== 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().<= monZ) and not ( (user:GetName() == NpcName1) or (user:GetName() == NpcName2) or (user:GetNpcId() == CocconId1) or (user:GetNpcId() == CocconId2) ) ) then
 c 
1;

 
end;

 if ( (
user:IsAlikeDeath() == false) and (user:GetRangeTo(GetMe()) < r2) and (user:GetLocation().<= 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 <= r1then
 
if ( (user:GetLocation().<= 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() == falsethen

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

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


meGetMe();
MyTr2 GetTarget();
monsterId,rangeCount CountMonstersInRange(rangeMobe3,rangeMobe2);

if ( 
MyTr2 == nil and not me:IsInCombat() and rangeCount )then
 loc
me:GetLocation();
 
lXloc.math.random(-CoordinateDeviationFromTargetCoordinateDeviationFromTarget);
 
lYloc.math.random(-CoordinateDeviationFromTargetCoordinateDeviationFromTarget);
 
MoveToNoWait(lXlY 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()) > DistanceToGoClosethen
 loc 
GetTarget():GetLocation();
 
lX loc.math.random(-CoordinateDeviationFromTarget2CoordinateDeviationFromTarget2);
 
lY loc.math.random(-CoordinateDeviationFromTarget2CoordinateDeviationFromTarget2);
 
MoveToNoWait(lXlYloc.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 == falsethen
 ProcessCommand
("/scriptStop "..ScriptFile);
 
Sleep(2000);
 if 
ProcessCommand("/scriptStart "..ScriptFilethen
 a
=0;
 
Sleep(60*1000*MinutesOut);
 
end;
 elseif ( 
charStatus == true) and (a==or ==nilthen
 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.2.142
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 3,367 04-19-2016 05:50 AM
Last Post: hesoyammi
  Проблемка со входом quix2012 2 3,396 06-21-2014 13:52 PM
Last Post: Nevka
  помогите проблемка... serega191 3 4,440 05-05-2014 07:34 AM
Last Post: Lordbl4
  Фарм GamerViP 2 4,266 12-16-2013 14:54 PM
Last Post: vladuska94
  баф и тп к фарм зоне sonata13x 2 5,204 10-10-2013 15:49 PM
Last Post: freemanpro
  фарм фреи alberthofman 5 7,047 09-03-2013 15:23 PM
Last Post: alberthofman
  Проблемка с пикапом pfuhepbvtyz 12 7,333 08-13-2013 14:06 PM
Last Post: VinsDEAD



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