ho preso dal sito di easyuo la sub (buy) che posto sotto, però a volte capita che dopo avermi aperto il popup del vendor mi apre anche il suo paperdoll e questo blocca la macro 
Come posso risolvere?
'acie mille in anticipo a chi ci prova

Come posso risolvere?
'acie mille in anticipo a chi ci prova

codice:
gosub buy SYHO PUD 3 1
halt
;finditem #ltargetid
;halt
;**
;* @name useVendor
;* @author Quintok
;* @version 2.0 2 November 05
;* @purpose opens context menu and clicks the correct option
;* @param %1 vendorID req Vendor ID
;* %2 vendorOption req option to pick on the context menu
sub useVendor
set !useVendorCnt 0
set !_vendorID %1
set !_contextOption %2
finditem !_vendorID G_9
if #findkind = -1
return #false
exevent popup !_vendorID !_contextOption
return #true
;**
;* @name Buy
;* @author Quintok
;* @version 2.0 2 November 2005
;* @purpose Buys from %1 for items %2 to an amount of %4 to a max price of %3
;* @param %1 VendorID req Vendor ID
;* %2 ItemType req what item to buy
;* %3 MaxPrice req maximum price
;* %4 amount req max amount
;* %(n-2) itemXType opt item x to buy
;* %(n-1) maxXPrice opt maximum price of item x
;* %n Xamount opt of price for item x
sub Buy
set !_vendorId %1
set !_buyCnt ( %0 - 1 ) / 3
set !_bought 0
for !i 1 !_buyCnt
{
set !f !i * 3 - 1
set !_itemType . !i % . !f
set !f !f + 1
set !_maxPrice . !i % . !f
set !f !f + 1
set !_amount . !i % . !f
}
gosub useVendor !_vendorId 2
if ! #result
return #false
gosub waitForSysVar contname = bill_gump
while #true
{
getshopinfo
for !i 1 !_buyCnt
{
if #shopItemType = !_itemType . !i && ! !_bought . !i
{
if #shopItemPrice <= !_maxprice . !i
{
set !x #contposx - 30
set !y #contposy - 130
for !_ 1 3
click !x !y d dmc
wait 5
if !_amount . !i = N/A || !_amount . !i > #shopItemMax
set !_amount . !i #shopitemMax
setshopitem #shopitemID !_amount . !i
set !_bought !_bought + 1
}
}
if #shopCnt = #shopCurPos || !_bought = !_buyCnt
{
set !x #contposx + 40
set !y #contposy + 211
click !x !y f
return !_bought = !_buyCnt
}
}
set !x #contposx + 75
set !y #contposy - 19
click !x !y f ;395 200 f
wait 3
}
;**
;* @name Sell
;* @author Quintok
;* @version 1.0 13 march 04
;* @purpose Sells using UOA agent [which is already setup]
;* @param %1 VendorType req Vendor Type
sub sell
gosub useVendor %1 3
return #result
;**
;* @name waitForSysVar
;* @author Quintok
;* @version 1.0 13 march 04
;* @purpose waits %4 seconds for # . %1 to %2 to %3
;* @param %1 sysvar req system variable without '#'
;* %2 operation req operation ie = <> in notin
;* %3 comparison req to compare with ie abcdef
;* %4 timeout opt timeout in seconds
sub waitForSysVar
if %0 <= 4
{
gosub waitFor %1 %2 %3 %4
return #result
}
set !cnt %0 / 3
if ( %0 % 3 = 1 )
set !timeOut #scnt + % . %0
else
set !timeOut #scnt + 5
for !i 1 !cnt
{
set !offset 3 * !i - 2
set !evaluation !offset + 1
set !value !offset + 2
if ! ( # . % . !offset % . !evaluation % . !value )
set !i 0
if #scnt > !timeout
return #false
}
return #true
;**
;* @name waitFor
;* @author Quintok
;* @version 1.0 13 march 04
;* @purpose waits %4 seconds for # . %1 to %2 to %3
;* @param %1 sysvar req system variable without '#'
;* %2 operation req operation ie = <> in notin
;* %3 comparison req to compare with ie abcdef
;* %4 timeout opt timeout in seconds
sub waitFor
if %0 < 4 || %4 = N/A
set !timeOut #scnt + 5
else
set !timeOut #scnt + %4
_waitForLoop:
if #scnt > !timeOut
return #false
if ! ( # . %1 %2 %3 )
goto _waitForLoop
return #true



Commenta