bazaar.mac

Since new compile of Nov 11 / 12, bazzar.mac gets a crash message. You activate the /mac bazzar trader the 2 boxes open, the trader of items and the bazzar search and then when it get to the 1st item to check price I get the MMO crash. Anything you need from me so someone can look at it what is te cause a type of log or something? Was working great before EQ made their compile patch then MMO did the new compile of their own to match it. Thank you in advance for the help.
 
Thank you for the reply. I've tried it again last night to see if it was the bazzar.mac problem or the MQ2Bzsrch function. Without activating the bazzar.mac and just using the MQ2Bzsrch and asking it to search for an item like in the exemple off the website of that function, I would get the error same way if I would use the bazzar.mac
 
Its BzSrch. Any search string causes insta crash.
 
has anyone been able to get this working post RoF? I noticed over at mq2 there is a working one but it won't work with mmobugs bzrsearch plugin
 
You'll have to wait until the Trader Name TLO is fixed. It's been reported, and is a known issue...just waiting for htw to get the chance to fix it.
 
still doing the same thing. it searches bazaar but no matter the results it sets the item price to 1pp
 
still doing the same thing. it searches bazaar but no matter the results it sets the item price to 1pp
Sorry, I don't know about the actual technical details of the mac, and/or what needs changed or updated, since I don't use or maintain it.

All I can say is the TLO data is there for pricing/etc., at least it shows when I do it on a test account just fine.

htw
 
Quick ask to see if anyone has managed to get bazaar.mac working?

Was a lovely mac and took away the pain of setting up trader:) Please post or message if you have it working - thank you Red.
 
Works for me. It does crash the macro on some items. Usually when there is a Page in the item tag. Eg. Prophecy Pg. 311.
 
Works for me. It does crash the macro on some items. Usually when there is a Page in the item tag. Eg. Prophecy Pg. 311.

Do you notice it underbidding itself on occassion? I haven't checked mine in a couple weeks since trader name was having a lot of problems, it was still a random problem and I haven't seen mention of it fixed and haven't noticed the .dll file being updated so I haven't bothered trying again.
 
my issue is if I have a item with no plat number assigned it sets it to 0
 
2 issues.

1. Items with Nameofitem, Page.102 crash the macro, It is anything that has a "," in the name.

2. If an item is not set a price, price "0" it will not search that item. Should have it search any item in trader sachel even if it is not presently assigned a price.
 
This error:

Code:
Trader - [2013/01/22 17:33:03] Unparsable in Calculation: 'S'
Trader - [2013/01/22 17:33:03] Trader.mac@200 (Main): /if (${Ini["Trader.ini","${itemname}",SellPriceMin]}) {
Trader - [2013/01/22 17:33:03] The current macro has ended.
Trader - [2013/01/22 17:33:03] Failed to parse /if condition '(SellPriceMin)', non-numeric encountered

UI issue? or something else? Also seems to fail when there is a , in the name.
 
below is the mac, I made the TLO changes but still if the item has a ' it will set the price to 1p

i'm not seeing the other error the other users sees

Code:
|************************************************************************ 
|* bazaar.mac version 1.0.5                  
|* 04/26/2006                        
|* Auto-Update Bazaar Prices                  
|*                            
|* by ebs2002                        
|*                            
|* Special thanks to:                      
|* - Sparr for the original updatebazaarprices.mac          
|* - M.D. for updating it      
|* - Updated with TraderSetup routine by TreeHuginDruid 10-26-2007            
|************************************************************************ 
|* Summary:                        
|*                            
|* This macro is used to automatically update the prices of your    
|* buyer or trader to remain competitive.            
|*                            
|* It also contains INI support to allow you to set minimum and maximum 
|* prices which your merchants will not pass            
|************************************************************************ 
|* Usage:                        
|* /mac bazaar trader                      
|* updates your /trader                      
|*                            
|* /mac bazaar buyer                      
|* updates your buyer                      
|*                            
|* INI format:                        
|* bazaar.ini:                        
|* [Metallic Drake Scales]                  
|* SellPriceMin=20500                      
|* SellPriceMax=30000                      
|* BuyPriceMin=10000                      
|* BuyPriceMax=20000                      
|************************************************************************ 
|* Notes:                        
|* Unlike Sparr's bazaar update mac, this macro doesn't check for    
|* underpriced goods yet.  This is because I had to significantly    
|* re-write Sparr's code for my purposes, and I didn't have a need for 
|* it with the goods I sell.  A future update may include this feature.    
|*                            
|* This macro also will ALWAYS beat a price unless it falls outside your 
|* SellPriceMin or BuyPriceMax.  Rather than using Standard Deviation,    
|* it will price your seller 1% lower than the lowest seller, or price    
|* your buyer at either +5, +1%, or +0.1% depending on the price of the    
|* item:                        
|*                            
|* 1-500    : +5                      
|* 501-5000 : +1%                      
|* 5000+    : +0.1%                      
|*                            
|* Additionally, if your selling price is significantly lower than the 
|* next highest seller (or your buying price is higher than the next    
|* lowest buyer), your prices will be adjusted accordingly      
|*                            
|* Finally, if you want to execute any commands at the end of the macro    
|* just edit the last Sub (EndMacro) to execute the final commands    
|* (example, /ooc Trader Up! or /1 WTS Cultural Augments!      
|*                            
|************************************************************************| 


|-------------------------------------------------------------| 
Sub Main 

   /declare looptimer int local 

   /declare slot int local 
   /declare dupecheck int local 
   /declare itemname string local 
   /declare result int local 
   /declare stddev int local 
   /declare itemsfound int local 
   /declare pricetotal int local 
   /declare avgprice int local 
   /declare minprice int local 
   /declare avgdev int local 
   /declare devhigh int local 
   /declare quartprice int local 
   /declare maxprice int local 
   /declare price int local 
   /declare fairprice int local 
   /declare targetprice int local 
   /declare newtargetprice int local 
   /declare PlatVal int local 
   /declare targetstr string local 
   /declare merchType int local 0 
   /declare merchString string local 0 
   /declare minSellPrice int local 
   /declare maxSellPrice int local 
   /declare dontReprice int local 0 
    
   |------------------------------------------ 
   |INITPRICE SETUP 
   |------------------------------------------ 
   /if (${Defined[Param1]}) { 
      /if (${Param1.Equal[initprice]}) { 
         /echo Initiating prices on new items. 
         /call TraderSetup 
      } 
   }  
   |------------------------------------------ 
    
    
:mainloop 
   /varset looptimer 60 

   /echo Starting Auto-update... 
   /if (${Defined[Param0]}) { 
      /if (${Param0.Equal[trader]}) { 
         /varset merchType 1 
         /varset merchString " 
         /echo Auto-Updating Trader Prices. 
      } else /if (${Param0.Equal[buyer]}) { 
         /varset merchType 2 
         /echo Auto-Updating Buyer Prices. 
      } 
   } 
    
    
   /if (${merchType}==0) { 
      /echo Invalid Usage: /mac bazaar trader | /mac bazaar buyer. 
      /endmac 
   } 
  

   /if (${merchType}==1) { 
      :OpenTraderAgain 
      /echo Opening Trade Window. 
      /trader 
      /delay 1s ${Window[BazaarWnd].Open} 
      /if (!${Window[BazaarWnd].Open}) /goto :OpenTraderAgain 

      :OpenBazaarAgain 
      /bazaar 
      /echo Opening Bazaar Window. 
      /delay 2s ${Window[BazaarSearchWnd].Open} 
      /if (!${Window[BazaarSearchWnd].Open}) /goto :OpenBazaarAgain 

      /notify BazaarSearchWnd BZR_UpdatePlayerButton leftmouseup 
      /echo Updating Current Traders... 
      /delay 2s 
   } else { 
      /call Barter_Main 
   } 

   /varset slot -1 
   |/varset slot 68    
    
   :nextslot 
   /delay 5 
   |/echo checking slot # (${slot}). 

   /varcalc slot ${slot}+1 
   /if (${slot}>79) /goto :donewithslots 
   /notify BazaarWnd BZR_BazaarSlot${slot} leftmouseup 
   /if (!${Window[BazaarWnd].Child[BZW_SetPrice_Button].Enabled}) /goto :nextslot 
   /if (!${Window[BazaarWnd].Child[BZW_Clear_Button].Enabled}) /goto :nextslot 
   /varset itemname ${Window[BazaarWnd].Child[BZR_BazaarSlot${slot}].Tooltip} 
   /delay 10 

    
   :SearchBazaarAgain 
   /echo Searching bazaar for item (${itemname}). 
   /bzsrch race any class any stat any slot any type any price 0 9999999 ${itemname} 
   /delay 5s ${Bazaar.Done} 
   /if (!${Bazaar.Done}) /goto :SearchBazaarAgain  
   /if (!${Bazaar.Count}) /goto :nextslot 


   /varset itemsfound 0 
   /varset pricetotal 0 
   /varset minprice 9999999999 
   /varset maxprice 0 
   /varset minSellPrice 0 
   /varset maxSellPrice 9999999999    
   /varset dontReprice 0 


   /for result 1 to ${Bazaar.Count} 
      /if (${Bazaar.Item[${result}].Name.Equal[${itemname}]}&&!${Me.Name.Equal[${Bazaar.Item[${result}].Trader}]}) {      
         /varcalc itemsfound ${itemsfound}+${Bazaar.Item[${result}].Quantity} 
         /varcalc pricetotal ${pricetotal}+${Bazaar.Item[${result}].Price}*${Bazaar.Item[${result}].Quantity} 
         /if (${Bazaar.Item[${result}].Price}<${minprice}) /varset minprice ${Bazaar.Item[${result}].Price} 
         /if (${Bazaar.Item[${result}].Price}>${maxprice}) /varset maxprice ${Bazaar.Item[${result}].Price} 
      } 
   /next result 


   /if (!${itemsfound}) { 
      /if (${MMOIni["bazaar.ini","${itemname}", SellPriceMax]}) { 
         /varset targetstr ${MMOIni["bazaar.ini","${itemname}", SellPriceMax]} 
         /goto :setPrice 
      } else { 
         /goto :nextslot 
      } 
   } 
   /varcalc  minprice ${minprice}/1000 
   /if (${minprice}==1) /varset minprice 2 
   /if (${MMOIni["bazaar.ini","${itemname}",SellPriceMin]}) { 
      /varset minSellPrice ${MMOIni[bazaar.ini,"${itemname}",SellPriceMin]} 
   } 
   /if (${MMOIni[bazaar.ini,"${itemname}",SellPriceMax]}) { 
      /varset maxSellPrice ${MMOIni[bazaar.ini,"${itemname}",SellPriceMax]} 
   } 
   /if (${minprice}*0.99<${minSellPrice}) { 
      /varset targetstr ${minSellPrice} 
      /beep 
      /echo ${itemname} is being sold for ${minprice}, but your minimum is ${minSellPrice}. 
      /goto :setPrice 
   } 
   /if (${minprice}*0.99>${maxSellPrice}) { 
      /varset targetstr ${maxSellPrice} 
      /goto :setPrice 
   } 
   /if (${minprice}<500000 && ${minprice}>0) { 
      /if (${minprice}<100) { 
         /varset targetstr ${Math.Calc[${minprice}-1]} 
|      } else /if (${minprice}>5000) { 
|         /varcalc targetstr ${Int[${Math.Calc[ ${minprice}*0.999/25 ]}]}*25 
      } else { 
         /varcalc targetstr ${Int[${Math.Calc[ ${minprice}*0.99/25 ]}]}*25 
      } 

      /varset targetprice ${targetstr} 
      /varset targetstr ${Int[${targetstr}]} 
      
   :setPrice 
      /if (!${targetstr.Equal[${Window[BazaarWnd].Child[BZW_Money0].Text}]}) { 
         /echo --- Repricing ${itemname} from (${Window[BazaarWnd].Child[BZW_Money0].Text}) to (${targetstr}). 
         :openqtywndagain 
         /notify BazaarWnd BZW_Money0 leftmouseup 
         /delay 2s 
         /if (!${Window[QuantityWnd].Open}) /goto :openqtywndagain 
         /delay 1 
         /keypress backspace chat 
         /keypress backspace chat 
         /keypress backspace chat 
         /keypress backspace chat 
         /keypress backspace chat 
         /keypress backspace chat 
         /keypress backspace chat 
         /keypress backspace chat 
         /delay 1 
         /for PlatVal 1 to 7 
         /squelch /keypress ${targetstr.Mid[${PlatVal},1]} chat 
         /next PlatVal 
         /notify QuantityWnd QTYW_Accept_Button leftmouseup 
         /delay 1 
         /notify BazaarWnd BZW_SetPrice_Button leftmouseup 
         /delay 1 
      } 
   } 
   /goto :nextslot 
   :donewithslots 
    
   /call TraderStatus 
    
   |-------------------------------------| 
   :cycleloop 
    
   /Echo *** Waiting (${looptimer})minute(s) before next price check/update. *** 
   /call CloseBazSrchWnd 
    
   /if (${looptimer}==0) /goto :mainloop 
   /varset looptimer ${Math.Calc[${looptimer}-1]} 
    
   /delay 1m 
   /goto :cycleloop 
   |-------------------------------------| 
      
   /call EndMacro 

/return 
|-------------------------------------------------------------| 


|-------------------------------------------------------------| 
Sub Barter_Main 

   /declare merchType int local 0 
   /declare merchString string local 0 
   /declare minBuyPrice int local 
   /declare maxBuyPrice int local 
   /declare dontReprice int local 0 

   /declare BuyItemSlot int local 0 
   /declare ItemName string local 0 

      :OpenBuyerAgain 
      /echo Opening Buy Window. 
      /buy 
      /delay 1s ${Window[BarterWnd].Open} 
      /if (!${Window[BarterWnd].Open}) /goto :OpenBuyerAgain 

      :OpenBarterAgain 
      /barter 
      /echo Opening Barter Window. 
      /delay 2s ${Window[BarterSearchWnd].Open} 
      /if (!${Window[BarterSearchWnd].Open}) /goto :OpenBarterAgain 

   :startLoop 
   /for BuyItemSlot 1 to 80 
      /if (${Window[BarterWnd].Child[BTR_BuyLineList].List[${BuyItemSlot}].Length}>0) { 
         /varset ItemName ${Window[BarterWnd].Child[BTR_BuyLineList].List[${BuyItemSlot},3]}    
         /varset minBuyPrice ${MMOIni["bazaar.ini",${ItemName}, BuyPriceMin]} 
         /varset maxBuyPrice ${MMOIni["bazaar.ini",${ItemName}, BuyPriceMax]} 
         /call UpdateBuyer "${ItemName}" ${minBuyPrice} ${maxBuyPrice} 
      } 

   /next BuyItemSlot 
   /call EndMacro 
/return 
|-------------------------------------------------------------| 


|-------------------------------------------------------------| 
Sub UpdateBuyer(String name, int min, int max) 

   /declare loopVar int local 0 
   /declare loopVarMax int local 0 
   /declare maxFoundPrice int local ${min} 
   /declare searchResult string local 
   /declare found int local 0 
   /declare seller string local 
   /declare inSlot int local 0 

   /notify BarterSearchWnd BTRSRCH_ItemSearchEdit leftmouseup 
   /delay 1s 
   /shiftkey /keypress end chat 
   /delay 1s 
   /varset loopVarMax ${Window[BarterSearchWnd].Child[BTRSRCH_ItemSearchEdit].Text.Length} 
   /for loopVar 1 to ${loopVarMax} 
      /keypress backspace chat 
   /next loopVar 
   /for loopVar 1 to ${name.Length} 
      /if (${name.Mid[${loopVar},1].Equal[" "]}) { 
         /keypress space chat 
      } else { 
         /keypress ${name.Mid[${loopVar},1]} chat 
      } 
   /next loopVar 
   /keypress enter chat 
   /delay 3s 
   | Find Max Buy Price 
   /for loopVar 1 to 200 
      /varset searchResult ${Window[BarterSearchWnd].Child[BTRSRCH_BuyLineList].List[${loopVar},2]} 
      /varset searchResult ${searchResult.Mid[1, ${Math.Calc[${searchResult.Find["("]}-1]}]} 
      /if (${searchResult.Length}==0) /goto :EndLoop 
      /varset seller ${Window[BarterSearchWnd].Child[BTRSRCH_BuyLineList].List[${loopVar},4]} 

      /if (${searchResult.Equal[${name}]} && !${seller.Equal[${Me.Name}]}) { 
      | Item match, get max plat value 
         /varset found ${Window[BarterSearchWnd].Child[BTRSRCH_BuyLineList].List[${loopVar},3]} 
         /if (${found}>${maxFoundPrice}) /varset maxFoundPrice ${found} 
      } 

   /next loopVar 
:EndLoop 
   /if (${maxFoundPrice}!=${min}) { 
      /if (${maxFoundPrice}<100) { 
         /varcalc maxFoundPrice ${maxFoundPrice}+1 
      } else /if (${maxFoundPrice}<5000) { 
         /varcalc maxFoundPrice ${maxFoundPrice}+5 
      } else { 
         /varcalc maxFoundPrice ${maxFoundPrice}*1.001 
         /varcalc maxFoundPrice ${Int[${Math.Calc[${maxFoundPrice}/5]}]}*5 
      } 
   } 
   /if (${maxFoundPrice}>${max}) { 
      /beep 
      /echo Want to set ${name} to ${maxFoundPrice}, but your maximum is ${max}. 
      /varset maxFoundPrice ${max} 
   } 
   /varset inSlot ${Window[BarterWnd].Child[BTR_BuyLineList].List[=${name},3]} 
   /if (${maxFoundPrice} != ${Int[${Window[BarterWnd].Child[BTR_BuyLineList].List[${inSlot},5]}]} ) { 
      /call SetPrice ${maxFoundPrice} "${name}" 
   } 
/return 
|-------------------------------------------------------------| 


|-------------------------------------------------------------| 
Sub SetPrice(string price, string name) 

   /echo Setting price of ${name} to ${price}. 
   /declare listID int ${Window[BarterWnd].Child[BTR_BuyLineList].List[=${name},3]} 
   /declare PlatVal int 0 
   /notify BarterWnd BTR_BuyLineList listselect ${listID} 
   /delay 5 
   /notify BarterWnd BTR_BuyLineList leftmouse ${listID} 
   /delay 5 
   /notify BarterWnd BTR_CompensationPlat leftmouseup 
   /delay 1 
    
:delete 
   /keypress backspace chat 
   /if (${Window[QuantityWnd].Child[QTYW_SliderInput].Text.Length}) /goto :delete 
   /delay 1 
   /for PlatVal 1 to 7 
      /squelch /keypress ${price.Mid[${PlatVal},1]} chat 
   /next PlatVal 
   /notify QuantityWnd QTYW_Accept_Button leftmouseup 
   /delay 1 
   /notify BarterWnd BTR_BuyLineModifyButton leftmouseup 
/return 
|-------------------------------------------------------------| 


|-------------------------------------------------------------| 
Sub TraderStatus 

/if (!${Me.Trader}) { 
   /delay 1s 
   :OpenBazaarWnd 
   /if (!${Window[BazaarWnd].Open}) /trader 
   /delay 1s (${Window[BazaarWnd].Open}) 
   /if (!${Window[BazaarWnd].Open}) /goto :OpenBazaarWnd 
   /delay 1s 
   /notify BazaarWnd BZW_Start_Button LeftMouseUp 
   /delay 1s 
   /echo Tradermode ON. 
} 

/delay 1s 
/return 
|-------------------------------------------------------------| 


|-------------------------------------------------------------| 
Sub TraderSetup 

   /declare slot int local 
   /declare itemname string local 
   /declare PlatVal int local 
   /declare targetstr string local 1000 
   /declare curprice string local    

   /echo Setting unpriced items to default price of (${targetstr}) pp. 

   :OpenTraderAgain 
   /echo Opening Trade Window. 
   /trader 
   /delay 1s ${Window[BazaarWnd].Open} 
   /if (!${Window[BazaarWnd].Open}) /goto :OpenTraderAgain 

   /varset slot -1 
    
   :nextslot 
   /varcalc slot ${slot}+1 
   /if (${slot}>79) /goto :donewithslots 
   /notify BazaarWnd BZR_BazaarSlot${slot} leftmouseup 
  
   /varset curprice ${Window[BazaarWnd].Child[BZW_Money0].Text} 
  
   |/echo --- ${curprice} ---    

   /if (!${Window[BazaarWnd].Child[BZW_SetPrice_Button].Enabled}) /goto :nextslot 

   |/if (!${Window[BazaarWnd].Child[BZW_Clear_Button].Enabled}) /goto :nextslot 

   /varset itemname ${Window[BazaarWnd].Child[BZR_BazaarSlot${slot}].Tooltip} 
   |/echo itemname = ${itemname} 
   /delay 1s 

   /if (${curprice}==0) { 
   /echo Price not set for item (${itemname}). 
  
    :setPrice 
          /echo --- Repricing ${itemname} from ${Window[BazaarWnd].Child[BZW_Money0].Text} to ${targetstr}. 
          :openqtywndagain 
          /notify BazaarWnd BZW_Money0 leftmouseup 
          /delay 2s 
          /if (!${Window[QuantityWnd].Open}) /goto :openqtywndagain 
          /delay 1 
          /keypress backspace chat 
          /keypress backspace chat 
          /keypress backspace chat 
          /keypress backspace chat 
          /keypress backspace chat 
          /keypress backspace chat 
          /keypress backspace chat 
          /keypress backspace chat 
          /delay 1 
          /for PlatVal 1 to 7 
          /squelch /keypress ${targetstr.Mid[${PlatVal},1]} chat 
          /next PlatVal 
          /notify QuantityWnd QTYW_Accept_Button leftmouseup 
          /delay 1 
          /notify BazaarWnd BZW_SetPrice_Button leftmouseup 
          /delay 1 
  
   } else { 
   /echo Price set to: (${curprice} pp), skipping price init. 
   } 
    

   /goto :nextslot 
   :donewithslots 


  /call CloseBazSrchWnd    

/return 
|-------------------------------------------------------------|    


|-------------------------------------------------------------| 
Sub CloseBazSrchWnd 

:CloseBazaarSearchWnd 
/if (${Window[BazaarSearchWnd].Open}) /keypress TOGGLE_BAZAARSEARCHWIN 
/delay 2s (!${Window[BazaarSearchWnd].Open}) 
/if (${Window[BazaarSearchWnd].Open}) /goto :CloseBazaarSearchWnd 

/return 
|-------------------------------------------------------------| 


|-------------------------------------------------------------| 
Sub EndMacro 

/call CloseBazSrchWnd 
/endmac 

/return 
|-------------------------------------------------------------|
 
I forgot to mention one part (my bad). When I made the MMOIni TLO, it copies the bahavior of the Ini TLO, but with the addition of understanding how to handle quotes (") - which Ini does not do.

What you would want to do, is put it inside quotes, like:

${MMOIni["My Item",
or
${MMOIni["${MyItem}",

That should fix the ' issue - if not, let me know, and I'll do some workarounds.

htw