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

Thread Closed 
 
Thread Rating:
  • 11 Vote(s) - 2.91 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sitting/resting before target is dead.
Author Message
Bawths Offline
Elpy
*

Posts: 3
Joined: Dec 2011
Reputation: 0
Version: 1.4.1.70
Post: #1
Sitting/resting before target is dead.

So When i go under the percentage of mana or health the bot will sit before my target is dead and the mob will continue hitting me and the bot will just spam sit. So how can i set it so the bot will sit only when the mob is dead?[/u]
12-28-2011 23:55 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: #2
RE: Sitting/resting before target is dead.

I wrote this Plugin, didn't test it tho, to make it start/stop working type: //sitmode
you should start it at point where you want your char to sit.
    LUA Programming
Stand_When_HP_Percentage_Is_Bigger_Than = 60 ;
Stand_When_MP_Percentage_Is_Bigger_Than = 60 ;
Sit_When_MP_Percentage_Is_Lower_Than = 30 ;
Sit_When_HP_Percentage_Is_Lower_Than = 30 ;
 
---------
 
MoveStamp = GetTime();
Status = false;	
SitStatus = false;
 
function OnCreate()
	this:RegisterCommand("sitmode", CommandChatType.CHAT_ALLY, CommandAccessLevel.ACCESS_ME);
end;
 
function OnCommand_sitmode(vCommandChatType, vNick, vCommandParam)
activate()	
end;
 
function activate()
			if (Status == false) then
				FarmPoint = GetMe():GetLocation();
				Status = true ;	
				ShowToClient("Auto Sit/Stand","Auto Sit is now Activated.");
			else 		
				Status = false;	
				ShowToClient("Auto Sit/Stand","Auto Sit is now Deactivated.");
				--SetPause(true);				
			end;
end;
 
function OnLTick1s()
if (Status == true) then	
	if (GetMe():IsSiting() == true) and (MoveStamp +10000 < GetTime()) and (GetMe():GetMpPercent()> Stand_When_MP_Percentage_Is_Bigger_Than) and (GetMe():GetHpPercent()> Stand_When_HP_Percentage_Is_Bigger_Than) then
		MoveStamp = GetTime();
		Command("/Stand");
		ShowToClient("Auto Sit/Stand","Rested Enough, Time to PewPew.");
		SetPause(false);
		SitStatus = false;
	elseif (IsAllMobsUntargettingMe() == false) then
		SetPause(false);
		SitStatus = false;
	elseif (IsAllMobsUntargettingMe() == true) and ((GetMe():GetMpPercent() < Sit_When_MP_Percentage_Is_Lower_Than) or (GetMe():GetHpPercent() < Sit_When_HP_Percentage_Is_Lower_Than)) and (SitStatus == false) then
		SetPause(true);
		ClearTargets()
		CancelTarget(false);
		MoveToNoWait(GetMe():GetLocation());
		SitStatus = true;
	elseif (GetMe():IsInCombat() == false) and (MoveStamp +10000 < GetTime()) and (GetDistanceVector(FarmPoint,GetMe():GetLocation()) >= 400) and 
	(GetDistanceVector(FarmPoint,GetMe():GetLocation()) < 8000) and (SitStatus == true) and (GetMe():IsSiting() == false) then
		MoveStamp = GetTime();
		m = 200;
		loc = FarmPoint;
		lX = loc.X + math.random(-m, m);
		lY = loc.Y + math.random(-m, m);
		MoveToNoWait(lX, lY, loc.Z);
		SetPause(true);
	elseif (SitStatus == true) and (GetMe():IsSiting() == false) and (MoveStamp +10000 < GetTime()) and (GetDistanceVector(FarmPoint,GetMe():GetLocation()) < 400) and (GetMe():IsInCombat() == false)  then
		Command("/Sit");
		ShowToClient("Auto Sit/Stand","Sitting to Rest.");
		SetPause(true);
		MoveStamp = GetTime();
	end;
 
 
