All pastes #413814 Raw Edit

Something

public text v1 · immutable
#413814 ·published 2007-03-28 18:25 UTC
rendered paste body
#define MERCHANT_NAME Nerrist
#define ITEM_NAME "Strong Flux"
#define ITEM_NAME2 "Weak Flux"

function main()
{
call buy
;wait 10 = 1sec
wait 3000
call second
}

function second()
{
call main
}
function buy()
{
      declare i int local  1   
      declare idx int local  0
      if ${Unit[MERCHANT_NAME].IsMerchant}
      {
         Unit[MERCHANT_NAME]:Use

         while  ${i} <= ${WoWScript[GetMerchantNumItems()]}
         {
            if ${WoWScript[GetMerchantItemInfo(${i})].Equal[ITEM_NAME]}
              idx:Set[${i}]
            i:Inc
         }
         if ${idx}>0
            WoWScript BuyMerchantItem(${idx})
         else
            echo MERCHANT_NAME does not sell ITEM_NAME
;added by me for item2
	while  ${i} <= ${WoWScript[GetMerchantNumItems()]}
         {
            if ${WoWScript[GetMerchantItemInfo(${i})].Equal[ITEM_NAME2]}
              idx:Set[${i}]
            i:Inc
         }
         if ${idx}>0
            WoWScript BuyMerchantItem(${idx})
	else
	echo MERCHANT_NAME does not sell ITEM_NAME2
      }
      else
         echo MERCHANT_NAME does not seem to be a merchant
}