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

Thread Closed 
 
Thread Rating:
  • 9 Vote(s) - 3.44 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ISS Buffs - Starting when it is fadding
Author Message
lwcdr Away
Lord Vamp
***

Posts: 214
Joined: Jan 2012
Reputation: 15
Version: 1.4.2.137
Post: #1
ISS Buffs - Starting when it is fadding

Amiroooo helped me with the function, i just make the script for ISS Side, it basicaly will start buff when the buffs get fadding, wil not wait till it end completly, let me know if it is fine if not i can help u supporting this script.


Attached File(s)
.lua  Buff Full-ISS.lua (Size: 3.96 KB / Downloads: 858)
(This post was last modified: 05-11-2012 15:51 PM by lwcdr.)
05-11-2012 15:50 PM
Find all posts by this user
lwcdr Away
Lord Vamp
***

Posts: 214
Joined: Jan 2012
Reputation: 15
Version: 1.4.2.137
Post: #2
RE: ISS Buffs - Starting when it is fadding

(05-11-2012 16:49 PM)amiroooo Wrote:  I saw so many repetitions, you can use this unction too for buffs
    LUA Programming
function RequestBuff(Buff,TargetName,IsNeedParty,IsNeedTarget)
	local targetc = GetUserByName(TargetName);
	if (GetMe() ~= nil) and (targetc ~= nil) and (targetc:GetRangeTo(GetMe()) < 2000) then
		if (IsNeedParty) and (targetc:IsMyPartyMember() == false) then
			repeat
				Command('/invite ' .. TargetName);
				Sleep(1000);
			until targetc:IsMyPartyMember();
		end;
		if (IsNeedTarget) and ((GetTarget() == nil) or ((GetTarget() ~= nil) and (GetTarget():GetName() ~= TargetName))) then
			Command('/target ' .. TargetName);
			Sleep(1000);
		end;	
		if (tonumber(Buff) ~= nil) then
			UseSkillRaw(tonumber(Buff),false,false);
		else
			Command("/useskill " .. Buff);	
		end;
		Sleep(1000);
	end;
end;
 
 
if IsBuffRequireReCast(GetMe(),11524,30*1000) then 
	RequestBuff("Warrior's Harmony",DDName,true,true); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;



and I saw you try to party dismiss everytime, you can add dismiss only once in end of script instead with direct command instead of shortcut Command("/leave");
and you can add the whole thing inside repeat so you wont need to activate it each time you want buff check.


Alwaysu help me more and more i will do it.

amirooo i got this error. could u help me ?

i just run ur example to check and got this
[Image: error.jpg]


Attached File(s) Thumbnail(s)
   
(This post was last modified: 05-11-2012 18:32 PM by lwcdr.)
05-11-2012 17:37 PM
Find all posts by this user
lwcdr Away
Lord Vamp
***

Posts: 214
Joined: Jan 2012
Reputation: 15
Version: 1.4.2.137
Post: #3
RE: ISS Buffs - Starting when it is fadding

(05-11-2012 18:42 PM)amiroooo Wrote:  my post was to add also that function and example how to use it, you still need to add the IsBuffRequireReCast() function aswell.

got it ty

My code is this.

    LUA Programming
function IsBuffRequireReCast(target,debuffid,timeallowed)
	if (target ~= nil) and (target:GotBuff(debuffid) == true) then
	local thebuff = target:GetBuff(debuffid);
		if (thebuff.endTime  > GetTime() + timeallowed) then
			return false;
		end;
	end;
	return true;
end;
 
function RequestBuff(Buff,TargetName,IsNeedParty,IsNeedTarget)
	local targetc = GetUserByName(TargetName);
	if (GetMe() ~= nil) and (targetc ~= nil) and (targetc:GetRangeTo(GetMe()) < 2000) then
		if (IsNeedParty) and (targetc:IsMyPartyMember() == false) then
			repeat
				Command('/invite ' .. TargetName);
				Sleep(1000);
			until targetc:IsMyPartyMember();
		end;
		if (IsNeedTarget) and ((GetTarget() == nil) or ((GetTarget() ~= nil) and (GetTarget():GetName() ~= TargetName))) then
			Command('/target ' .. TargetName);
			Sleep(1000);
		end;	
		if (tonumber(Buff) ~= nil) then
			UseSkillRaw(tonumber(Buff),false,false);
		else
			Command("/useskill " .. Buff);	
		end;
		Sleep(1000);
	end;
