|---------------------------------------------------------------------------------------------------| |- AutoVendor created by Ionis ver. 2.2 |- If you have any questions or concerns please contact me on discord @ Zerxes#0809 |- For initialization use: /mac autovendor buildini #ofitemshere (ex. /mac autovendor buildini 267) |- You can find your total # of items in the find item window in the bottom right hand corner. |- After initialization and ini setup, restart the macro with: /mac autovendor |---------------------------------------------------------------------------------------------------| #warning #turbo 80 Sub Main |-MAIN DECLARES DO NOT TOUCH THESE-| /declare itemName string outer /declare vendorName string outer /declare totalSlots string outer /declare vendorType string outer /declare char string outer /declare parcelMules string outer /declare targetMule string outer /declare whichMule int outer /declare itemValue int outer /declare itemQuantity int outer /declare saleTotal int outer /declare totalMoney int outer /declare totalItems int outer /declare totalSold int outer /declare totalParcel int outer /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-| |-Call BuildINI /if (${Defined[Param0]}) { /if (${Defined[Param1]}) { /varset totalSlots ${Param1} /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 #ofitemshere /echo You can find the number of items in the bottom right of your find item window. /endmac } } else { /echo You need to declare how many items you have total. /echo Try again but do it like this: /mac autovendor buildini #ofitemshere /echo You can find the number of items in the bottom right of your find item window. /endmac } } |-End Call BuildINI |-Start Main Functionality /varset totalSlots ${Ini[AutoVendor.ini,"TotalItems",TotalItems]} /varset parcels ${Ini[AutoVendor.ini,"Parcels",ParcelOn]} /call FindVendor /delay 20 /if (!${Window[FindItemWnd].Open}) { /windowstate FindItemWnd open } /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]}]} /if (${Ini[AutoVendor.ini,"Items",${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 (${parcels} == 1) { /varset looper -1 /varset looperTwo -1 /varset fieldCleared 0 /varset parcelMules ${Ini[AutoVendor.ini,"Parcels",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]} /if (${Ini[AutoVendor.ini,"Items",${itemName}].Equal[Parcel1]}) { /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,|]} } } 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 20 } else { /echo You sent \at ${itemQuantity} ${itemName} \ax to \ar ${targetMule}\ax! /delay 20 } } /if (${Ini[AutoVendor.ini,"Items",${itemName}].Equal[Parcel2]}) { /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,|]} } } 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 20 } else { /echo You sent \at ${itemQuantity} ${itemName} \ax to \ar ${targetMule}\ax! /delay 20 } } /if (${Ini[AutoVendor.ini,"Items",${itemName}].Equal[Parcel3]}) { /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,|]} } } 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 20 } else { /echo You sent \at ${itemQuantity} ${itemName} \ax to \ar ${targetMule}\ax! /delay 20 } } /if (${Ini[AutoVendor.ini,"Items",${itemName}].Equal[Parcel4]}) { /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,|]} } } 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 20 } else { /echo You sent \at ${itemQuantity} ${itemName} \ax to \ar ${targetMule}\ax! /delay 20 } } /if (${Ini[AutoVendor.ini,"Items",${itemName}].Equal[Parcel5]}) { /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,|]} } } 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 20 } else { /echo You sent \at ${itemQuantity} ${itemName} \ax to \ar ${targetMule}\ax! /delay 20 } } /if (${Ini[AutoVendor.ini,"Items",${itemName}].Equal[Parcel1]} || ${Ini[AutoVendor.ini,"Items",${itemName}].Equal[Parcel2]} || ${Ini[AutoVendor.ini,"Items",${itemName}].Equal[Parcel3]} || ${Ini[AutoVendor.ini,"Items",${itemName}].Equal[Parcel4]} || ${Ini[AutoVendor.ini,"Items",${itemName}].Equal[Parcel5]}) { } else { /break } /next looperTwo } /next looper } /if (${Window[FindItemWnd].Open}) { /windowstate FindItemWnd close } /if (${Window[MerchantWnd].Open}) { /windowstate MerchantWnd close } /echo We are finished vendoring! /echo We vendored \at${totalSold} \axitems for a rough estimate of \ag${totalMoney}\axpp! /if (${parcels} == 1) { /echo We parceled \at${totalParcel} \axitems! } |-End Main Functionality /return |-------------------------------------------------------------| | Sub BuildINI |-------------------------------------------------------------| Sub BuildINI /declare slot int local -1 /declare containers[30] string outer /ini AutoVendor.ini "Instructions" "Instructions" "Set items on the list you want to sell to Sell, not sell to Ignore and parcel to Parcel1-5 accordingly." /if (!${Window[InventoryWindow].Open}) { /windowstate InventoryWindow open } /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.ini,"Containers",${itemName}].Length}) { /ini AutoVendor.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]} /if (!${Ini[AutoVendor.ini,"Items",${itemName}].Length}) { /if (${FindItem[${itemName}].Value} <= 0) { /echo ${itemName} has no value, skipping... /next slot } /if (${Ini[AutoVendor.ini,"Containers",${itemName}]}) { /echo ${itemName} is a container and we don't want to sell our bags, skipping... /next slot } /if (${FindItem[${itemName}].NoDrop}) { /echo ${itemName} is not vendorable, skipping... /next slot } /echo Creating entry for ${itemName}. /ini AutoVendor.ini "Items" "${itemName}" "Sell" } } /next slot /windowstate FindItemWnd close /if (!${Ini[AutoVendor.ini,"Parcels",ParcelOn].Length}) { /ini AutoVendor.ini "Parcels" "ParcelOn" "0" /ini AutoVendor.ini "Parcels" "ParcelMules" "InsertMuleNameHere|InsertMuleNameHere|InsertMuleNameHere|InsertMuleNameHere|InsertMuleNameHere" } /ini AutoVendor.ini "TotalItems" "TotalItems" ${totalSlots} /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 10 /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 10 /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 10 /if (!${Window[MerchantWnd].Open}) { /echo There was no suitable vendor for your requirements. /echo Please move to a different zone. /endmac } /return |-------------------------------------------------------------| | End FindVendor |-------------------------------------------------------------|