efilnikufecin
Member
I have an old script that puts crap in my DC I'm guessing it handles near 440 items if I have them. It works, but if I have all 440 items, then the script will hit kol's servers 440 times. That is not my idea of a server friendly script.
Kol's servers handle 11 items at a time going into the DC, while my old script only handles 1. If I modify my script to put 11 at a time in, the server hits are reduced to 40. A massive difference of 400 hits.
OK so now with the new features in 7.8 I should be able to create a script to handle 11 items at a time far easier than before, so I set to work on it.
I have written 2 of the functions needed, and tried a quick debug run on a not looged in instance of kolmafia.
Here is the source:
Any ideas why this script errors out on the first line? BTW yes I am using 7.8
Kol's servers handle 11 items at a time going into the DC, while my old script only handles 1. If I modify my script to put 11 at a time in, the server hits are reduced to 40. A massive difference of 400 hits.
OK so now with the new features in 7.8 I should be able to create a script to handle 11 items at a time far easier than before, so I set to work on it.
I have written 2 of the functions needed, and tried a quick debug run on a not looged in instance of kolmafia.
is the error I get.[int Acounter] does not match a valid script.
Here is the source:
Code:
int Acounter;
int Bcounter;
int BcounterMax = 11;
int SaveAmount[int, int];
item DisplayItems[int, int];
void ItemAdd(item toAdd, int QuantToSave)
{
if Bcounter < BcounterMax
{
Bcounter = Bcounter + 1;
}
else
{
//when Bcounter is = to BcounterMax, reset to 1, and add 1 to Acounter
Bcounter = 1;
Acounter = Acounter + 1;
}
DisplayItems[Acounter, Bcounter] = toAdd;
SaveAmount[Acounter, Bcounter] = QuantToSave;
}
void RemoveTopGroup()
{
While Bcounter > 0
{
DisplayItems[Acounter, Bcounter] = $item[none];
Bcounter = Bcounter - 1;
}
Acounter = Acounter - 1;
if Acounter > 0
{
//if Acounter is 0, then the map is empty.
Bcounter = 11;
}
}
void Main()
{
ItemAdd($item[disco ball], 3);
print("DisplayItems " + acounter + "," + bcounter + "=" + DisplayItems[acounter, bcounter] + "SaveAmount = " +
SaveAmount[acounter, bcounter]);
}