Thread Closed 
 
Thread Rating:
  • 20 Vote(s) - 3.1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Auto item enchant problem [Video]
Author Message
AdioZ Offline
VIP Member
***

Posts: 36
Joined: Mar 2012
Reputation: -11
Version: 1.4.1.118
Post: #1
Question Auto item enchant problem [Video]
Hey, i'm having problem with auto item enchant script. I'm currently playing in http://l2accident.eu/ It's c6 pvp custom server (java). Problem: Then I start script and it enchants once or twice and stops, I must turn it off and turn it on again to enchant from+2 to+3 and so on! wppw offered auto enchant, but problem stays...
Also made video if you don't understand my poor English Smile Exclamation
Youtube HD Video Smile



    LUA Programming
-- SCRIPT CONFIGURATION!
 
item_name = "Sword of Miracles"
--item_name = "Sword of Miracle"
enchant_name = "Scroll: Enchant Weapon (Grade A)"
--enchant_name = "Scroll: Enchant Weapon (Grade A)"
blessed_enchant_name = "Scroll: Enchant Weapon (Grade A)"
max_enchant = 15
max_safe_enchant = 3
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()



Help ME!
(This post was last modified: 06-21-2012 13:51 PM by Fox.)
06-13-2012 12:21 PM
Find all posts by this user
krazybosnian Offline
Gremlin
*

Posts: 9
Joined: Jan 2012
Reputation: 1
Version: 1.4.1.118
Post: #2
RE: Auto item enchant problem [Video]
(06-13-2012 12:21 PM)AdioZ Wrote:  Hey, i'm having problem with auto item enchant script. I'm currently playing in http://l2accident.eu/ It's c6 pvp custom server (java). Problem: Then I start script and it enchants once or twice and stops, I must turn it off and turn it on again to enchant from+2 to+3 and so on! wppw offered auto enchant, but problem stays...
Also made video if you don't understand my poor English Smile Exclamation
Youtube HD Video Smile



PHP Code:
-- SCRIPT CONFIGURATION!
 
item_name "Sword of Miracles"
--item_name "Sword of Miracle"
enchant_name "Scroll: Enchant Weapon (Grade A)"
--enchant_name "Scroll: Enchant Weapon (Grade A)"
blessed_enchant_name "Scroll: Enchant Weapon (Grade A)"
max_enchant 15
max_safe_enchant 
3
delay 
100
 
-- END OF SCRIPT CONFIGURATION
 
-- HELPER FUNCTIONS
function enchantResult()
  return 
GetEnchantManager():getLastResult()
end
 
function getItemByName(namemaxenchant)
    
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 0failure }
    
end
    stats
[base].success stats[base].success 1
end
 
function registerFailure(base)
    if 
stats[base] == nil then
        stats
[base] = { success 0failure }
    
end
    stats
[base].failure stats[base].failure 1
end
 
function printStatistics()
    for 
i,v in ipairs(stats) do
        
ShowToClient("Enchant""[" ..     .. "->" .. .. "] 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_namemax_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_name20)
    else
        
enchant getItemByName(enchant_name20)
    
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() 

Help ME!

You are sure the enchant scroll is not called

Scroll: Enchant Weapon (A-grade) ?
06-19-2012 22:28 PM
Find all posts by this user
AdioZ Offline
VIP Member
***

Posts: 36
Joined: Mar 2012
Reputation: -11
Version: 1.4.1.118
Post: #3
RE: Auto item enchant problem [Video]
(06-19-2012 22:28 PM)krazybosnian Wrote:  
(06-13-2012 12:21 PM)AdioZ Wrote:  Hey, i'm having problem with auto item enchant script. I'm currently playing in http://l2accident.eu/ It's c6 pvp custom server (java). Problem: Then I start script and it enchants once or twice and stops, I must turn it off and turn it on again to enchant from+2 to+3 and so on! wppw offered auto enchant, but problem stays...
Also made video if you don't understand my poor English Smile Exclamation
Youtube HD Video Smile



PHP Code:
-- SCRIPT CONFIGURATION!
 
item_name "Sword of Miracles"
--item_name "Sword of Miracle"
enchant_name "Scroll: Enchant Weapon (Grade A)"
--enchant_name "Scroll: Enchant Weapon (Grade A)"
blessed_enchant_name "Scroll: Enchant Weapon (Grade A)"
max_enchant 15
max_safe_enchant 
3
delay 
100
 
-- END OF SCRIPT CONFIGURATION
 
-- HELPER FUNCTIONS
function enchantResult()
  return 
GetEnchantManager():getLastResult()
end
 
function getItemByName(namemaxenchant)
    
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 0failure }
    
end
    stats
[base].success stats[base].success 1
end
 
function registerFailure(base)
    if 
stats[base] == nil then
        stats
[base] = { success 0failure }
    
end
    stats
[base].failure stats[base].failure 1
end
 
function printStatistics()
    for 
i,v in ipairs(stats) do
        
ShowToClient("Enchant""[" ..     .. "->" .. .. "] 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_namemax_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_name20)
    else
        
enchant getItemByName(enchant_name20)
    
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() 

Help ME!

You are sure the enchant scroll is not called

Scroll: Enchant Weapon (A-grade) ?

Its interlude man...Look at video im enchanting, but after 2+ it stops, then i must start the script again...
06-21-2012 13:42 PM
Find all posts by this user
ChinLao Offline
Gremlin
*

Posts: 5
Joined: Dec 2011
Reputation: 0
Version: 1.4.2.133
Post: #4
RE: Auto item enchant problem [Video]
Do you found a problem?

I got a problem on c6 when blessing with Blessed scroolls, and item burns not to +0, but to +4, then script stops..
(This post was last modified: 08-03-2012 23:21 PM by ChinLao.)
08-03-2012 23:14 PM
Find all posts by this user
feliperigo Offline
Elpy
*

Posts: 2
Joined: Apr 2012
Reputation: 0
Version: 1.4.1.112
Post: #5
RE: Auto item enchant problem [Video]
same problem any help? enchant auto to +1 +2 and stop, if restart script only enchant one time.
08-05-2012 11:06 AM
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  script auto farm help twisterfire 1 57 12-10-2017 01:00 AM
Last Post: TheQQmaster
  problem with the programm killbill 1 101 11-15-2017 02:54 AM
Last Post: kbelinh0
  Auto Augment - Services / AIO NPC. 2pho3nix 10 6,822 10-23-2017 06:40 AM
Last Post: K4mus
Sad License. problem jonathanf1 1 647 04-19-2017 23:07 PM
Last Post: Jonathan6666
  [Need Help] Enchant Script nvnhathuy 1 1,819 03-03-2017 20:07 PM
Last Post: deivuzas1
  AntiBot problem SaintRose 2 1,148 10-05-2016 22:27 PM
Last Post: Vinter
  how to resolve this problem? lozjan 1 550 05-21-2016 06:13 AM
Last Post: martlegion
  Healer Fix plugin problem aa300598 1 627 02-20-2016 13:21 PM
Last Post: Vinter
  Bot reset setting problem aa300598 2 474 02-04-2016 13:18 PM
Last Post: TheQQmaster
  I had a problem kinjiru01 20 4,218 12-10-2015 21:16 PM
Last Post: TheQQmaster



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