take_stash() problem

Sako

Member
I just upgraded to 9.2, and my script is broken...

One of my multis is in a clan that has a TPS in the stash, with the policy of immediately putting it back in after using it. So I use this script to get it....
Code:
// Fetches the TPS from the clan stash.
void getTPS()
{
 int iterations;

 if (item_amount($item[tiny plastic sword]) == 0)
 {
  iterations = 0;

  take_stash(1, $item[tiny plastic sword]);

  while (item_amount($item[tiny plastic sword]) == 0)
  {
   cli_execute("wait 30");
   take_stash(1, $item[tiny plastic sword]);
   iterations = (iterations + 1);

   if (iterations == 5)
   {
    break;
   }
  }
 }
}

In mafia 8.7, if the TPS was not in the stash, the script said "transfer may have failed for item tiny plastic sword" and retried for 5 times. Now it doesn't work even if the TPS actually is in the stash, it keeps waiting and saying "request completed". Tips?
 

Nightmist

Member
You might be interested in this, although I'm not too sure how much it will help, it might work.
The Wiki said:
void refresh_stash()
Takes a new look at the contents of your clan stash. Crucial if your clanmates have been manipulating the contents during your session.
 

holatuwol

Developer
Nightmist nailed that one. One of the changes that went in between 8.8 and 9.2 is that KoLmafia checks to make sure that you have sufficient items at your source location before initiating any transfers. Since you've never been to the stash, KoLmafia thinks you don't have any TPSes and ignores that item, skipping onto any other items you might want to transfer. A stash refresh should fix the problem.
 
Top