31
Scripting Chat / Dealing with NCP vendors...
« on: January 15, 2009, 04:36:51 PM »
I'm working on my shopper vendor and I'm having problems scrolling through the shop list to find the items I want to buy. Randomly usually every other click on the down arrow than highlighting an item and using the getshopinfo or whatever command sometimes adds the item to my buy list. Then I have to make it click the minus to get rid of it.
Anyone have any stable sample code I can compare mine to? this is what I got atm.
Anyone have any stable sample code I can compare mine to? this is what I got atm.
Code: [Select]
set #RESULT
repeat
{
gosub TM_HandleContextMenu %currentnpc %CONTEXT_Buy #TRUE
gosub contwait bill_gump 283_248 30
}
until #RESULT = CONTINUE
getshopinfo
set %vendorstatus EMPTY
for %a 1 #SHOPCNT
{
gosub clickmod -42 -137
click %x %y f ;click top item in list
wait 2
getshopinfo
if #shopitemtype = DPF
{
click %x %y d
wait 10
set %amount 1600 - %beetleweight
if #shopitemmax > %amount
{
setShopItem #shopItemID %amount
set %vendorstatus STOCKED
}
else
{
setShopItem #shopItemID #shopItemMax
set %vendorstatus EMPTY
}
wait 10
gosub clickmod 47 208
click %x %y f ;click the accept button
wait 2s
break
}
gosub clickmod 73 -17
click %x %y f ;click down arrow
wait 2
gosub clickmod 228 86
click %x %y f ;click minus arrow
wait 2
}
return %vendorstatus