Back to "snippet" tags

Vendor - Restock / Undercutter by jfrostp

Related: Snippet vendor

Description: Register each vendor and item to sell, and this script will restock them with items in your backpack, re-price items on the vendor if you choose, and audit the newly-listed items to make sure the prices are correct. You will need to customize this for your vendors and items, it is currently set up for selling codexes as an example.

# Vendor stock script by Frost # Automatically stocks one or more vendors, re-prices items if needed, and audits the prices to make sure nothing got mispriced removelist vendors createlist! vendors removelist itemTypes createlist! itemTypes removelist prices createlist! prices removelist xValues createlist! xValues removelist yValues createlist! yValues removelist repriceItems createlist! repriceItems setvar! codexPrice 46500 setvar! vendorId 0x17C7A5 # Register each vendor here by adding its info to the following lists: # Vendor: the ID of the vendor to stock the item on (the script is currently using the same vendor for every item) # Item type: the item type to stock on the vendor (you can only do one type per vendor) # Prices: use 0 for harvest tool prices and 1 for chest tool prices (the script is currently using the same price for every item) # X: the X to use for the item # Y: the Y to use for the item # Reprice: set to 1 if you want it to re-price the items already on the vendor to a new price (for undercutting, etc) pushlist vendors vendorId pushlist itemTypes 11897 pushlist prices codexPrice pushlist xValues 0 pushlist yValues 0 pushlist repriceItems 0 pushlist vendors vendorId pushlist itemTypes 11889 pushlist prices codexPrice pushlist xValues 80 pushlist yValues 0 pushlist repriceItems 0 pushlist vendors vendorId pushlist itemTypes 11887 pushlist prices codexPrice pushlist xValues 120 pushlist yValues 0 pushlist repriceItems 0 pushlist vendors vendorId pushlist itemTypes 11890 pushlist prices codexPrice pushlist xValues 160 pushlist yValues 0 pushlist repriceItems 0 pushlist vendors vendorId pushlist itemTypes 11896 pushlist prices codexPrice pushlist xValues 0 pushlist yValues 100 pushlist repriceItems 0 pushlist vendors vendorId pushlist itemTypes 11888 pushlist prices codexPrice pushlist xValues 80 pushlist yValues 100 pushlist repriceItems 0 pushlist vendors vendorId pushlist itemTypes 11886 pushlist prices codexPrice pushlist xValues 120 pushlist yValues 100 pushlist repriceItems 0 pushlist vendors vendorId pushlist itemTypes 11891 pushlist prices codexPrice pushlist xValues 160 pushlist yValues 100 pushlist repriceItems 0 pushlist vendors vendorId pushlist itemTypes 11884 pushlist prices codexPrice pushlist xValues 0 pushlist yValues 140 pushlist repriceItems 0 pushlist vendors vendorId pushlist itemTypes 11882 pushlist prices codexPrice pushlist xValues 80 pushlist yValues 140 pushlist repriceItems 0 pushlist vendors vendorId pushlist itemTypes 11883 pushlist prices codexPrice pushlist xValues 120 pushlist yValues 140 pushlist repriceItems 0 pushlist vendors vendorId pushlist itemTypes 11885 pushlist prices codexPrice pushlist xValues 160 pushlist yValues 140 pushlist repriceItems 0 clearignore cleardragdrop setvar! previousVendor 0 while list vendors > 0 foreach vendorId in vendors setvar! vendor vendorId break endfor if poplist vendors front as throwaway endif foreach type in itemTypes setvar! itemType type break endfor if poplist itemTypes front as throwaway endif foreach p in prices setvar! price p break endfor if poplist prices front as throwaway endif foreach xValue in xValues setvar! x xValue break endfor if poplist xValues front as throwaway endif foreach yValue in yValues setvar! y yValue break endfor if poplist yValues front as throwaway endif foreach rp in repriceItems setvar! reprice rp break endfor if poplist repriceItems front as throwaway endif if vendor = previousVendor else setvar! previousVendor vendor dclick vendor wait delay endif if findtype 3701 vendor as vendorBackpack # Post items in your backpack while findtype itemType backpack as item lift item wait delay drop vendorBackpack x y wait delay promptresponse price wait delay getlabel item label if badPrice in label lift item drop backpack wait delay endif endwhile if reprice = 1 overhead 'Repricing items' while findtype itemType vendorBackpack as item lift item wait delay drop backpack wait delay lift item wait delay drop vendorBackpack x y wait delay promptresponse price wait delay getlabel item label if badPrice in label lift item drop backpack wait delay else @ignore item endif endwhile endif endif endwhile cleardragdrop clearignore