KoLmafia Guide: Automatic Mall Selling
Next up is an auto-selling function. In this case, it sells a bunch of stuff that I farmed from the Sea in order to make money with. I am poor, after all. You can easily adapt this script to automatically deal with certain items that you encounter on a regular basis. For example, if Castle-farming, you can mall-sell certain items, auto-sell some of them, or pulverize some.
BIG NOTE: Mafia already has the ability to designate items as 'junk', or 'sellable'. I haven't figured it out yet though... Plus this is easier and quicker for me to control.
a) First up, I figure out how many Slimy Chests I have with item_amount. I then use all of that item. NOTICE the usage of 'cli_execute("command"); I COULD have used what I did in the previous script, which is use(X,$item[Slimy chest]); This would have been simpler. But you learn more this way!
b) You will notice that I used a compound statement to execute the cli_execute command. I took 'use ' then added the number of items I had (lets say 9) , then added ' Slimy Chest'. So the command executed was 'use 9 Slimy chest', when put together. This is handy for opening container-like-items automatically.
c) The cli_execute will run ANY command you could run from the CLI Graphical Interface. You can use the links I've given you at the top of the guide to find a complete list. OR, in the CLI, type /help for a full list. Anything you can do there, you can automate in this way by cli_execute!
d) The next thing is that I want to sell my EXTRAS. What I do is figure out how many of an item I have, then if I have more than X amount, I sell the difference. Once again, I use cli_execute instead of a normal ash script command. This is good for when you want to keep a reserve of a particular item, but don't want them to pile up into the hundreds.
e) The next thing you see is where I sell all of a particular item. Due to extreme laziness, I simply script to mallsell 99 of each item that I want to ditch. It will put UP TO 99 of each into the store with no complaint. Obviously this is less precise, but it does work...and it is very quick and easy.
f) The final command is to 'undercut'. This actually DOES work after all. However Mafia can only see the FIFTH CHEAPEST PRICE. Therefore it sets the price pretty low, but rarely the true lowest price. You can skip this command it desired and just set prices yourself. That's what I wind up doing anyways.