L2Tower Discord
Let's keep the community alive with discord.
Discussions about plugins and scripts
L2Tower Discord
Thread Rating:
- 0 Vote(s) - 0 Average
- 1
- 2
- 3
- 4
- 5
Help to cancel target
|
Author |
Message |
budarox
Expired VIP Member
 
Posts: 16
Joined: Nov 2012
Reputation: 0
Version:
1.4.2.142
|
RE: Help to cancel target
(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-10-2015 06:12 AM |
|
budarox
Expired VIP Member
 
Posts: 16
Joined: Nov 2012
Reputation: 0
Version:
1.4.2.142
|
RE: Help to cancel target
(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
|
|
08-10-2015 16:39 PM |
|
ExoDo
Restrainer of Glory

Posts: 171
Joined: Feb 2014
Reputation: 12
Version:
1.4.2.142
|
RE: Help to cancel target
is 0.5 sec, in helper say sleep is take a ms
|
|
08-10-2015 21:00 PM |
|
Reputed by : | budarox(+2) |
budarox
Expired VIP Member
 
Posts: 16
Joined: Nov 2012
Reputation: 0
Version:
1.4.2.142
|
RE: Help to cancel target
(08-10-2015 21:00 PM)ExoDo Wrote: is 0.5 sec, in helper say sleep is take a ms
as I set to repeat forever?
|
|
08-10-2015 21:33 PM |
|
rORUMI
Expired VIP Member
 
Posts: 278
Joined: May 2014
Reputation: 50
Version:
1.4.2.142
|
RE: Help to cancel target
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
(This post was last modified: 08-11-2015 06:52 AM by rORUMI.)
|
|
08-11-2015 06:49 AM |
|
Reputed by : | budarox(+2) |
budarox
Expired VIP Member
 
Posts: 16
Joined: Nov 2012
Reputation: 0
Version:
1.4.2.142
|
RE: Help to cancel target
(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
|
|
08-14-2015 06:31 AM |
|
Possibly Related Threads... |
Thread: |
Author |
Replies: |
Views: |
Last Post |
|
GetTarget() don't return monsters target ID |
Xerovator |
3 |
1,083 |
11-16-2024 20:00 PM
Last Post: JennaDeh
|
|
bot will target but not attack. |
elvis8925 |
3 |
4,004 |
04-09-2018 00:19 AM
Last Post: elvis8925
|
 |
Remove Target |
canaldextiger |
8 |
5,279 |
02-10-2018 22:19 PM
Last Post: canaldextiger
|
 |
How to get 'PARTY MEMBER TARGET'? |
Caaioc |
9 |
7,214 |
01-24-2016 09:57 AM
Last Post: TheQQmaster
|
|
target for self buff |
manuel16007 |
1 |
3,419 |
01-22-2016 16:31 PM
Last Post: TheQQmaster
|
|
Change title to user's target |
vaskouf |
4 |
4,498 |
06-28-2015 09:25 AM
Last Post: Vinter
|
|
Clear target after kill mobs |
astalavista |
0 |
3,110 |
06-07-2015 18:46 PM
Last Post: astalavista
|
|
Target fix |
MoonSeed |
5 |
7,787 |
03-23-2015 09:51 AM
Last Post: Fox
|
|
How to remove the hold target? |
supera |
5 |
4,648 |
12-26-2014 21:13 PM
Last Post: supera
|
|
Fix target |
Tornet |
6 |
5,608 |
11-22-2014 00:55 AM
Last Post: soul2eat
|
User(s) browsing this thread: 1 Guest(s)