Lineage 2 Tower Forum

Full Version: Target Delay
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
    LUA Programming
itemrange = 500;
repeat
if GetTarget() ~= nil then
 if GetTarget():IsAlikeDeath() and GetTarget():IsMonster() and GetZoneType() ~= 12 then
 SetPause(true);
	itemList = GetItemManager();
	for item in itemList.list do
 itemloc = item:GetLocation();
		if not item == nil then
			if GetRangeTo(itemloc) < itemrange then
			repeat
			 Command("/useshortcut 1 1");
			 Sleep(50);
			 Command("/useshortcut 1 2");
			 Sleep(50);
			 Command("/useshortcut 1 1");
			 Sleep(50);
			until GetRangeTo(itemloc) > itemrange
			end;
		end;
 Sleep(100); --- set sleep time
 SetPause(false);
	end;
 end;
end;
 Sleep(200);
until false;

(05-03-2014 03:26 AM)eustach3 Wrote: [ -> ]
    LUA Programming
itemrange = 500;
repeat
if GetTarget() ~= nil then
 if GetTarget():IsAlikeDeath() and GetTarget():IsMonster() and GetZoneType() ~= 12 then
 SetPause(true);
	itemList = GetItemManager();
	for item in itemList.list do
 itemloc = item:GetLocation();
 if not item == nil then
 if GetRangeTo(itemloc) < itemrange then
 repeat
 Command("/useshortcut 1 1");
 Sleep(50);
 Command("/useshortcut 1 2");
 Sleep(50);
 Command("/useshortcut 1 1");
 Sleep(50);
 until GetRangeTo(itemloc) > itemrange
 end;
 end;
 Sleep(100); --- set sleep time
 SetPause(false);
	end;
 end;
end;
 Sleep(200);
until false;


still getting same error
Try this one
    LUA Programming
itemrange = 500;
repeat
if GetTarget() ~= nil then
 if GetTarget():IsAlikeDeath() and GetTarget():IsMonster() and GetZoneType() ~= 12 then
 SetPause(true);
	itemList = GetItemManager();
	for item in itemList.list do
 itemloc = item:GetLocation();
 if not item == nil then
 if (GetMe():GetRangeTo(itemloc) <  itemrange) then
 repeat
 Command("/useshortcut 1 1");
 Sleep(50);
 Command("/useshortcut 1 2");
 Sleep(50);
 Command("/useshortcut 1 1");
 Sleep(50);
 until (GetMe():GetRangeTo(itemloc) >  itemrange)
 end;
 end;
 Sleep(100); --- set sleep time
 SetPause(false);
	end;
 end;
end;
 Sleep(200);
until false;



----------
If it doesnt work i`ll need to test it tomorrow but till then use this in worst case:
    LUA Programming
itemrange = 500;
repeat
if GetTarget() ~= nil then
 if GetTarget():IsAlikeDeath() and GetTarget():IsMonster() and GetZoneType() ~= 12 then
 SetPause(true);
	itemList = GetItemManager();
	for item in itemList.list do
 itemloc = item:GetLocation();
 if not item == nil then
 if (GetMe():GetRangeTo(itemloc) <  itemrange) then
 repeat
 Command("/useshortcut 1 1");
 Sleep(50);
 Command("/useshortcut 1 2");
 Sleep(50);
 Command("/useshortcut 1 1");
 Sleep(50);
 until (GetMe():GetRangeTo(itemloc) >  itemrange)
 end;
 end;
 Sleep(100); --- set sleep time
 SetPause(false);
	end;
 end;
end;
 Sleep(200);
until false;

Pages: 1 2 3
Reference URL's