(05-30-2012 18:13 PM)TheBl4ckPhoenix Wrote: Post it here
So it should be like this:
LUA Programming
ShowToClient("SYS","Script for buff detect started");
PPName = " xxx "; --here write name of your PPname
DDName = " yyy "; --write name of char you want buff
SendInvIfBufferInRange = 800;
----------------------------------------------------------------
WhoToInv = nil;
repeat
if(GetUserByName(PPName) == nil)then
ShowToClient("SYS","Your buffer is out of range, w8ing on him");
repeat
Sleep(1000);
until (GetUserByName(PPName) ~= nil);
ShowToClient("SYS","Your buffer is in range");
WhoToInv = GetUserByName(PPName);
elseif(GetUserByName(PPName) ~= nil)then
WhoToInv = GetUserByName(PPName);
end;
if((GetMe():GotBuff(1035) == false) or -- Mental Shield
(GetMe():GotBuff(1036) == false) or -- Magic Barrier
(GetMe():GotBuff(1040) == false) or -- Shield
(GetMe():GotBuff(1045) == false) or -- Blessed Body
(GetMe():GotBuff(1048) == false) or -- Blessed Soul
(GetMe():GotBuff(1077) == false) or -- Focus
(GetMe():GotBuff(1240) == false) or -- Guidance
(GetMe():GotBuff(1242) == false) or -- Death Whisper
(GetMe():GotBuff(1243) == false) or -- Bless Shield
(GetMe():GotBuff(1204) == false) or -- Wind Walk
(GetMe():GotBuff(1086) == false) or -- Haste
(GetMe():GotBuff(1068) == false) or -- Might
(GetMe():GotBuff(1044) == false) or -- Regeneration
(GetMe():GotBuff(1388) == false)) and -- Greater Might
(WhoToInv ~= nil) and
(WhoToInv:IsMyPartyMember() == false) and
(GetMe():GetRangeTo(WhoToInv) < SendInvIfBufferInRange)then
ShowToClient("SYS", "Inviting " ..PPName .. " for buff");
Sleep(800);
Command("/invite "..PPName);
repeat
Sleep(500);
until((GetMe():GotBuff(1035) ) and -- Mental Shield
(GetMe():GotBuff(1036) ) and -- Magic Barrier
(GetMe():GotBuff(1040) ) and -- Shield
(GetMe():GotBuff(1045) ) and -- Blessed Body
(GetMe():GotBuff(1048) ) and -- Blessed Soul
(GetMe():GotBuff(1077) ) and -- Focus
(GetMe():GotBuff(1240) ) and -- Guidance
(GetMe():GotBuff(1242) ) and -- Death Whisper
(GetMe():GotBuff(1243) ) and -- Bless Shield
(GetMe():GotBuff(1204) ) and -- Wind Walk
(GetMe():GotBuff(1086) ) and -- Haste
(GetMe():GotBuff(1068) ) and -- Might
(GetMe():GotBuff(1044) ) and -- Regeneration
(GetMe():GotBuff(1388) )) and -- Greater Might
(WhoToInv:IsMyPartyMember() == true);
ShowToClient("SYS", "Buffs up, leaving pt...");
Sleep(8000);
Command("/dismiss "..PPName);
Sleep(800);
end;
Sleep(1000);
until false;
[/quote]
I converted the script, but I do not know whether correctly. My WC adds to the party, but does not give buffs and for a moment dismiss following step.
This is my script:
ShowToClient("SYS","Script for buff detect started");
PPName = ""; --here write name of your PPname
DDName = ""; --write name of char you want buff
SendInvIfBufferInRange = 800;
----------------------------------------------------------------
WhoToInv = nil;
repeat
if(GetUserByName(PPName) == nil)then
ShowToClient("SYS","Your buffer is out of range, w8ing on him");
repeat
Sleep(1000);
until (GetUserByName(PPName) ~= nil);
ShowToClient("SYS","Your buffer is in range");
WhoToInv = GetUserByName(PPName);
elseif(GetUserByName(PPName) ~= nil)then
WhoToInv = GetUserByName(PPName);
end;
if(GetMe():GotBuff(1006) == false) or -- Chant of Fire
(GetMe():GotBuff(1007) == false) or -- Chant of Battle
(GetMe():GotBuff(1009) == false) or -- Chant of Shielding
(GetMe():GotBuff(1310) == false) or -- Chant of Vampire
(GetMe():GotBuff(1253) == false) or -- Chant of Rage
(GetMe():GotBuff(1252) == false) or -- Chant of Evasion
(GetMe():GotBuff(1251) == false) or -- Chant of Fury
(GetMe():GotBuff(1308) == false) or -- Chant of Predator
(GetMe():GotBuff(1309) == false) or -- Chant of Eagle
(GetMe():GotBuff(1390) == false) or -- War Chant
(WhoToInv ~= nil) and
(WhoToInv:IsMyPartyMember() == false) and
(GetMe():GetRangeTo(WhoToInv) < SendInvIfBufferInRange)then
ShowToClient("SYS", "Inviting " ..PPName .. " for buff");
Sleep(800);
Command("/invite "..PPName);
repeat
Sleep(500);
until(GetMe():GotBuff(1006) == false) or -- Chant of Fire
(GetMe():GotBuff(1007) == false) or -- Chant of Battle
(GetMe():GotBuff(1009) == false) or -- Chant of Shielding
(GetMe():GotBuff(1310) == false) or -- Chant of Vampire
(GetMe():GotBuff(1253) == false) or -- Chant of Rage
(GetMe():GotBuff(1252) == false) or -- Chant of Evasion
(GetMe():GotBuff(1251) == false) or -- Chant of Fury
(GetMe():GotBuff(1308) == false) or -- Chant of Predator
(GetMe():GotBuff(1309) == false) or -- Chant of Eagle
(GetMe():GotBuff(1390) == false) or -- War Chant
(WhoToInv:IsMyPartyMember() == true);
ShowToClient("SYS", "Buffs up, leaving pt...");
Sleep(8000);
Command("/dismiss "..PPName);
Sleep(800);
end;
Sleep(1000);
until false;