Lineage 2 Tower Forum

Full Version: Help to cancel target
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi guys, I've been having a problem with my Healer , it happens this way : I have a script healer , but it does not heal and I set up to heal the tool " CP , HP, MP RECOVERY " in own tower. After healing , the healer does not miss the target , could someone please get me a script to cancel the target after healing ? Or a functional script healer to heal without so many problems?
sorry for my bad english

I thank you for the attention
You can use Canceltarget an Cleartarget

    LUA Programming
----------------------------------------------------
function ClearAllTargets()
	ClearTargets(); -- Clears all saved targets
	CancelTarget(true); -- Cancels active target
	Sleep(500)
end
------------------------------------------------------

(08-09-2015 19:53 PM)rORUMI Wrote: [ -> ]You can use Canceltarget an Cleartarget

    LUA Programming
----------------------------------------------------
function ClearAllTargets()
	ClearTargets(); -- Clears all saved targets
	CancelTarget(true); -- Cancels active target
	Sleep(500)
end
------------------------------------------------------


I'll test when server back

ty
(08-09-2015 19:53 PM)rORUMI Wrote: [ -> ]You can use Canceltarget an Cleartarget

    LUA Programming
----------------------------------------------------
function ClearAllTargets()
	ClearTargets(); -- Clears all saved targets
	CancelTarget(true); -- Cancels active target
	Sleep(500)
end
------------------------------------------------------


Man, this script just stop work, i guess he needs a command "repeat"
but I can't read this in lua configuration, and another question, 500 is 5 seconds ? ty

@rORUMI
    LUA Programming
Sleep(500)

is 0.5 sec, in helper say sleep is take a ms
(08-10-2015 21:00 PM)ExoDo Wrote: [ -> ]
    LUA Programming
Sleep(500)

is 0.5 sec, in helper say sleep is take a ms

as I set to repeat forever?
Repeat for eva y. But need some conditions to use clear

Sent from my Galaxy S5 via TAPTALK
Budarox, ClearAllTargets() in a simple function... created by me and used inside a lib of functions.

I Make ans Small test to you. Please Copy and paste the next code like a new script. Run It and letme know if work.

In My test over my iss.

- If target me, a char, a npc, in some secons, my iss lost the target.
- If my iss is using buff, the code wait.. an then cancel the target.

    LUA Programming
-- L2TOWER: LUA - CancelMyTarget.lua | rORUMI |  <a href="http://www.l2tower.eu" target="_blank">http://www.l2tower.eu</a>
-- Test: Cancel target if pass nTime secons
ShowToClient("Script", "CancelMyTarget v0.1 ACTIVE" , 3);
------------------------------------------------------
nTime = (5*1000) -- 5 sec
myTime = GetTime() -- Global time
  ----------------------------------------------------
function CheckTime()
local getTime = GetTime();
local getTime = tonumber(getTime);
local checkTime = tonumber(myTime);
local checkTime = myTime + nTime;
 
	if getTime > checkTime then
		myTime = GetTime() -- Global time	
		return true
	end
return false
end --fn
----------------------------------------------------
function ClearAllTargets()
	ClearTargets(); -- Clears all saved targets
	CancelTarget(true); -- Cancels active target
	Sleep(1000)
end
------------------------------------------------------
 
repeat
 
	if not (GetMe():IsAlikeDeath()) and (CheckTime() == true) then
		if (GetTarget() ~= nil) and not (GetMe():IsUsingMagic()) then ClearAllTargets() end;
	Sleep(500)
	else
	Sleep(1000)
	end
 
until false

(08-11-2015 06:49 AM)rORUMI Wrote: [ -> ]Budarox, ClearAllTargets() in a simple function... created by me and used inside a lib of functions.

I Make ans Small test to you. Please Copy and paste the next code like a new script. Run It and letme know if work.

In My test over my iss.

- If target me, a char, a npc, in some secons, my iss lost the target.
- If my iss is using buff, the code wait.. an then cancel the target.

    LUA Programming
-- L2TOWER: LUA - CancelMyTarget.lua | rORUMI | <a href="http://www.l2tower.eu" target="_blank">http://www.l2tower.eu</a>
-- Test: Cancel target if pass nTime secons
ShowToClient("Script", "CancelMyTarget v0.1 ACTIVE" , 3);
------------------------------------------------------
nTime = (5*1000) -- 5 sec
myTime = GetTime() -- Global time
 ----------------------------------------------------
function CheckTime()
local getTime = GetTime();
local getTime = tonumber(getTime);
local checkTime = tonumber(myTime);
local checkTime = myTime + nTime;
 
	if getTime > checkTime then
 myTime = GetTime() -- Global time	
 return true
	end
return false
end --fn
----------------------------------------------------
function ClearAllTargets()
	ClearTargets(); -- Clears all saved targets
	CancelTarget(true); -- Cancels active target
	Sleep(1000)
end
------------------------------------------------------
 
repeat
 
	if not (GetMe():IsAlikeDeath()) and (CheckTime() == true) then
 if (GetTarget() ~= nil) and not (GetMe():IsUsingMagic()) then ClearAllTargets() end;
	Sleep(500)
	else
	Sleep(1000)
	end
 
until false




ty
Reference URL's