Lineage 2 Tower Forum

Full Version: Need Mana Potion script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I tried t use the builtin use item/mana potion but it keep spamming my mana potion in 1 second interval. My 1000 mana potion are gone in 10 minutes.

Please share the mana potion script for use in Dragon network server/H5
    LUA Programming
ShowToClient(tostring(os.date("%X")),"MP pots");
 
PN = "manapotname"; -- edit pot name (Large Mana Potion is not equal to large mana potion), so type it correct
percentouse = 80; -- percent to stsrt use MP pots
 
 
function GetItemAmountByName(name) -- getting id of pot to use them
local invList = GetInventory();
	for item in invList.list do
		if (item.Name == name) then
			PNID = item.displayId;
			return item.ItemNum;
		end;
	end;
 
return 0;
end; 
 
 
repeat
	if(GetMe():GetMpPercent() < percentouse) and (GetItemAmountByName(PN) > 0) then -- percent to use and we got items
		UseItem(PNID); 
		Sleep(250);
	end;
	Sleep(200);
 
until false;

Thanks Smile

BTW, how do you make the auto spoil work?
Reference URL's