Sell one type of item at a time, so that you don't inadvertently sell any items that have multiple names.
*** DISCLAIMER: I have not tested this script nor used this kind of script. I wrote this entirely on the web browser, so I hope this script will at least give you a general idea.1) A string list with all the items to take out of your bag.
#var takeoutlist {warhammer|moccasins|sword|legplates|boots|chainmail|rags|robes|hat|dagger}
2) Your sell list.
#var selllist {a jagged stone warhammer|a pair of hide moccasins|a large broadsword|a pair of iron legplates|a pair of large leather boots|a pair of studded leather boots|a set of iron chainmail|a suit of leather rags|an iron shortsword|some black cloth robes|a blue hat|a short black dagger}
3) A trigger to check each item taken out. Put a 2.item or some way to skip the item if it does not match.
#trigger {^You get (*) from a bag sewn from strands of starweed.} {
#var itemlist {%additem(%if("%1" =~ "{@selllist}",1,0),@itemlist)}
}
4) An Alias to take out one set of items. Initialize the sell list to for a fresh list of items from the trigger.
#alias takeout {
#var itemlist {}
take all.%item(takeoutlist,@takeoutptr) bag
say YOUR-STOP-MARKER-%item(takeoutlist,@takeoutptr)-THIS-COULD-BE-YOUR-PROMPT
}
5) An Alias to start this process. Initialize a pointer to point to the first item on your takeoutlist.
#alias bandit {
#var takeoutptr 1
takeout
}
*** This assumes that 2.rag is the second rag in your inventory.
*** This also assumes that your inventory is LIFO - Last In First Out.
6) Trigger on the marker to restart the process on the next item in your take out list. Initialize the skip counter.
#trigger {THIS-COULD-BE-YOUR-PROMPT} {
#if %numitems(@itemlist) {
#var skipcounter 1
#loop %numitems(@itemlist),1 {
#if %item(@itemlist,%i) {
sell %if(@skipcounter!=1,@{skipcounter}.)%item(takeoutlist,@takeoutptr)
} {
#add skipcounter 1
}
}
}
put all.coin sack
#if (%numitems(@takeoutlist) > takeoutptr) {
#add takeoutptr 1
takeout
}
}