paid script request

ludwig

New member
Hi all. I'd like to automate something with a script, but unfortunately I'm not a coder, so if possible I'd like to pay someone to write the script. I'm unsure how much time and effort it would take, but I can offer 4 Mr. Accessories as a start, and could be open to paying more if the work requires over a couple hours.

Basically, I'd like to automate shopping in specific players' mall stores. Rather than search the mall for an item, I want to go directly to a player's shop to make a purchase. I'd like a script that goes to the profile page of a specific player ID, or range of player IDs, navigates from the profile page into their mall shop, and buy a specified item, or list of items, irrespective of their price (this is not a mall bot). Would anyone be willing to script this for me?
 
It's not possible. KoLmafia specifically disallows scripts from looking at mall stores, in order to prevent the creation of mallbots.
 
Last edited:
Actually, I looked into this. We only ban mall searches, not queries of individual mall stores.

Individual mall stores are at mallstore.php.

Code:
// Player ID -> item -> quantity
int[int, item] items_to_buy {
  121572: {
    $item[roll in the hay]: 2,
    $item[slap and tickle]: 1,
  },
  354981: {
    $item[pink pony]: 1,
    $item[slip 'n' slide]: 1,
  },
};

foreach player_id in items_to_buy {
  string store = visit_url("mallstore.php?whichstore=" + player_id);
  foreach it, qty in items_to_buy[player_id] {
    matcher m = create_matcher("<input name=whichitem  type=radio value=(" + to_int(it) + "\\.\\d+)", store);
    if (!m.find()) {
      print(it + " not found in player #" + player_id + "'s store.");
      continue;
    }
    visit_url("mallstore.php?whichstore=" + player_id + "&buying=Yep.&whichitem=" + m.group(1) + "&quantity=" + qty + "&pwd", true);
    // Sleep for 1 second after each purchase to avoid hammering all the stores all at once.
    waitq(1);
  }
}
 
(obligatory instructions: install that as, say, scripts/buy_from_mall_stores.ash, then run it by invoking `call buy_from_mall_stores` in the graphical CLI.)
 
Back
Top