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

Thread Closed 
 
Thread Rating:
  • 6 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Auto Enchant Armor problems
Author Message
psyhyk Offline
Elpy
*

Posts: 3
Joined: Sep 2011
Reputation: 0
Version: 1.4.3.143
Post: #1
Auto Enchant Armor problems

i have some problems with enchanting Elegia Tunic {PvP} armor
i try a lot of auto enchant scripts but cannot make it work
i always get an error or out of item dialog
can some1 make a simple script for this item plz
i have in inventory lot of armors and lot of enchants
but somehow the script cannot start

i have this script :

function enchantResult()
return GetEnchantManager():getLastResult()
end

function getItemByName(name, maxenchant)
invList = GetInventory();
for item in invList.list do
if item.Name == name and item.Enchanted < maxenchant then
-- ShowToClient("ITEM", item.Name .. " (ID: " .. item.displayId .. ")");
return item
end
end
end

maxenchant = 10
GetEnchantManager():setDelay(3100)

while true do
-- weapon = getItemByName("Icarus Spirit", maxenchant)
-- enchant = getItemByName("Scroll: Enchant Weapon (S)", maxenchant)
weapon = getItemByName("Elegia Tunic {PvP}", maxenchant)
enchant = getItemByName("Scroll: Enchant Armor (S-Grade)", maxenchant)
if ( weapon == nil or enchant == nil ) then
ShowToClient("Enchant:", "Out of weapons of enchants")
break
end

if ( weapon.Enchanted > maxenchant ) then
ShowToClient("Enchant:", "Reached desired enchant")
break
end
if ( weapon.Enchanted < 3 ) then
GetEnchantManager():setEnchantId(enchant.objectId)
end;
if ( weapon.Enchanted >= 3 ) then
GetEnchantManager():setEnchantId(enchant.objectId)
end;
GetEnchantManager():setItemId(weapon.objectId)
GetEnchantManager():Enchant()
-- ShowToClient(">>>>", "Waiting for result...");
while ( enchantResult() == Enchant.ENCHANT_PENDING ) do
Sleep(200)
end
if ( enchantResult() == Enchant.ENCHANT_SUCCESS ) then
Sleep ( 100 ) -- sleep so item data is updated
weapon = GetInventory():FindById(weapon.objectId)
ShowToClient("Enchant", weapon.Name .. " is now +" .. weapon.Enchanted);
elseif ( enchantResult() == Enchant.ENCHANT_FAILURE ) then
ShowToClient("Enchant", weapon.Name .. " failed on " .. weapon.Enchanted .. " -> " .. weapon.Enchanted+1)
end
-- ShowToClient(">>>>", "Last result" .. tostring(enchantResult()));
end
03-28-2013 19:16 PM
Find all posts by this user
MtnDew Offline
VIP Member
***

Posts: 500
Joined: Mar 2012
Reputation: 110
Version: 1.4.2.141
Post: #2
RE: Auto Enchant Armor problems

Code:
while true do
-- weapon = getItemByName("Icarus Spirit", maxenchant)
-- enchant = getItemByName("Scroll: Enchant Weapon (S)", maxenchant)
weapon = getItemByName("Elegia Tunic {PvP}", maxenchant)
enchant = getItemByName("Scroll: Enchant Armor (S-Grade)", maxenchant)
if ( weapon == nil or enchant == nil ) then
ShowToClient("Enchant:", "Out of weapons of enchants")
break
end

I'm 90% sure that this is the part that is messed up, I'm no expert but it says Scroll: Enchant Weapon (S) when it should be and Armor Enchant, and it also says icarus Spirit. Also make sure that your server says (S) and not (S-Grade) or (S-grade).

+1 or +2 me if I helped you or you think I'm an ass. Tongue
(This post was last modified: 03-28-2013 23:07 PM by MtnDew.)
03-28-2013 23:06 PM
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Auto Augment - Services / AIO NPC. 2pho3nix 11 18,414 07-27-2020 09:37 AM
Last Post: z3renity
  Problems with L2J -Guard new server La2Dream Su spoka 12 12,683 10-27-2017 20:57 PM
Last Post: chohocvo
  [Need Help] Enchant Script nvnhathuy 1 5,564 03-03-2017 20:07 PM
Last Post: deivuzas1
  Help, with "Auto" De-level script JavaFan 3 3,347 11-12-2015 17:18 PM
Last Post: JavaFan
  Get skill enchant level raid1141 1 4,515 10-15-2015 14:57 PM
Last Post: raid1141
  problems with new ver tower laneri 0 1,944 10-06-2015 23:59 PM
Last Post: laneri
  Problems loading tower error listed Nikon187 17 16,042 10-06-2015 16:02 PM
Last Post: Natalia23
  [HELP] Auto Saved DC ! nikevers 0 2,120 07-28-2015 00:32 AM
Last Post: nikevers
  AUTO RES ACCEPT sonsfully 17 12,202 07-15-2015 19:59 PM
Last Post: Maveco
  Auto Accept Res Not working aywka 32 17,801 07-10-2015 08:16 AM
Last Post: TheQQmaster



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