Jump to content

Recommended Posts

Posted

hello, i got a script for l2tower that works just fine, but i keep getting kicked from the server saying the gm will be informed (auto message), it's really annoying ofcourse as i have to relog everytime

 

i think the problem can be solved by editing the script, it would just need some random sleep / delay, but i have no clue how to do that, if it's possible, if there's a lot of changes that need to be done.

 

another thing, i'd like to know, are scripts from l2net also good for l2tower?

 

this is the script:

 

--[[-------------------------MAIN CONFIG PART ------------------------------------
Info: all ID's of enchant's and weapons can be obtained from file items.txt witch
 is in sub directory of L2Tower in \l2tower\config\LINEAGE_FOLDER\items.txt ]]

WeponId = 6579;	--Type here Id of your weapon 
			--Example: 6579	Arcana Mace
EnchantId = 959; --Type Id of your Enchant Weapon/Armor ID
			--Example
			--959	Scroll: Enchant Weapon (S-Grade)
			--960	Scroll: Enchant Armor (S-Grade)
maxenchant = 10;

--------------------------------------------------------------------------------
-- Dont change nothing under this line.
--------------------------------------------------------------------------------
GetEnchantManager():setDelay(2200);
ShowToClient("Enchant:", "Hi.. lets start enchanting");
--------------------------------------------------------------------------------
function getItemById(id, maxenchant)
invList = GetInventory();
for item in invList.list do
	if item.displayId == id and item.Enchanted < maxenchant then
		return item;
	end
end
end
--------------------------------------------------------------------------------
while true do
weapon = getItemById(WeponId, maxenchant);
enchant = getItemById(EnchantId, maxenchant);

if ( weapon == nil or enchant == nil ) then
	ShowToClient("Enchant:", "Out of weapons or enchants");
	break
end

if ( weapon.Enchanted >= maxenchant ) then
	ShowToClient("Enchant:", "Reached desired enchant");
	break
end

GetEnchantManager():setEnchantId(enchant.objectId);
GetEnchantManager():setItemId(weapon.objectId);
Sleep(300);
GetEnchantManager():Enchant();

Sleep(4500);
weapon = GetInventory():FindById(weapon.objectId);
Sleep (200);

if(weapon ~= nil)then
	ShowToClient("Enchant",  weapon.Name .. " is now +" .. weapon.Enchanted);
else
	ShowToClient("Enchant",  weapon.Name .. " failed on " .. weapon.Enchanted .. " -> " .. weapon.Enchanted+1)
end;
end;

 

any help will be greatly appreciated ;)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..