Thread Closed 
 
Thread Rating:
  • 4 Vote(s) - 2.75 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem z/with autoenchant
Author Message
mistrz20 Offline
Gremlin
*

Posts: 5
Joined: Nov 2011
Reputation: 0
Version: 1.4.1.93
Post: #1
Problem z/with autoenchant
Mam prosbe do was, mogl by ktos przeszukac gdzie mam blad w scripcie? Z gory thx / Can someone check where i have mistake in my script. Thx
-- SCRIPT CONFIGURATION!

item_name = "Draconic Bow"
enchant_name = "Scroll: Enchant Weapon (S-Grade)"
blessed_enchant_name = "Blessed Scroll: Enchant Weapon (S-Grade)"
max_enchant = 10
max_safe_enchant = 4
delay = 1300

-- END OF SCRIPT CONFIGURATION

-- HELPER FUNCTIONS
function enchantResult()
return GetEnchantManager():getLastResult()
end

function getItemByName("Draconic Bow", 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("Draconic Bow", 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 Scroll: Enchant Weapon (S-Grade)", 10)
else
enchant = getItemByName("Blessed Scroll: Enchant Weapon (S-Grade)", 10)
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

albo ktos moze by napisal nowy na draconic bowa i blessed enchanty s grade weapon oraz max +10 and safe +4 Smile0 Dont delete my post plx
(This post was last modified: 05-19-2012 18:55 PM by mistrz20.)
05-19-2012 18:51 PM
Find all posts by this user
Salvatore Offline
Gremlin
*

Posts: 7
Joined: May 2012
Reputation: 0
Version: 1.4.2.132
Post: #2
RE: Problem z/with autoenchant
1.- Please use [CODE] bbcode to include scripts/plugins into a post.

What's the problem you'r having? Screenshot or something please.
05-20-2012 07:43 AM
Find all posts by this user
mistrz20 Offline
Gremlin
*

Posts: 5
Joined: Nov 2011
Reputation: 0
Version: 1.4.1.93
Post: #3
RE: Problem z/with autoenchant
There is a problem: http://pokazywarka.pl/bv7ey3/

My script looks like:
-- SCRIPT CONFIGURATION!

item_name = "Draconic Bow"
enchant_name = "Scroll: Enchant Weapon (S-Grade)"
blessed_enchant_name = "Blessed Scroll: Enchant Weapon (S-Grade)"
max_enchant = 10
max_safe_enchant = 4
delay = 1300

-- END OF SCRIPT CONFIGURATION

-- HELPER FUNCTIONS
function enchantResult()
return GetEnchantManager():getLastResult()
end

function getItemByName("Draconic Bow", 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("Draconic Bow", 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 Scroll: Enchant Weapon (S-Grade)", 10)
else
enchant = getItemByName("Blessed Scroll: Enchant Weapon (S-Grade)", 10)
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


Hmm, can u help ? Smile plx
05-20-2012 10:13 AM
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
Sad License. problem jonathanf1 1 550 04-19-2017 23:07 PM
Last Post: Jonathan6666
  AntiBot problem SaintRose 2 1,002 10-05-2016 22:27 PM
Last Post: Vinter
  how to resolve this problem? lozjan 1 462 05-21-2016 06:13 AM
Last Post: martlegion
  Healer Fix plugin problem aa300598 1 476 02-20-2016 13:21 PM
Last Post: Vinter
  Bot reset setting problem aa300598 2 390 02-04-2016 13:18 PM
Last Post: TheQQmaster
  I had a problem kinjiru01 20 3,880 12-10-2015 21:16 PM
Last Post: TheQQmaster
  Windows 10 problem Raaf1383 4 906 10-11-2015 07:57 AM
Last Post: rip2808
  update problem Dwnos01 0 588 07-12-2015 18:12 PM
Last Post: Dwnos01
  sound problem plz help volakas 1 380 07-12-2015 06:20 AM
Last Post: volakas
  Bot log out problem Grewell 4 493 07-11-2015 10:46 AM
Last Post: Grewell



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