Jump to content

Recommended Posts

Posted

Hey guys.
 
I`ve problem with L2 Tower and enchanting by this way. When i start the script, my item is enchanted once or twice, then it stopping, and I need to spam the ">" to enchant my item. Any solution what I have to change in this script?
 
Here is the script:

 

-- SCRIPT CONFIGURATION!
 
item_name = "Nightmarish Tattoo"
enchant_name = "Scroll: Enchant Armor (Grade A)"
blessed_enchant_name = "Blessed Scroll: Enchant Weapon (Grade S)"
max_enchant = 25
max_safe_enchant = 25
delay = 0
 
-- END OF SCRIPT CONFIGURATION
 
-- HELPER FUNCTIONS
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
            return item
        end
    end
end
 
stats = {}
 
function registerSuccess(base)
    if stats[base] == nil then
        stats[base] = { success = 0, failure = 0 }
    end
    stats[base].success = stats[base].success + 1
end
 
function registerFailure(base)
    if stats[base] == nil then
        stats[base] = { success = 0, failure = 0 }
    end
    stats[base].failure = stats[base].failure + 1
end
 
function printStatistics()
    for i,v in ipairs(stats) do
        ShowToClient("Enchant", "[" ..     i - 1 .. "->" .. i .. "] Rate: success: " .. v.success .. " / fail: " .. v.failure .." (" .. ( v.success  * 100 )/ ( v.success + v.failure ) .. "%)")
    end
end
 
-- MAIN LOOP!
 
while true do
    -- find item for enchanting
    item = getItemByName(item_name, max_enchant)
    if ( item == nil ) then
        ShowToClient("Enchant", "Out of items" )
        break
    end
    -- find proper enchant scroll
    enchant = nil
    if ( item.Enchanted >= max_safe_enchant ) then
        enchant = getItemByName(blessed_enchant_name, 5)
    else
        enchant = getItemByName(enchant_name, 5)
    end
 
    if ( enchant == nil ) then
        ShowToClient("Enchant", "Out of enchants")
        break
    end
 
     GetEnchantManager():setDelay(delay)
    GetEnchantManager():setEnchantId(enchant.objectId)
    GetEnchantManager():setItemId(item.objectId)
    GetEnchantManager():Enchant()
 
    while ( enchantResult() == Enchant.ENCHANT_PENDING ) do
        Sleep(0)
    end
 
    if ( enchantResult() == Enchant.ENCHANT_SUCCESS ) then    
        Sleep ( 0 ) -- sleep so item data is updated
        item = GetInventory():FindById(item.objectId)
        ShowToClient("Enchant",  item.Name .. " is now +" .. item.Enchanted);
        registerSuccess ( item.Enchanted )
    elseif ( enchantResult() == Enchant.ENCHANT_FAILURE ) then
        ShowToClient("Enchant",  item.Name .. " failed on " .. item.Enchanted .. " -> " .. item.Enchanted +4)
        Sleep ( 0 ) -- sleep so item data is updated
        registerFailure ( item.Enchanted +4 )
    end
    printStatistics()
end
ShowToClient("Enchant", "Enchant script finished")
printStatistics()

Posted

blessed_enchant_name = "Blessed Scroll: Enchant Weapon (Grade S)"

max_enchant = 25

max_safe_enchant = 25

 

....

And what? I don`t use blessed scrolls there so It dont need to be correct. Anyone have suggestion how to fix it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • just with this extender that I have shared it is not possible to start with c4 client, you have to make some changes to the extender and it works with c4 client perfectly. regarding the updates in this last revision   🔹dll is not packaged with vmprotect   New custom zone types have been added: 🔹 NO_NOBLESS begin MinX=84638 MaxX=92616 MinY=-87170 MaxY=-82018 MinZ=-6000 MaxZ=0 Type=NO_NOBLESS KickOutPos=83007/148057/-3464 end   ▶️ This zone checks if the character is noble. If it does not meet the condition, it will be automatically kicked to the indicated position (KickOutPos). 🔹 CUSTOM_SPAWN_ZONE begin MinX=77275 MaxX=85704 MinY=10122 MaxY=18066 MinZ=-8000 MaxZ=5000 Type=CUSTOM_SPAWN_ZONE OutPos=83007/148057/-3464 Spawns={{82984/18066/-5256}};{{79275/15147/-5248}};{{82922/14263/-5256}};{{83704/10122/-5288}} end ▶️ This zone allows characters, upon death, to respawn with full buff, CP, HP and MP if they press “Fixed”. They will only be able to revive in one of the positions defined in Spawns. 🔧 Both zones are fully configurable from territorydata.txt
    • Could you tell me what changed in this update?   more one question: Is it possible to log in through the c4 client instead of interlude? That would be great  
    • ➡ Discount for your purchase: JULY2025 (11% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • ➡ Discount for your purchase: JULY2025 (11% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock