Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ayuda Auto Enchant
Author Message
Aggresivnes Offline
Gremlin
*

Posts: 7
Joined: Jan 2014
Reputation: 0
Version: 1.4.2.132
Post: #1
Ayuda Auto Enchant
hola tengo un problema cuando pongo el auto enchant pongo todo los datos y le doy para que empiese a enchantar y solo enchanta 2 veses y se detiene y tengo que volver a darle para que enchante alguno sabe la solucion? este es mi enchant.lua

Quote:-- SCRIPT CONFIGURATION!

item_name = "Draconic Leather Boots"
enchant_name = "Blessed Scroll: Enchant Armor (Grade S)"
blessed_enchant_name = "Blessed Scroll: Enchant Armor (Grade S)"
max_enchant = 15
max_safe_enchant = 1
delay = 5

-- 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()
02-01-2014 05:16 AM
Find all posts by this user Quote this message in a reply
Aggresivnes Offline
Gremlin
*

Posts: 7
Joined: Jan 2014
Reputation: 0
Version: 1.4.2.132
Post: #2
RE: Ayuda Auto Enchant
nadie sabe la solucion? si responden me serviria de mucho gracias [/align]
02-02-2014 05:00 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Ayuda! Has sido desconectado del servidor madbytes 2 367 04-19-2018 20:28 PM
Last Post: madbytes
  Necesito ayuda porque me da critical error yigi1 5 1,140 01-26-2018 14:32 PM
Last Post: sousseky
Information Ayuda.. Load: general Error: call to loadLibrary N4N023 13 6,460 10-27-2017 01:19 AM
Last Post: smedina2005
  Ayuda para abrir mas de 3 cuentas kairos30 6 1,795 05-24-2017 04:15 AM
Last Post: julianotamendi
Information (AYUDA) ERROR! Su cliente contiene archivos incorrectos Sustainer 0 455 10-13-2016 00:55 AM
Last Post: Sustainer
F.A.Q. Ayuda con un script Pls vannsito 0 569 07-23-2016 01:02 AM
Last Post: vannsito
  me gustaria una ayuda porfavor oscarxd 0 559 06-25-2016 06:35 AM
Last Post: oscarxd
Big Grin Ayudita con un scrip de auto farm lucasdrag 1 687 04-25-2016 04:58 AM
Last Post: either
  Ayuda L2TowerUpdate dejo de funcionar!!! gabotts 0 596 02-27-2016 21:52 PM
Last Post: gabotts
  Necesito ayuda para degradar la version 1.4.3.143 JETL 4 990 02-27-2016 21:48 PM
Last Post: gabotts



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