Lineage 2 Tower Forum

Full Version: Unstuck Script ;/
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Eny1 know where i can find unstuck script becous when i exp my char all time stuck somewhere i have 1 script but he dont work so much becous my char go to mob and back go to mob and back go to mob and back....etc and that take a lot of time when he start atack ;/
this is a plugin, put in plugin folder.

type /tf in game to activate
For now working fine and Thx :*
(12-18-2014 17:34 PM)tophersoccer Wrote: [ -> ]this is a plugin, put in plugin folder.

type /tf in game to activate

Thanks for the plugin, works pretty well!
I tried the tf script,
I noticed that when paused, you must turn off tf other wise will still target and move towards mobs.
targetfix needs pause fix Tongue
(03-26-2015 13:47 PM)plixplox Wrote: [ -> ]I tried the tf script,
I noticed that when paused, you must turn off tf other wise will still target and move towards mobs.
targetfix needs pause fix Tongue

Yes... it doesnt check if L2T is paused or not,... u need to manualy turn it on and off... If using a script to farm, u can add the command in your script to start and stop it...

Would be nice if someone could add this function in the plugin... ti check if L2T is paused and stop the plugin... and start it again when we unpause...
Seriously... that's easy to add @capucine, you should know how to do that.
(07-01-2015 05:14 AM)MonkeyNuts Wrote: [ -> ]Seriously... that's easy to add @capucine, you should know how to do that.

Sorry to say, but I know nothing to LUA... I check into scripts and plugins, I manage to change a few things here and there... but that's it...

I would love to have time to learn it properly but I don't... Confused
@capucine idk will it work


    LUA Programming
TimeTillRequestChangeTarget = 1000*30 ; -- in mile seconds
TimeTillTryFixMovement = 1000*5 ; -- in mile seconds
 
TargetFixStatus = false;
--------------------------------------------
TargetFixStatusAuto = true; -- auto enabler
--------------------------------------------
unstuckingstatus = false;
mytargetid = 0;
MyTargetTimeStamp = GetTime();
unstuckmovementstamp = GetTime();
 
function OnCreate()
	this:RegisterCommand("tf", CommandChatType.CHAT_ALLY, CommandAccessLevel.ACCESS_ME);
end;
 
function OnCommand_tf(vCommandChatType, vNick, vCommandParam)
	if (TargetFixStatus == false) then
		TargetFixStatus = true;
		ShowToClient("Auto Fix","Target Fix Is Activated.");
	else
		TargetFixStatus = false;
		ShowToClient("Auto Fix","Target Fix Is Is Deactivated.");	
	end;
end;
 
 
 
function OnChatSystemMessage(id, msg)
	if (id == 181) then  --cannot see target
		if (GetMe():GetTarget() ~= 0) then 
			ShowToClient("Auto Fix"," Cannot See Target");
			GetTarget():SetBlock(true);
			CancelTargets();
		end;
	end;
end;
 
function OnLTick1s()
--------------------------------- AUTO ENABLE
if TargetFixStatusAuto then
	if not (IsPaused() and TargetFixStatus) then
		TargetFixStatus = true;
	elseif IsPaused() and TargetFixStatus then
		TargetFixStatus = false;
	end;
end;
 
-----------------------------------
 
if (TargetFixStatus == true) then
	if (mylastcordcheck ~= nil) then
		if (IsMoving() == false)  then
			if (GetTarget() ~= nil) and (GetMe():GetTarget() ~= 0)  then
				if (GetTarget():IsAlikeDeath() == false) and (GetTarget():IsMonster()) then
					if (mytargetid ~= GetTarget():GetId()) then
						mytargetid = GetTarget():GetId();
						MyTargetTimeStamp = GetTime();					
					end;					
				end;			
			end;
		else
			MyTargetTimeStamp = GetTime();
		end;
	end;	
if (GetTarget() ~= nil) and (GetMe():GetTarget() ~= 0)  then
	if GetTarget():IsMonster()  and (GetTarget():IsAlikeDeath() == false) then
		if (MyTargetTimeStamp + TimeTillRequestChangeTarget < GetTime()) then
			ShowToClient("Auto Fix"," Char Didnt Move/Hit/Nuke for the last " .. tostring(TimeTillRequestChangeTarget/1000) .. " seconds, so Changing Target!");
			GetTarget():SetBlock(true);
			CancelTargets();		
		elseif (MyTargetTimeStamp + TimeTillTryFixMovement < GetTime()) and (unstuckingstatus == false) then
			SetPause(true);
			unstuckmovementstamp = GetTime();
			unstuckingstatus = true;
			MovePerpendicularlyFromUser(GetTarget(),200);
		end;
	end;
end;
 
end;
mylastcordcheck = GetMe():GetLocation();
 
if (GetTarget() == nil) or (GetMe():GetTarget() == 0) or (GetMe():IsBlocked(true))  then
	MyTargetTimeStamp = GetTime();
end;
 
if (unstuckmovementstamp +2000 < GetTime()) and (unstuckingstatus == true) then
unstuckingstatus = false;
SetPause(false);
end;
 
 
end;
 
 
function MovePerpendicularlyFromUser(user,dist) -- took me an hour to write this down!
	YQ = user:GetLocation().Y
	YP = GetMe():GetLocation().Y
	XQ = user:GetLocation().X
	XP = GetMe():GetLocation().X
	Mp = -1/((YQ-YP)/(XQ-XP))		
	if ((-2*XP-2*Mp*Mp*XP)*(-2*XP-2*Mp*Mp*XP) -4*(Mp*Mp+1)*(Mp*Mp*XP*XP + XP*XP-dist*dist) > 0) then
		undersqrt = (-2*XP-2*Mp*Mp*XP)*(-2*XP-2*Mp*Mp*XP) -4*(Mp*Mp+1)*(Mp*Mp*XP*XP + XP*XP-dist*dist);
	else
		undersqrt = (-2*XP-2*Mp*Mp*XP)*(-2*XP-2*Mp*Mp*XP) -4*(Mp*Mp+1)*(Mp*Mp*XP*XP + XP*XP+dist*dist);
	end;		
	XN = (-1*(-2*XP-2*Mp*Mp*XP)+math.sqrt(undersqrt))/(2*(Mp*Mp+1));
	YN = YP + Mp*(XN-XP)		
	MoveToNoWait(XN,YN,GetMe():GetLocation().Z);
end;
 
 
function IsMoving()
	if (GetDistanceVector(GetMe():GetLocation(),mylastcordcheck) > 100) then
		return true;
	end;
return false;
end;
 
function OnMagicSkillUse(user, target, skillId, skillvl, skillHitTime, skillReuse)
	if (user:IsMe()) then
		MyTargetTimeStamp = GetTime();
	end;
end;
 
function OnAttack(user, target)
	if (user:IsMe()) or (target:IsMe()) then
		MyTargetTimeStamp = GetTime();
	end;
end;
 
function CancelTargets()
ClearTargets();
CancelTarget(true);
end;

Thx QQ, ill give it a try as soon as I have free time...

I Will be busy for the next 4-6 weeks... Just sold our house and moving to a city that is 12h away by car... Need to pack everything, check for a new house, unpack everything there, find new jobs... find a school for my daughter, find a kinder garden for my little boy...

So I wont be playing much!!!
Pages: 1 2
Reference URL's