Keeps the repo root clean - only README.md visible on landing page. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
69 lines
1.8 KiB
C#
69 lines
1.8 KiB
C#
class PetInfo {
|
|
public int Id {get;set;}
|
|
public string Name {get;set;}
|
|
public PetFigureData FigureData {get;set;}
|
|
public int Level {get;set;}
|
|
|
|
public PetInfo(IReadOnlyPacket p) {
|
|
Id = p.ReadInt();
|
|
Name = p.ReadString();
|
|
FigureData = new PetFigureData(p);
|
|
Level = p.ReadInt();
|
|
}
|
|
}
|
|
|
|
class PetFigureData {
|
|
public int TypeId {get;set;}
|
|
public int PaletteId {get;set;}
|
|
public string Color {get;set;}
|
|
public int BreedId {get;set;}
|
|
public List<int[]> CustomParts {get;set;}
|
|
|
|
public PetFigureData(IReadOnlyPacket p) {
|
|
TypeId = p.ReadInt();
|
|
PaletteId = p.ReadInt();
|
|
Color = p.ReadString();
|
|
BreedId = p.ReadInt();
|
|
CustomParts = new();
|
|
var customPartsLength = p.ReadInt();
|
|
for (var i = 0; i < customPartsLength; i++) {
|
|
CustomParts.Add(new int[3] { p.ReadInt(), p.ReadInt(), p.ReadInt() });
|
|
}
|
|
}
|
|
}
|
|
|
|
var pets = new List<PetInfo>();
|
|
|
|
OnIntercept(In.PetInventory, e => {
|
|
var fragments = e.Packet.ReadInt();
|
|
var currentFragment = e.Packet.ReadInt();
|
|
Log($"{currentFragment}/{fragments}");
|
|
if (currentFragment == 0) pets.Clear();
|
|
|
|
var petCount = e.Packet.ReadInt();
|
|
for (var petIdx = 0; petIdx < petCount; petIdx++) {
|
|
pets.Add(new PetInfo(e.Packet));
|
|
}
|
|
Task.Run(async () => {
|
|
if (currentFragment == (fragments - 1)) {
|
|
var plantAmount = pets.Where(x => x.FigureData.TypeId == 16).Count();
|
|
int currentPlant = 0;
|
|
foreach (var plant in pets.Where(x => x.FigureData.TypeId == 16))
|
|
{
|
|
currentPlant++;
|
|
Status($"[{plant.Id}] {currentPlant}/{plantAmount}");
|
|
Send(Out["PlacePet"], plant.Id, 5, 5);
|
|
Delay(1500);
|
|
Send(Out.CompostPlant, plant.Id);
|
|
Delay(1500);
|
|
if(Pets.Count() != 0) {
|
|
Send(Out.RemovePetFromFlat, Pets.First());
|
|
Delay(1000);
|
|
}
|
|
}
|
|
}});
|
|
});
|
|
|
|
Send(Out.GetPetInventory);
|
|
|
|
Wait(); |