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

Post Reply 
 
Thread Rating:
  • 7 Vote(s) - 3.14 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AYUDA CON ENCHANT
Author Message
lucasdrag Offline
Goblin Grave Robber
*

Posts: 14
Joined: Aug 2013
Reputation: 0
Version: 1.4.3.143
Post: #1
Big Grin AYUDA CON ENCHANT

Hola a todos es primera vez que uso para enchantar el l2 tower vi varios tutoriasles y configure todo pero me tira solo un enchant y para y asi tengo que reiniciar para que tire otro estoy jugando este sv http://l2cyber.com/index.html. esta es la escript
-- SCRIPT CONFIGURATION!

item_name = "Dynasty Dagger"
--item_name = "Dynasty Dagger"
enchant_name = "Scroll: Blessed Enchant Weapon (Grade S)"
--enchant_name = "Blessed Scroll: Enchant Weapon (Grade S)"
blessed_enchant_name = "Scroll: Blessed Enchant Weapon (Grade S)"
max_enchant = 25
max_safe_enchant = 25
delay = 100

-- 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, 20)
else
enchant = getItemByName(enchant_name, 20)
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(200)
end

if ( enchantResult() == Enchant.ENCHANT_SUCCESS ) then
Sleep ( 500 ) -- 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+1)
Sleep ( 500 ) -- sleep so item data is updated
registerFailure ( item.Enchanted + 1)
end
printStatistics()
end
ShowToClient("Enchant", "Enchant script finished")
printStatistics()
08-10-2013 00:20 AM
Find all posts by this user Quote this message in a reply
juvilado1919 Offline
Elpy
*

Posts: 3
Joined: Oct 2012
Reputation: 0
Version: 1.4.2.133
Post: #2
RE: AYUDA CON ENCHANT

tengo el mismo problema en interlude
11-06-2013 17:59 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  ayuda general protection fault Aggresivnes 1 3,320 09-06-2021 23:06 PM
Last Post: markos2515
  Consulta/Ayuda shoeddy 0 1,447 05-18-2021 09:15 AM
Last Post: shoeddy
Star AYUDA CONFIGURARRR alaniz 0 1,645 01-02-2021 03:06 AM
Last Post: alaniz
  Ayuda para abrir mas de 3 cuentas kairos30 7 8,566 06-04-2020 05:36 AM
Last Post: studiotan
  Ayuda por favor ? me tira critical error lauchita92 0 1,815 10-30-2019 16:25 PM
Last Post: lauchita92
  Ayuda! Has sido desconectado del servidor madbytes 2 3,259 04-19-2018 20:28 PM
Last Post: madbytes
  Necesito ayuda porque me da critical error yigi1 5 5,830 01-26-2018 14:32 PM
Last Post: sousseky
Information Ayuda.. Load: general Error: call to loadLibrary N4N023 13 13,790 10-27-2017 01:19 AM
Last Post: smedina2005
Information (AYUDA) ERROR! Su cliente contiene archivos incorrectos Sustainer 0 2,125 10-13-2016 00:55 AM
Last Post: Sustainer
F.A.Q. Ayuda con un script Pls vannsito 0 2,355 07-23-2016 01:02 AM
Last Post: vannsito



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