Implemented the part of the Farming macro which serves Garden Visitors automatically, buying items from the Bazaar if necessary. Note that to use this feature, you must have a Booster Cookie active and have enough coins in your purse to buy the items.
This feature was “kinda” hard to implement (lol), I couldn’t get the sign (input quantity to buy) to work to save my life
Notable changes (features/code):
- Added a mixin that targets
ChatHud.class to check if the visitor macro should run whenever a visitor arrives on the Garden
- Got rid of some redundant
wasPaused checks since some code should run anyway
- The number of visitors waiting is read from the Tablist
- Added automatic instant-buying from the Bazaar using
/bz (will move to a utility class in the future)
In the video, the distance that the player walks forward for each visitor is a bit far, so this was not done for the last visitor (and can also be easily reduced in code).
I suspect that serving visitors automatically could break due to lag, so this feature might not be suitable for too many players. While testing this feature, I realised that instead of only being part of a macro, this could be used to serve visitors when actually playing the game so you don’t have to think.
Currently, the macro doesn’t return to farming after serving visitors. That’s gonna be pretty hard to implement. Instead I might just call it a feature: farming macro runs until max visitors. To get around this, just disable serving visitors in the config.