end;	
end;
 
 
function IsAllMobsUntargettingMe()
local MobList = GetMonsterList();
	for Mob in MobList.list do
		if (Mob:GetTarget() == GetMe():GetId()) then
			if not ((Mob:GetId() == GetMe():GetTarget()) and (Mob:IsAlikeDeath() == true)) then
				return false;
			end;
		end;
	end;	
return true;
end;


I updated it, i will be testing it in next days aswell.


Attached File(s)
.lua  Sit On Command.lua (Size: 2.69 KB / Downloads: 94)
(This post was last modified: 01-12-2012 16:48 PM by amiroooo.)
12-29-2011 00:09 AM
Find all posts by this user
Bawths Offline
Elpy
*

Posts: 3
Joined: Dec 2011
Reputation: 0
Version: 1.4.1.70
Post: #3
RE: Sitting/resting before target is dead.

When i type //sitmode nothing appears in chat. Also just to make sure all i had to do with use the ecript.exe and copy paste what you wrote.
12-29-2011 00:37 AM
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: Sitting/resting before target is dead.

do you see the plugin name in the plugin window when you check it?
//CFG > PLUGINS
you should see the file you copied, if it appears with yellow color then i mistyped smth, otherwise it should work.
(This post was last modified: 12-29-2011 00:52 AM by amiroooo.)
12-29-2011 00:50 AM
Find all posts by this user
Bawths Offline
Elpy
*

Posts: 3
Joined: Dec 2011
Reputation: 0
Version: 1.4.1.70
Post: #5
RE: Sitting/resting before target is dead.

(12-29-2011 00:50 AM)amiroooo Wrote:  do you see the plugin name in the plugin window when you check it?
//CFG > PLUGINS
you should see the file you copied, if it appears with yellow color then i mistyped smth, otherwise it should work.

yes its there in white, but still nothing with i type //sitmode
12-29-2011 00:57 AM
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: Sitting/resting before target is dead.

I just tried it and it worked.
12-29-2011 01:05 AM
Find all posts by this user
sypher Offline
VIP Member
***

Posts: 16
Joined: Dec 2011
Reputation: 0
Version: 1.4.1.71.2b
Post: #7
RE: Sitting/resting before target is dead.

Any way to make it get the values for sitting / standing from the bot already set parameters? Or are those nil when the sit/stand is not enabled?

(I know only premiums can access the 'read config' function, just wanted to know if those are set already or are nil, if you know)
12-29-2011 01:10 AM
Find all posts by this user
amiroooo Offline
Beta Tester

Posts: 1,270
Joined: Sep 2011
Reputation: 412
Version: 1.4.2.142
Post: #8
RE: Sitting/resting before target is dead.

(GetMe():IsSiting() == true/false)
the plugin I made is meant to substitute the l2tower sit feature so you have to turn it off first.
12-29-2011 01:28 AM
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  bot will target but not attack. elvis8925 3 3,764 04-09-2018 00:19 AM
Last Post: elvis8925
Star Remove Target canaldextiger 8 4,820 02-10-2018 22:19 PM
Last Post: canaldextiger
  Is lineage 2 RMT dead? kazurengan 0 2,371 08-06-2017 05:25 AM
Last Post: kazurengan
Information How to get 'PARTY MEMBER TARGET'? Caaioc 9 6,749 01-24-2016 09:57 AM
Last Post: TheQQmaster
  target for self buff manuel16007 1 3,246 01-22-2016 16:31 PM
Last Post: TheQQmaster
Rainbow Help to cancel target budarox 8 5,961 08-14-2015 06:31 AM
Last Post: budarox
  Change title to user's target vaskouf 4 4,228 06-28-2015 09:25 AM
Last Post: Vinter
  Clear target after kill mobs astalavista 0 2,958 06-07-2015 18:46 PM
Last Post: astalavista
  Target fix MoonSeed 5 7,414 03-23-2015 09:51 AM
Last Post: Fox
  How to remove the hold target? supera 5 4,334 12-26-2014 21:13 PM
Last Post: supera



User(s) browsing this thread: 1 Guest(s)