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
repeat
if GetTarget() ~= nil then
 if GetTarget():IsAlikeDeath() and GetTarget():IsMonster() and GetZoneType() ~= 12 then
 SetPause(true);
 Sleep(400); --- set sleep time
 SetPause(false);
 -- 0 is disabled, 1 is by range, 2 is by point , 3 is polygon.
 end;
end;
 Sleep(200);
until false;



Try this.. just crossed my mind, i forgot that targetmode spams your chat.
Doesn't work. 2: attempt to index a nil value
Post updated, try now
Now it works. Finally Smile. Got to make it into a plugin tho.
K, let me know if you need any help
Would it be possible to include the spam f1-f2 script into this
So char would attack mob pause 3-5 seconds to allow spam of
f1-f2 target next mob rinse and repeat ?
I dont know exactly what you mean.. You wanna say: instead of that 3-5 seconds pause, use f1-f2? If yes, then here you go:
    LUA Programming
repeat
if GetTarget() ~= nil then
 if GetTarget():IsAlikeDeath() and GetTarget():IsMonster() and GetZoneType() ~= 12 then
 SetPause(true);
 Command("/useshortcut 1 1");
 Sleep(50);
 Command("/useshortcut 1 2");
 Sleep(50);
 Command("/useshortcut 1 1");
 Sleep(50);
 Command("/useshortcut 1 2");
 Sleep(50);
 Command("/useshortcut 1 1");
 Sleep(50);
 Command("/useshortcut 1 2");
 Sleep(100); --- set sleep time
 SetPause(false);
 -- 0 is disabled, 1 is by range, 2 is by point , 3 is polygon.
 end;
end;
 Sleep(200);
until false;



If this is not what you want, try to tell me what you need it for
sorry for not explaining better.
i use a script on forum to spam f1 and f2 and i put in-game
pickup action button in f1 and f2 but what is happening is char
goes to attack another mob and tries to pickup items at same time
so it just runs back and forth.what i was hoping for was to combine both the f1-f2 script and the target delay script together.
so char will attack mob wait 3-5 seconds to be able to pickup items
using f1-f2 script then target next mob.
Well it should work like this, have you tried it ?

Here i made a better version, it will check if there is any item near you and will pickup it, just change the range that will be checked for items near you on the first line 'itemrange'
    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 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;
 Sleep(100); --- set sleep time
 SetPause(false);
	end;
 end;
end;
 Sleep(200);
until false;



PS : my tower script is messed up, it doesnt show me if something is wrong in my script so there could be some mistakes. Try it and give a feedback
script error:lua error(script not valid)-[string"itemrange=500;..."]:7:
attempt to call a nil value
Pages: 1 2 3
Reference URL's