|---------------------------------------------------------------------------------------------------| |- AutoVendor created by Ionis ver. 3.2 |- If you have any questions or concerns please contact me on discord @ Zerxes#0809 |- For initialization use: /mac autovendor buildini |- Total items is no longer required! :) |- After initialization and ini setup, restart the macro with: /mac autovendor |---------------------------------------------------------------------------------------------------| #warning #turbo 80 Sub Main /echo Starting up \atAutoVendor \ax\agver. 3.2 \axby \arIonis |-MAIN DECLARES DO NOT TOUCH THESE-| /declare firstLetter string outer /declare itemName string outer /declare vendorName string outer /declare specifiedVen string outer /declare totalSlots string outer 0 /declare vendorType string outer /declare char string outer /declare parcelMules string outer /declare targetMule string outer /declare itemCost float outer /declare counter int outer /declare vendorsVisited int outer 0 /declare whichMule int outer /declare iniChanged int outer 0 /declare itemValue int outer /declare itemQuantity int outer /declare saleTotal int outer /declare totalMoney int outer /declare totalCost int outer /declare totalBought int outer /declare totalItems int outer /declare totalSold int outer /declare totalParcel int outer /declare totalDest int outer /declare timesDest int outer 0 /declare timesBought int outer 0 /declare parcels int outer /declare fieldCleared int outer /declare looper int outer -1 /declare looperTwo int outer -1 /declare looperThree int outer -1 /declare looperFour int outer -1 |-END MAIN DECLARES-| /if (${Defined[Param1]}) { /echo \arTotal # of items is no longer required! :) /delay 10 } /call GetTotalSlots |-Call BuildINI /if (${Defined[Param0]}) { /if (${Param0.Equal[buildini]}) { /echo Building our INI... /call BuildINI /echo Finished creating INI, please edit the INI file accordingly then restart your macro without any parameters. /echo ex. /mac AutoVendor /endmac } else { /echo You have declared your parameters incorrectly. /echo Try again but do it like this: /mac autovendor buildini /endmac } } |-End Call BuildINI /call CheckINI |-Start Main Functionality /varset totalSlots ${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",TotalItems]} /varset parcels ${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",ParcelOn]} /if (!${Window[FindItemWnd].Open}) { /windowstate FindItemWnd open } /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",DestroyItems]} == 1) { /echo Destroying is about to begin... /delay 20 /for looper 0 to ${totalSlots} /if (${Window[FindItemWnd].Child[FIW_ItemList].List[${looper},4].Compare[General]} == 32) { /for looperTwo 0 to ${totalSlots} /nomodkey /notify FindItemWnd FIW_ItemList listselect ${looper} /varset itemName ${Window[FindItemWnd].Child[FIW_ItemList].List[${looper},2]} /varset itemQuantity ${Window[FindItemWnd].Child[FIW_ItemList].List[${looper},3]} /varset firstLetter ${itemName.Left[1]} /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[Destroy]}) { /delay 10 /nomodkey /notify FindItemWnd FIW_GrabButton leftmouseup /delay 10 /nomodkey /notify FindItemWnd FIW_DestroyItem leftmouseup /delay 10 /if (${Window[ConfirmationDialogBox].Open} && ${Window[ConfirmationDialogBox].Child[CD_TextOutput].Text.Equal[Are you absolutely sure you want to destroy your ${itemName}?]}) { /nomodkey /notify ConfirmationDialogBox Yes_Button leftmouseup } else { /echo \arConfirmationDialogBox is returning a bad value! /echo Someone may be trying to do one of the following: /echo Taskadd you, invite you to raid, kick you from game, etc. /echo Figure it out and restart the macro! :) /endmac } /delay 10 /echo We destroyed\ar ${itemQuantity}\ax \at${itemName}(s)\ax! /varcalc totalDest ${itemQuantity}+${totalDest} /varcalc timesDest ${timesDest}+1 /nomodkey /notify FindItemWnd FIW_ItemList listselect ${looper} } else { /break } /next looperTwo } /next looper /varcalc totalSlots ${totalSlots}-${timesDest} } /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",SellStuff]} == 1) { /echo Selling is about to begin... /call FindVendor /delay 20 /varset looper -1 /varset looperTwo -1 /for looper 0 to ${totalSlots} /if (${Window[FindItemWnd].Child[FIW_ItemList].List[${looper},4].Compare[General]} == 32) { /for looperTwo 0 to ${totalSlots} /nomodkey /notify FindItemWnd FIW_ItemList listselect ${looper} /varset itemName ${Window[FindItemWnd].Child[FIW_ItemList].List[${looper},2]} /varset itemQuantity ${Window[FindItemWnd].Child[FIW_ItemList].List[${looper},3]} /varset itemValue ${Int[${Math.Calc[${FindItem[=${itemName}].Value}/1000]}]} /varset firstLetter ${itemName.Left[1]} /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[Sell]}) { /delay 10 /nomodkey /notify MerchantWnd MW_Sell_Button leftmouseup /delay 20 /if (${Window[QuantityWnd].Open}) { /nomodkey /notify QuantityWnd QTYW_Accept_Button leftmouseup /delay 20 } /varcalc saleTotal ${itemQuantity}*${itemValue} /echo We sold \at ${itemQuantity} ${itemName} \ax for a total of \ag ${saleTotal}pp\ax! /varcalc totalMoney ${saleTotal}+${totalMoney} /varcalc totalSold ${itemQuantity}+${totalSold} /nomodkey /notify FindItemWnd FIW_ItemList listselect ${looper} } else { /break } /next looperTwo } /next looper } /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",BuyStuff]} == 1) { /if (${Window[FindItemWnd].Open}) { /windowstate FindItemWnd close } /call BuyingStuff } /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",BuyStuff]} == 2) { /if (${Window[FindItemWnd].Open}) { /windowstate FindItemWnd close } /while (${vendorsVisited} != 5) { /call BuyingStuff } /if (${Window[MerchantWnd].Open}) { /windowstate MerchantWnd close } } /if (${parcels} == 1) { /echo Pareceling is about to begin... /if (!${Window[MerchantWnd].Open}) { /call FindVendor } /if (!${Window[FindItemWnd].Open}) { /windowstate FindItemWnd open } /delay 10 /varset looper -1 /varset looperTwo -1 /varset fieldCleared 0 /varset parcelMules ${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",ParcelMules]} /nomodkey /notify MerchantWnd MW_MerchantSubwindows tabselect 3 /for looper 0 to ${totalSlots} /if (${Window[FindItemWnd].Child[FIW_ItemList].List[${looper},4].Compare[General]} == 32) { /if (${fieldCleared} == 0) { /nomodkey /notify FindItemWnd FIW_ItemList listselect ${looper} /delay 10 /nomodkey /notify MerchantWnd MW_Send_To_Edit leftmouseup /delay 10 /for looperFour 0 to 30 /nomodkey /keypress backspace chat /next looperFour /varset looperFour -1 /varset fieldCleared 1 } /for looperTwo 0 to ${totalSlots} /varset itemName ${Window[FindItemWnd].Child[FIW_ItemList].List[${looper},2]} /varset firstLetter ${itemName.Left[1]} /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[Parcel1]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel1]}) { /nomodkey /notify FindItemWnd FIW_ItemList listselect ${looper} /varset itemQuantity ${Window[FindItemWnd].Child[FIW_ItemList].List[${looper},3]} /nomodkey /notify MerchantWnd MW_Send_To_Edit leftmouseup /if (${targetMule.Length}) { /if (${targetMule.Equal[${parcelMules.Arg[1,|]}]}) { } else { /for looperFour 0 to ${targetMule.Length} /nomodkey /keypress backspace chat /next looperFour /varset targetMule ${parcelMules.Arg[1,|]} /nomodkey /notify FindItemWnd FIW_ItemList listselect ${looper} /delay 10 } } else { /varset targetMule ${parcelMules.Arg[1,|]} } /if (${whichMule} != 1) { /for looperThree 1 to ${targetMule.Length} /varset char ${targetMule.Mid[${looperThree},1]} /if (${looperThree} == ${targetMule.Length}) { /nomodkey /keypress ${char} chat /varset looperThree -1 /varset whichMule 1 /break } else { /nomodkey /keypress ${char} chat } /next looperThree } /nomodkey /notify MerchantWnd MW_Send_Button leftmouseup /delay 10 /if (${Window[QuantityWnd].Open}) { /nomodkey /notify QuantityWnd QTYW_Accept_Button leftmouseup /echo You sent \at ${itemQuantity} ${itemName} \ax to \ar ${targetMule}\ax! /varcalc totalParcel ${totalParcel}+${itemQuantity} /delay 30 } else { /echo You sent \at ${itemQuantity} ${itemName} \ax to \ar ${targetMule}\ax! /delay 30 } } /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[Parcel2]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel2]}) { /nomodkey /notify FindItemWnd FIW_ItemList listselect ${looper} /varset itemQuantity ${Window[FindItemWnd].Child[FIW_ItemList].List[${looper},3]} /nomodkey /notify MerchantWnd MW_Send_To_Edit leftmouseup /if (${targetMule.Length}) { /if (${targetMule.Equal[${parcelMules.Arg[2,|]}]}) { } else { /for looperFour 0 to ${targetMule.Length} /nomodkey /keypress backspace chat /next looperFour /varset targetMule ${parcelMules.Arg[2,|]} /nomodkey /notify FindItemWnd FIW_ItemList listselect ${looper} /delay 10 } } else { /varset targetMule ${parcelMules.Arg[2,|]} } /if (${whichMule} != 2) { /for looperThree 1 to ${targetMule.Length} /varset char ${targetMule.Mid[${looperThree},1]} /if (${looperThree} == ${targetMule.Length}) { /nomodkey /keypress ${char} chat /varset looperThree -1 /varset whichMule 2 /break } else { /nomodkey /keypress ${char} chat } /next looperThree } /nomodkey /notify MerchantWnd MW_Send_Button leftmouseup /delay 10 /if (${Window[QuantityWnd].Open}) { /nomodkey /notify QuantityWnd QTYW_Accept_Button leftmouseup /echo You sent \at ${itemQuantity} ${itemName} \ax to \ar ${targetMule}\ax! /varcalc totalParcel ${totalParcel}+${itemQuantity} /delay 30 } else { /echo You sent \at ${itemQuantity} ${itemName} \ax to \ar ${targetMule}\ax! /delay 30 } } /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[Parcel3]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel3]}) { /nomodkey /notify FindItemWnd FIW_ItemList listselect ${looper} /varset itemQuantity ${Window[FindItemWnd].Child[FIW_ItemList].List[${looper},3]} /nomodkey /notify MerchantWnd MW_Send_To_Edit leftmouseup /if (${targetMule.Length}) { /if (${targetMule.Equal[${parcelMules.Arg[3,|]}]}) { } else { /for looperFour 0 to ${targetMule.Length} /nomodkey /keypress backspace chat /next looperFour /varset targetMule ${parcelMules.Arg[3,|]} /nomodkey /notify FindItemWnd FIW_ItemList listselect ${looper} /delay 10 } } else { /varset targetMule ${parcelMules.Arg[3,|]} } /if (${whichMule} != 3) { /for looperThree 1 to ${targetMule.Length} /varset char ${targetMule.Mid[${looperThree},1]} /if (${looperThree} == ${targetMule.Length}) { /nomodkey /keypress ${char} chat /varset looperThree -1 /varset whichMule 3 /break } else { /nomodkey /keypress ${char} chat } /next looperThree } /nomodkey /notify MerchantWnd MW_Send_Button leftmouseup /delay 10 /if (${Window[QuantityWnd].Open}) { /nomodkey /notify QuantityWnd QTYW_Accept_Button leftmouseup /echo You sent \at ${itemQuantity} ${itemName} \ax to \ar ${targetMule}\ax! /varcalc totalParcel ${totalParcel}+${itemQuantity} /delay 30 } else { /echo You sent \at ${itemQuantity} ${itemName} \ax to \ar ${targetMule}\ax! /delay 30 } } /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[Parcel4]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel4]}) { /nomodkey /notify FindItemWnd FIW_ItemList listselect ${looper} /varset itemQuantity ${Window[FindItemWnd].Child[FIW_ItemList].List[${looper},3]} /nomodkey /notify MerchantWnd MW_Send_To_Edit leftmouseup /if (${targetMule.Length}) { /if (${targetMule.Equal[${parcelMules.Arg[4,|]}]}) { } else { /for looperFour 0 to ${targetMule.Length} /nomodkey /keypress backspace chat /next looperFour /varset targetMule ${parcelMules.Arg[4,|]} /nomodkey /notify FindItemWnd FIW_ItemList listselect ${looper} /delay 10 } } else { /varset targetMule ${parcelMules.Arg[4,|]} } /if (${whichMule} != 4) { /for looperThree 1 to ${targetMule.Length} /varset char ${targetMule.Mid[${looperThree},1]} /if (${looperThree} == ${targetMule.Length}) { /nomodkey /keypress ${char} chat /varset looperThree -1 /varset whichMule 4 /break } else { /nomodkey /keypress ${char} chat } /next looperThree } /nomodkey /notify MerchantWnd MW_Send_Button leftmouseup /delay 10 /if (${Window[QuantityWnd].Open}) { /nomodkey /notify QuantityWnd QTYW_Accept_Button leftmouseup /echo You sent \at ${itemQuantity} ${itemName} \ax to \ar ${targetMule}\ax! /varcalc totalParcel ${totalParcel}+${itemQuantity} /delay 30 } else { /echo You sent \at ${itemQuantity} ${itemName} \ax to \ar ${targetMule}\ax! /delay 30 } } /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[Parcel5]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel5]}) { /nomodkey /notify FindItemWnd FIW_ItemList listselect ${looper} /varset itemQuantity ${Window[FindItemWnd].Child[FIW_ItemList].List[${looper},3]} /nomodkey /notify MerchantWnd MW_Send_To_Edit leftmouseup /if (${targetMule.Length}) { /if (${targetMule.Equal[${parcelMules.Arg[5,|]}]}) { } else { /for looperFour 0 to ${targetMule.Length} /nomodkey /keypress backspace chat /next looperFour /varset targetMule ${parcelMules.Arg[5,|]} /nomodkey /notify FindItemWnd FIW_ItemList listselect ${looper} /delay 10 } } else { /varset targetMule ${parcelMules.Arg[5,|]} } /if (${whichMule} != 5) { /for looperThree 1 to ${targetMule.Length} /varset char ${targetMule.Mid[${looperThree},1]} /if (${looperThree} == ${targetMule.Length}) { /nomodkey /keypress ${char} chat /varset looperThree -1 /varset whichMule 5 /break } else { /nomodkey /keypress ${char} chat } /next looperThree } /nomodkey /notify MerchantWnd MW_Send_Button leftmouseup /delay 10 /if (${Window[QuantityWnd].Open}) { /nomodkey /notify QuantityWnd QTYW_Accept_Button leftmouseup /echo You sent \at ${itemQuantity} ${itemName} \ax to \ar ${targetMule}\ax! /varcalc totalParcel ${totalParcel}+${itemQuantity} /delay 30 } else { /echo You sent \at ${itemQuantity} ${itemName} \ax to \ar ${targetMule}\ax! /delay 30 } } /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[Parcel1]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[Parcel2]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[Parcel3]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[Parcel4]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[Parcel5]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel1]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel2]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel3]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel4]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel5]}) { } else { /break } /next looperTwo } /next looper } /if (${Window[FindItemWnd].Open}) { /windowstate FindItemWnd close } /if (${Window[MerchantWnd].Open}) { /windowstate MerchantWnd close } /if (${Window[InventoryWindow].Open}) { /windowstate InventoryWindow close } /echo \agWe are finished! /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",DestroyItems]} == 1) { /if (${totalDest} == 0) { /echo We had nothing to destroy, whoopee! } else { /echo We destroyed a total of \ar${totalDest}\ax item(s), how exciting! } } /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",SellStuff]} == 1) { /echo We vendored \at${totalSold} \axitem(s) for a rough estimate of \ag${totalMoney}pp\ax! } /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",BuyStuff]} == 1 || ${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",BuyStuff]} == 2) { /echo We bought \at${totalBought} \axitem(s) for a cost of \ag${totalCost}pp\ax! } /if (${parcels} == 1) { /echo We parceled \at${totalParcel} \axitem(s)! } |-End Main Functionality /return |-------------------------------------------------------------| | Sub BuildINI |-------------------------------------------------------------| Sub BuildINI /declare slot int local -1 /declare containers[30] string outer /ini AutoVendor_${Me.CleanName}.ini "|====== Instructions ======|" "Instructions" "Set items on the list you want to sell to Sell, not sell to Ignore. Make sure SellStuff is set to 1 (is by default) if you plan on selling stuff!" /ini AutoVendor_${Me.CleanName}.ini "|====== Instructions ======|" "Instructions2" "If you'd like to Parcel, set ParcelOn to 1, ParcelMules to your toons names and the items you want to parcel to Parcel1-5 respectively." /ini AutoVendor_${Me.CleanName}.ini "|====== Instructions ======|" "Instructions3" "To destroy items, set DestroyItems to 1 and set whatever you want to get rid of to Destroy." /ini AutoVendor_${Me.CleanName}.ini "|====== Instructions ======|" "Instructions4" "To summon a vendor where there would otherwise not be one, set SummonVendor to 1 (ParcelOn must be 0 for this to work)." /ini AutoVendor_${Me.CleanName}.ini "|====== Instructions ======|" "Instructions5" "To buy things, set BuyStuff to 1 and items to Buy or, alternatively, BuyParcel1-5 if you're using parcels and want to parcel the things you bought." /ini AutoVendor_${Me.CleanName}.ini "|====== Instructions ======|" "Instructions6" "To buy stuff from a list of up to 5 vendors, set BuyStuff to 2 and list your vendors accordingly using the BuyVendors variable." /if (!${Window[InventoryWindow].Open}) { /windowstate InventoryWindow open } /if (!${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",ParcelOn].Length}) { /ini AutoVendor_${Me.CleanName}.ini "|====== Options ======|" "ParcelOn" "0" /ini AutoVendor_${Me.CleanName}.ini "|====== Options ======|" "ParcelMules" "InsertMuleNameHere|InsertMuleNameHere|InsertMuleNameHere|InsertMuleNameHere|InsertMuleNameHere" /ini AutoVendor_${Me.CleanName}.ini "|====== Options ======|" "SellStuff" "1" /ini AutoVendor_${Me.CleanName}.ini "|====== Options ======|" "BuyStuff" "0" /ini AutoVendor_${Me.CleanName}.ini "|====== Options ======|" "BuyVendors" "VendorNameHere|VendorNameHere|VendorNameHere|VendorNameHere|VendorNameHere" /ini AutoVendor_${Me.CleanName}.ini "|====== Options ======|" "DestroyItems" "0" /ini AutoVendor_${Me.CleanName}.ini "|====== Options ======|" "SummonVendor" "0" /ini AutoVendor_${Me.CleanName}.ini "|====== Options ======|" "TotalItems" ${totalSlots} } /echo Grabbing our containers... /delay 10 /for slot 23 to 30 /varset itemName ${Me.Inventory[${slot}].Name} /if (${InvSlot[${slot}].Item.Container}) { /varset containers[${slot}] ${itemName} /if (!${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Containers ======|",${itemName}].Length}) { /ini AutoVendor_${Me.CleanName}.ini "|====== Containers ======|" "${itemName}" "TRUE" } /echo ${containers[${slot}]} } else { /echo ${itemName} is not a container, skipping... } /next slot /windowstate InventoryWindow close /varset slot -1 /if (!${Window[FindItemWnd].Open}) { /windowstate FindItemWnd open } /echo Grabbing our items... /delay 10 /for slot 0 to ${totalSlots} /if (${Window[FindItemWnd].Child[FIW_ItemList].List[${slot},4].Compare[General]} == 32) { /nomodkey /notify FindItemWnd FIW_ItemList listselect ${slot} /varset itemName ${Window[FindItemWnd].Child[FIW_ItemList].List[${slot},2]} /varset firstLetter ${itemName.Left[1]} /if (!${Ini[AutoVendor_${Me.CleanName}.ini,|==================== ${firstLetter} ====================|,${itemName}].Length}) { /if (${FindItem[${itemName}].Value} <= 0 || ${FindItem[${itemName}].NoDrop} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Containers ======|",${itemName}]}) { /echo ${itemName} is not valid for vendoring, skipping... } else { /echo Creating entry for ${itemName}. /ini AutoVendor_${Me.CleanName}.ini "|==================== ${firstLetter} ====================|" "${itemName}" "Sell" } } } /next slot /windowstate FindItemWnd close /return |-------------------------------------------------------------| | End BuildINI |-------------------------------------------------------------| |-------------------------------------------------------------| | Sub CheckINI |-------------------------------------------------------------| Sub CheckINI /if (!${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Instructions ======|",Instructions].Length} || !${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Instructions ======|",Instructions2].Length} || !${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Instructions ======|",Instructions3].Length} || !${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Instructions ======|",Instructions4].Length} || !${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Instructions ======|",Instructions5].Length} || !${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Instructions ======|",Instructions6].Length}) { /ini AutoVendor_${Me.CleanName}.ini "|====== Instructions ======|" "Instructions" "Set items on the list you want to sell to Sell, not sell to Ignore. Make sure SellStuff is set to 1 (is by default) if you plan on selling stuff!" /ini AutoVendor_${Me.CleanName}.ini "|====== Instructions ======|" "Instructions2" "If you'd like to Parcel, set ParcelOn to 1, ParcelMules to your toons names and the items you want to parcel to Parcel1-5 respectively." /ini AutoVendor_${Me.CleanName}.ini "|====== Instructions ======|" "Instructions3" "To destroy items, set DestroyItems to 1 and set whatever you want to get rid of to Destroy." /ini AutoVendor_${Me.CleanName}.ini "|====== Instructions ======|" "Instructions4" "To summon a vendor where there would otherwise not be one, set SummonVendor to 1 (ParcelOn must be 0 for this to work)." /ini AutoVendor_${Me.CleanName}.ini "|====== Instructions ======|" "Instructions5" "To buy things, set BuyStuff to 1 and items to Buy or, alternatively, BuyParcel1-5 if you're using parcels and want to parcel the things you bought." /ini AutoVendor_${Me.CleanName}.ini "|====== Instructions ======|" "Instructions6" "To buy stuff from a list of up to 5 vendors, set BuyStuff to 2 and list your vendors accordingly using the BuyVendors variable." } /if (!${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",ParcelOn].Length}) { /echo INI is missing \atParcelOn\ax, writing variable. /ini AutoVendor_${Me.CleanName}.ini "|====== Options ======|" "ParcelOn" "0" /varset iniChanged 1 } /if (!${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",ParcelMules].Length}) { /echo INI is missing \atParcelMules\ax, writing variable. /ini AutoVendor_${Me.CleanName}.ini "|====== Options ======|" "ParcelMules" "InsertMuleNameHere|InsertMuleNameHere|InsertMuleNameHere|InsertMuleNameHere|InsertMuleNameHere" /varset iniChanged 1 } /if (!${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",SellStuff].Length}) { /echo INI is missing \atSellStuff\ax, writing variable. /ini AutoVendor_${Me.CleanName}.ini "|====== Options ======|" "SellStuff" "1" /varset iniChanged 1 } /if (!${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",BuyStuff].Length}) { /echo INI is missing \atBuyStuff\ax, writing variable. /ini AutoVendor_${Me.CleanName}.ini "|====== Options ======|" "BuyStuff" "0" /varset iniChanged 1 } /if (!${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",BuyVendors].Length}) { /echo INI is missing \atBuyVendors\ax, writing variable. /ini AutoVendor_${Me.CleanName}.ini "|====== Options ======|" "BuyVendors" "VendorNameHere|VendorNameHere|VendorNameHere|VendorNameHere|VendorNameHere" /varset iniChanged 1 } /if (!${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",DestroyItems].Length}) { /echo INI is missing \atDestroyItems\ax, writing variable. /ini AutoVendor_${Me.CleanName}.ini "|====== Options ======|" "DestroyItems" "0" /varset iniChanged 1 } /if (!${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",SummonVendor].Length}) { /echo INI is missing \atSummonVendor\ax, writing variable. /ini AutoVendor_${Me.CleanName}.ini "|====== Options ======|" "SummonVendor" "0" /varset iniChanged 1 } /if (!${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",TotalItems].Length}) { /echo INI is missing \atTotalItems\ax, writing variable. /ini AutoVendor_${Me.CleanName}.ini "|====== Options ======|" "TotalItems" ${totalSlots} /varset iniChanged 1 } /if (${iniChanged} != 0) { /echo \arWe added the above variables to our INI! /echo \arIf you'd like to use them, please edit your INI and restart the macro. /for counter 0 to 4 /if (${counter} == 0) { /echo Continuing in 5... } /if (${counter} == 1) { /echo 4... } /if (${counter} == 2) { /echo 3... } /if (${counter} == 3) { /echo 2... } /if (${counter} == 4) { /echo 1... } /delay 10 /next counter } /return |-------------------------------------------------------------| | End BuildINI |-------------------------------------------------------------| |-------------------------------------------------------------| | Sub FindVendor |-------------------------------------------------------------| Sub FindVendor /declare slot int local -1 /for slot 0 to 200 /if (${parcels} == 0 && !${Zone.Name.Equal[Guild Lobby]}) { /for looper 0 to 200 /varset vendorType ${Window[FindLocationWnd].Child[FLW_FindLocationList].List[${looper},1]} /if (${vendorType.Equal[Parcels and General Supplies]} || ${vendorType.Equal[General Supplies]} ) { /varset vendorName ${Window[FindLocationWnd].Child[FLW_FindLocationList].List[${looper},2]} /delay 10 /tar ${vendorName} /echo We have found a suitable vendor! Navigating to ${vendorName}. /delay 20 /nav target /while (${Navigation.Active}) { /delay 10 } /usetarget /if (${Window[FindLocationWnd].Open}) { /windowstate FindLocationWnd close } /break } /next looper /break } /if (${parcels} == 1) { /for looper 0 to 200 /varset vendorType ${Window[FindLocationWnd].Child[FLW_FindLocationList].List[${looper},1]} /if (${vendorType.Equal[Parcels and General Supplies]}) { /varset vendorName ${Window[FindLocationWnd].Child[FLW_FindLocationList].List[${looper},2]} /delay 10 /tar ${vendorName} /echo We have found a suitable vendor! Navigating to ${vendorName}. /delay 20 /nav target /while (${Navigation.Active}) { /delay 10 } /usetarget /if (${Window[FindLocationWnd].Open}) { /windowstate FindLocationWnd close } /break } /next looper /break } /if (${Zone.Name.Equal[Guild Lobby]} && ${parcels} == 0) { /tar A Disciple of Luclin /echo We have found a suitable vendor! Navigating to A Disciple of Luclin. /delay 20 /nav target /while (${Navigation.Active}) { /delay 10 } /usetarget /break } /next slot /delay 20 /if (!${Window[MerchantWnd].Open}) { /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",SummonVendor]} == 1 && ${parcels} == 0) { /echo There is no suitable vendor, attempting to summon/trade with one. /if (!${Me.AltAbilityReady[Summon Resupply Agent]} && ${Me.Buff[Summon Resupply Agent].ID}) { /tar ${Me.CleanName}`s familiar /delay 10 /nav target /while (${Navigation.Active}) { /delay 10 } /delay 20 /usetarget /if (${Window[FindLocationWnd].Open}) { /windowstate FindLocationWnd close } } /if (${Me.AltAbilityReady[Summon Resupply Agent]}) { /alt act 8081 /delay 20 /tar ${Me.CleanName}`s familiar /delay 10 /usetarget /if (${Window[FindLocationWnd].Open}) { /windowstate FindLocationWnd close } } /delay 20 /if (!${Window[MerchantWnd].Open}) { /echo Could not succesfully summon/trade with vendor. /echo Please relocate to a zone with a General Supplies vendor and restart the macro. /endmac } } else { /echo There was no suitable vendor for your requirements. /echo Please move to a different zone. /endmac } } /return |-------------------------------------------------------------| | End FindVendor |-------------------------------------------------------------| |-------------------------------------------------------------| | Sub GetTotalSlots |-------------------------------------------------------------| Sub GetTotalSlots /echo Getting our total # of items... /if (!${Window[FindItemWnd].Open}) { /windowstate FindItemWnd open } /for looper 1 to 100000 /nomodkey /notify FindItemWnd FIW_ItemList listselect ${looper} /if (${Window[FindItemWnd].Child[FIW_ItemList].List[${looper},4].Length} == 0) { /break } else { /varcalc totalSlots ${totalSlots}+1 } /next looper /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",TotalItems].Length}) { /ini AutoVendor_${Me.CleanName}.ini "|====== Options ======|" "TotalItems" ${totalSlots} } /varset looper -1 /return |-------------------------------------------------------------| | End GetTotalSlots |-------------------------------------------------------------| |-------------------------------------------------------------| | Sub BuyingStuff |-------------------------------------------------------------| Sub BuyingStuff /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",BuyStuff]} == 1 || ${vendorsVisited} == 0) { /echo Buying is about to begin... } /if (!${Window[MerchantWnd].Open} && ${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",BuyStuff]} == 1) { /call FindVendor } /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",BuyStuff]} == 2) { /varset specifiedVen ${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",BuyVendors]} /call FindSpecificVendor } /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|====== Options ======|",BuyStuff]} == 2 && ${specifiedVen.Equal[VendorNameHere|VendorNameHere|VendorNameHere|VendorNameHere|VendorNameHere]}) { /echo \arYou're using specified vendors but haven't set any. /echo Set some vendors in your INI then restart the macro. /endmac } /delay 10 /varset looper -1 /varset looperTwo -1 /if (${Window[MerchantWnd].Open}) { /for looper 1 to 100000 /nomodkey /notify MerchantWnd MW_ItemList listselect ${looper} /varset itemName ${Window[MerchantWnd].Child[MW_ItemList].List[${looper},2]} /varset itemCost ${Window[MerchantWnd].Child[MW_ItemList].List[${looper},5]} /varset firstLetter ${itemName.Left[1]} /if (${Window[MerchantWnd].Child[MW_ItemList].List[${looper},2].Length} == 0) { /break } /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[Buy]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel1]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel2]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel3]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel4]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel5]}) { /delay 10 /nomodkey /notify MerchantWnd MW_Buy_Button leftmouseup /delay 20 /if (${Window[QuantityWnd].Open}) { /varset itemQuantity ${Window[QuantityWnd].Child[QTYW_SliderInput].Text} /nomodkey /notify QuantityWnd QTYW_Accept_Button leftmouseup /delay 20 } else { /varset itemQuantity 1 } /varcalc saleTotal ${itemQuantity}*${itemCost} /echo We bought \at ${itemQuantity} ${itemName} \ax for a total of \ag ${saleTotal}pp\ax! /varcalc totalCost ${saleTotal}+${totalCost} /varcalc totalBought ${itemQuantity}+${totalBought} /varcalc timesBought ${timesBought}+1 } /for looperTwo 0 to 100000 /varset itemName ${Window[MerchantWnd].Child[MW_ItemList].List[${looper},2]} /if (${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[Buy]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel1]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel2]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel3]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel4]} || ${Ini[AutoVendor_${Me.CleanName}.ini,"|==================== ${firstLetter} ====================|",${itemName}].Equal[BuyParcel5]}) { /delay 10 /nomodkey /notify MerchantWnd MW_Buy_Button leftmouseup /delay 20 /if (${Window[QuantityWnd].Open}) { /varset itemQuantity ${Window[QuantityWnd].Child[QTYW_SliderInput].Text} /nomodkey /notify QuantityWnd QTYW_Accept_Button leftmouseup /delay 20 } else { /varset itemQuantity 1 } /varcalc saleTotal ${itemQuantity}*${itemCost} /echo We bought \at ${itemQuantity} ${itemName} \ax for a total of \ag ${saleTotal}pp\ax! /varcalc totalCost ${saleTotal}+${totalCost} /varcalc totalBought ${itemQuantity}+${totalBought} /varcalc timesBought ${timesBought}+1 } else { /break } /next looperTwo /next looper } else { /echo Vendor is either not set, is mispelled or isn't in this zone, skipping... } /varcalc totalSlots ${totalSlots}+${timesBought} /return |-------------------------------------------------------------| |End BuyingStuff |-------------------------------------------------------------| |-------------------------------------------------------------| | Sub FindSpecificVendor |-------------------------------------------------------------| Sub FindSpecificVendor /if (${Window[MerchantWnd].Open}) { /windowstate MerchantWnd close } /if (${specifiedVen.Arg[1,|].NotEqual[VendorNameHere]} && ${specifiedVen.Arg[1,|].Length} && ${vendorsVisited} == 0) { /tar ${specifiedVen.Arg[1,|]} /delay 10 /echo Naving to our first vendor, ${specifiedVen.Arg[1,|]}. /nav target /while (${Navigation.Active}) { /delay 10 } /usetarget } /if (${specifiedVen.Arg[2,|].NotEqual[VendorNameHere]} && ${specifiedVen.Arg[2,|].Length} && ${vendorsVisited} == 1) { /tar ${specifiedVen.Arg[2,|]} /delay 10 /echo Naving to our second vendor, ${specifiedVen.Arg[2,|]}. /nav target /while (${Navigation.Active}) { /delay 10 } /usetarget } /if (${specifiedVen.Arg[3,|].NotEqual[VendorNameHere]} && ${specifiedVen.Arg[3,|].Length} && ${vendorsVisited} == 2) { /tar ${specifiedVen.Arg[3,|]} /delay 10 /echo Naving to our third vendor, ${specifiedVen.Arg[3,|]}. /nav target /while (${Navigation.Active}) { /delay 10 } /usetarget } /if (${specifiedVen.Arg[4,|].NotEqual[VendorNameHere]} && ${specifiedVen.Arg[4,|].Length} && ${vendorsVisited} == 3) { /tar ${specifiedVen.Arg[4,|]} /delay 10 /echo Naving to our fourth vendor, ${specifiedVen.Arg[4,|]}. /nav target /while (${Navigation.Active}) { /delay 10 } /usetarget } /if (${specifiedVen.Arg[5,|].NotEqual[VendorNameHere]} && ${specifiedVen.Arg[5,|].Length} && ${vendorsVisited} == 4) { /tar ${specifiedVen.Arg[5,|]} /delay 10 /echo Naving to our fifth vendor, ${specifiedVen.Arg[5,|]}. /nav target /while (${Navigation.Active}) { /delay 10 } /usetarget } /varcalc vendorsVisited ${vendorsVisited}+1 /return |-------------------------------------------------------------| | End FindSpecificVendor |-------------------------------------------------------------|