end;
 
 
if IsBuffRequireReCast(GetMe(),11524,30*1000) then 
	RequestBuff("Warrior's Harmony",DDName,true,true); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
 
if IsBuffRequireReCast(GetMe(),11517,30*1000) then 
	RequestBuff("Horn Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
 
if IsBuffRequireReCast(GetMe(),11518,30*1000) then 
	RequestBuff("Drum Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
 
if IsBuffRequireReCast(GetMe(),11519,30*1000) then 
	RequestBuff("Pipe Organ Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
 
if IsBuffRequireReCast(GetMe(),11520,30*1000) then 
	RequestBuff("Guitar Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
 
if IsBuffRequireReCast(GetMe(),11521,30*1000) then 
	RequestBuff("Harp Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
 
if IsBuffRequireReCast(GetMe(),11522,30*1000) then 
	RequestBuff("Lute Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
 
---------------------------------------------------
------------------ Protections --------------------
---------------------------------------------------
 
if IsBuffRequireReCast(GetMe(),11565,30*1000) then 
	RequestBuff("Elemental Protection",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
 
if IsBuffRequireReCast(GetMe(),11566,30*1000) then 
	RequestBuff("Divine Protection",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
 
if IsBuffRequireReCast(GetMe(),11567,30*1000) then 
	RequestBuff("Mental Protection",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
 
---------------------------------------------------
-------------------- Sonatas ----------------------
---------------------------------------------------
 
if IsBuffRequireReCast(GetMe(),11529,30*1000) then 
	RequestBuff("Prevailing Sonata",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
 
if IsBuffRequireReCast(GetMe(),11530,30*1000) then 
	RequestBuff("Daring Sonata",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;
 
if IsBuffRequireReCast(GetMe(),11532,30*1000) then 
	RequestBuff("Refreshing Sonata",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
end;



And i still have this error
[Image: error.jpg]
(This post was last modified: 05-11-2012 19:04 PM by lwcdr.)
05-11-2012 18:50 PM
Find all posts by this user
amiroooo Offline
Beta Tester

Posts: 1,270
Joined: Sep 2011
Reputation: 412
Version: 1.4.2.142
Post: #4
RE: ISS Buffs - Starting when it is fadding



    LUA Programming
LeavePartyAfterBuffs = true; -- true if you want buffer to leaveparty after buffs.
DDName = "DD Name" -- the player name of whom need to get buffed.
 
 
function RequestBuff(Buff,TargetName,IsNeedParty,IsNeedTarget)
	local targetc = GetUserByName(TargetName);
	if (GetMe() ~= nil) and (targetc ~= nil) and (targetc:GetRangeTo(GetMe()) < 2000) then
		if (IsNeedParty) and (targetc:IsMyPartyMember() == false) then
			repeat
				if ((GetMyPtMembersCount() == 0) or (GetPartyMaster():GetName() == GetMe():GetName())) then
					Command('/invite ' .. TargetName);
				else
					ShowToClient("Iss Buffer Script","Im Unable to Invite the player, Im already in party and not the party leader!");
					Sleep(10000);
				end;
				Sleep(1000);
			until targetc:IsMyPartyMember();
		end;
		if (IsNeedTarget) and ((GetTarget() == nil) or ((GetTarget() ~= nil) and (GetTarget():GetName() ~= TargetName))) then
			Command('/target ' .. TargetName);
			Sleep(1000);
		end;	
		if (tonumber(Buff) ~= nil) then
			UseSkillRaw(tonumber(Buff),false,false);
		else
			Command("/useskill " .. Buff);	
		end;
		Sleep(1000);
	end;
end;
 
function IsBuffRequireReCast(target,debuffid,timeallowed)
	if (target ~= nil) and (target:GotBuff(debuffid) == true) then
	local thebuff = target:GetBuff(debuffid);
		if (thebuff.endTime  > GetTime() + timeallowed) then
			return false;
		end;
	end;
	return true;
end;
 
function GetMyPtMembersCount()
	local myptlist = GetPartyList():GetCount();
	local count = 0;
	if (tonumber(myptlist) ~= nil) then
		count = myptlist;
	end;
	return count;
end;
 
repeat
 
 
	if IsBuffRequireReCast(GetMe(),11524,30*1000) then 
		RequestBuff("Warrior's Harmony",DDName,true,true); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
	end;
 
	if IsBuffRequireReCast(GetMe(),11517,30*1000) then 
		RequestBuff("Horn Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
	end;
 
	if IsBuffRequireReCast(GetMe(),11518,30*1000) then 
		RequestBuff("Drum Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
	end;
 
	if IsBuffRequireReCast(GetMe(),11519,30*1000) then 
		RequestBuff("Pipe Organ Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
	end;
 
	if IsBuffRequireReCast(GetMe(),11520,30*1000) then 
		RequestBuff("Guitar Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
	end;
 
	if IsBuffRequireReCast(GetMe(),11521,30*1000) then 
		RequestBuff("Harp Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
	end;
 
	if IsBuffRequireReCast(GetMe(),11522,30*1000) then 
		RequestBuff("Lute Melody",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
	end;
 
	---------------------------------------------------
	------------------ Protections --------------------
	---------------------------------------------------
 
	if IsBuffRequireReCast(GetMe(),11565,30*1000) then 
		RequestBuff("Elemental Protection",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
	end;
 
	if IsBuffRequireReCast(GetMe(),11566,30*1000) then 
		RequestBuff("Divine Protection",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
	end;
 
	if IsBuffRequireReCast(GetMe(),11567,30*1000) then 
		RequestBuff("Mental Protection",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
	end;
 
	---------------------------------------------------
	-------------------- Sonatas ----------------------
	---------------------------------------------------
 
	if IsBuffRequireReCast(GetMe(),11529,30*1000) then 
		RequestBuff("Prevailing Sonata",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
	end;
 
	if IsBuffRequireReCast(GetMe(),11530,30*1000) then 
		RequestBuff("Daring Sonata",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
	end;
 
	if IsBuffRequireReCast(GetMe(),11532,30*1000) then 
		RequestBuff("Refreshing Sonata",DDName,true,false); -- (skillId or SkillName, playername that need buff, Does Skill Require Party?, Does the skill require target?)
	end;
	if (LeavePartyAfterBuffs) and (GetMyPtMembersCount() ~= 0) then
		Command("/leave");
	end;
 
	Sleep(1000);
until false;



(This post was last modified: 05-11-2012 19:20 PM by amiroooo.)
05-11-2012 19:19 PM
Find all posts by this user
 Reputed by : zaroos(+2)
lwcdr Away
Lord Vamp
***

Posts: 214
Joined: Jan 2012
Reputation: 15
Version: 1.4.2.137
Post: #5
RE: ISS Buffs - Starting when it is fadding

amirooo its working now, but as u know i am trying to learn lua scripts, what was my error ?
05-11-2012 19:26 PM
Find all posts by this user
amiroooo Offline
Beta Tester

Posts: 1,270
Joined: Sep 2011
Reputation: 412
Version: 1.4.2.142
Post: #6
RE: ISS Buffs - Starting when it is fadding

you didnt add the DDName variable.
05-11-2012 19:31 PM
Find all posts by this user
lwcdr Away
Lord Vamp
***

Posts: 214
Joined: Jan 2012
Reputation: 15
Version: 1.4.2.137
Post: #7
RE: ISS Buffs - Starting when it is fadding

(05-11-2012 19:31 PM)amiroooo Wrote:  you didnt add the DDName variable.

i was so close and was blind...
05-11-2012 19:36 PM
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  //cfg party buffs cant make them work (help) drake182 3 3,874 01-02-2016 05:47 AM
Last Post: Wazzapkhv
  Alert message when starting l2 client (after deleting l2 tower) likeorange 0 2,238 12-03-2015 00:31 AM
Last Post: likeorange
  party buffs stopped work buybuy 2 2,770 09-01-2015 19:54 PM
Last Post: buybuy
Thumbs Up Iss Buffs fotarastm 5 6,548 08-29-2015 00:55 AM
Last Post: jokerakos
  Can BOT automate to go back to city for buffs and get back XP? Dmoppers 2 2,836 01-02-2015 21:18 PM
Last Post: tophersoccer
  ISS BUFFS lampie2000 0 2,785 08-15-2014 10:09 AM
Last Post: lampie2000
  L2 Tower v1.4.1.119 Erro = Assist , Follow.Party Buffs penetrafox 12 8,471 05-06-2014 05:31 AM
Last Post: UDP
  For those having trouble w/ h5 auto-party buffs loosefingerz 0 2,122 08-23-2013 06:33 AM
Last Post: loosefingerz
Information Delay between buffs/skills Pauli88 2 3,205 08-12-2013 00:39 AM
Last Post: Pauli88
  Party buffs norvegas25 6 9,739 07-28-2013 16:45 PM
Last Post: jacka147



User(s) browsing this thread: