Advanced Bone Chips mac

jodwop

Lifetimer
Joined
Oct 26, 2006
Messages
463
Reaction score
2
Points
0
I may be tired reading through macs, but I am not seeing a simple way to do this. The macros I look at usually have Army's buy.inc, fine if it will work. Trying to come up with a way to buy meat from the target, buy a certain amount, make bone chips from those, then repeat till desired bone chips are in inventory.

I am using this macro for making them, works flawlessly:
Code:
Sub Main
:loop
/if (${FindItem[Scorpion Meat].InvSlot}) {
  /nomodkey /shift /itemnotify ${FindItem[Scorpion Meat].InvSlot} leftmouseup
 :FTB
   /if (!${Me.AltAbilityReady[Flesh To Bone]}) /goto :FTB
   /delay 1s
   /alt act 71
 :bonecheck
   /if (${Cursor.ID}!=13073) /goto :bonecheck
   /delay 1s
   /autoinv
   /delay 2s
   /goto :loop
}
/echo All Done
/end

I thought maybe using code from Vendor Search and adding a variable for total bone chips to stop at. Any help?
 
Last edited:
Do not make posts when you are exhausted :(.... Edited to show the correct code... I use atm.
 
I can post the old code I used and the buy.inc that it used if you want.
 
That would be most appreciated JJ.
 
This was the mac I used for it. I haven't used it since SoF patch, so something might have to be changed:

Code:
|ftb2.mac
 
#include common/sell.inc
#include common/buy.inc
#include common/packs.inc
#include common/cleanpacks.inc
#include common/CommonSubs.inc
#include spell_routines.inc
 
Sub Main
 
 
 
:Buymore
 
 
    /target Daliea
    /nomodkey /click right target 
    /delay 5s ${Window[MerchantWnd].Open} 
    /call OpenPacks 
    /call Buy "Scorpion Meat" 1160 
    /nomodkey /notify MerchantWnd MW_Done_Button LeftMouseUp 
    |/call ClosePacks
    /echo Starting AA portion
    /goto :Loop
 
 
:Loop
/call pc
/if (!${FindItem[=Scorpion Meat].InvSlot}) {
  /echo backpacks empty go get more stuff
  /goto :Buymore
}
  /nomodkey /itemnotify ${FindItem[=Scorpion Meat].InvSlot} leftmouseup
  /delay 1s
  /notify QuantityWnd QTYW_Accept_Button leftmouseup
  /delay 1s
  :AALoop
/if (${Me.AltAbilityReady[Flesh to Bone]} && ${Cursor.ID}) {
     /call Cast "Flesh to Bone" alt
     /delay 11
     :loop1
     /if (${Me.Casting.ID}) /goto :loop1
     /delay 1s !${Cursor.ID}
     /delay 2
     /call AutoInventory
     /goto :Loop
	}
/if (!${Cursor.ID}) /goto :Loop
/goto :AALoop
/return

Sub pc
:pc
/if (${SpawnCount[pc radius 300]}==1) /return
/echo Another player too close waiting 10 secs
/delay 10s
/goto :pc
/return
 
Sub AutoInventory
    /if ( !${Cursor.ID} ) /return
    /declare AutoInvTimeout timer local 3s
    :AutoInvItem
    /notify InventoryWindow IW_CharacterView leftmouseup
    /delay 1s !${Cursor.ID}
    /if ( ${Cursor.ID} && ${AutoInvTimeout} ) /goto :AutoInvItem
/return
 
Changed vendor and amount to buy, ran it. targets vendor, opens vendor, opens bags then crashes. Did it 2 times. Other than getting it to not crash, adding in a desired Bone chip count and it would be perfect.
 
It worked flawless before SoF and I don't have a necro anymore to work with it and tweak it. My guess based on your experience is a problem with the buy.inc. Take a look at that and maybe something changed.

I assume you have the includes in there right?
 
Mine was just about identical to This one. The exception was a delay. I tried changing that and same result.
Code:
| 
| buy.inc 
| Buy Include File needed for macros 
| Version 1.7b 
| 
| Date: August 20, 2005 
| UPDATED BY OUNVME 
| 
| 14 MAR 2006: Armysoldier refined code to improve speed 
| 
| Please be sure to get the lastest updates at http://www.soc-music.com/mq2 
| 
| These file MUST be in the common directory in your macros directory. 
| 
| Usage: /call Buy (ItemToBuy) (Amount Needed) 
| 
| Use the Buy function for buying if you need a set total amount, like if you have 
| 20 of the item on you already and you need a total of 30, it will only buy 10 
| of the item. 
| 
| Usage: /call PCBuy (ItemToBuy) (Amount to buy off merchant) 
| 
| Use the PCBuy function if you don't need a set total amount, you just need 
| a set amount off that merchant. 
| 
| Disclaimer: 
| Code was used from other programers also from the MQ Forums. 
| 


#event Broke "#*#you cannot afford#*#" 
#event Broke "#*#you can't afford#*#" 

Sub Buy(ItemToBuy, int amount) 
/echo Buying ${ItemToBuy}! 
/declare QTY int Inner 
/declare l2 local int 

|---SMALL delay to allow the MERCHANT Window to populate

/delay ${Math.Calc[${DelayMult}*2]}s

/varset QTY ${Math.Calc[${amount}-${FindItemCount[${ItemToBuy}]}]} 
/delay 5s 

/if (${FindItemCount[${ItemToBuy}]}>= ${amount}) { 
     /echo Done! 
     /return 
   }    

/varset l2 ${Window[MerchantWnd].Child[ItemList].List[=${ItemToBuy},2]} 
/if (!${l2}) { 
        /echo couldn't find ${ItemToBuy} 
        /endm 
    } else { 
        /notify MerchantWnd ItemList listselect ${l2} 
        /notify MerchantWnd ItemList leftmouse ${l2} 
/delay 2          

    }  

/echo Buying ${ItemToBuy} Till I get ${amount}  
:Loop 

   /if (${QTY}>19) { 
       /buyitem 20 
       /delay 1s 
       /doevents 
       /varset QTY ${Math.Calc[${amount}-${FindItemCount[${ItemToBuy}]}]} 
       /goto :Loop 
       } ELSE { 
   /if (${QTY}>0 && ${QTY}<20) { 
       /buyitem ${QTY} 
       /delay 1s 
       /varset QTY ${Math.Calc[${amount}-${FindItemCount[${ItemToBuy}]}]} 
       } 
} 
/if (${QTY}==0) { 
       /echo Done! 
       /return 
       } 
/goto :Loop 

/return 



Sub Event_Broke 
   /echo Error: You are out of money! 
   /beep 
   /endmacro 
/return
 
Bump

Anyone have any idea? or different mac?
 
Changed vendor and amount to buy, ran it. targets vendor, opens vendor, opens bags then crashes. Did it 2 times. Other than getting it to not crash, adding in a desired Bone chip count and it would be perfect.

Are you using the default UI ? or a custom UI ?

I had the same issue when initiating a call to the Buy function in the common subs released by Army_01. I came to realize two things .... there was a change to the pack numbers initiated in the TSS expansion which required a small alteration to one of those include files ( cant remember which one, at work atm ) .. This change was needed to accomodate the changes pack numbers ... The other issue .. is that when using certain custom UI's .. calls to the merchant window in Buy inc would casuse a crash...

Do a simple test... if you arent using default UI .. switch to it real fast and try again.. see what the results are if you still crash.

If this problem persists .. I'll make myself a note to go home and post the exact changes i needed to make to 2 of the INC files to update them and get them to function properly.

I know that mine work without question.. because I use them all the time and have never crashed since i made the fixes.

Post your results.. and I'll hook ya up with the updated INC files if needed.
 
Tried default, got the same result..