Skip to content

Instantly share code, notes, and snippets.

@scottstamp
Last active April 12, 2022 14:33
Show Gist options
  • Save scottstamp/53636a489197b723b76d89458b22e142 to your computer and use it in GitHub Desktop.
Save scottstamp/53636a489197b723b76d89458b22e142 to your computer and use it in GitHub Desktop.
var root = GetBcCatalog();
ICatalogPage GetBcPageNamed(string name) => GetBcCatalogPage(root.First(x => x.Name == name).Id);
var blockEarnings = true;
var hockey = GetBcPageNamed("gameset_ice_hockey");
var snowboard = GetBcPageNamed("gameset_snowboard");
var rollerskate = GetBcPageNamed("gameset_roller_skates");
var letters = GetBcPageNamed("bc_alphabet");
var blockPages = Enumerable.Range(2, 6).Select(i => GetBcPageNamed($"bc_blocks{i}")).ToList().AsReadOnly();
var blocks = new List<Tuple<int, int>>();
foreach (var page in blockPages)
blocks.AddRange(page.Offers.Select(offer => new Tuple<int, int>(page.Id, offer.Id)));
if (blocks.Count < 384) {
Log("BC Catalog failed to initialize");
return;
}
void SendEventLog(string category, string type, string id) {
Send(Out.LogToEventLog, category, type, id, "", -1);
Delay(300);
}
void PlaceItems(int pageId, int offerId, int size = 2, int amount = 170) {
var count = 0;
for (var x = 1; x <= 32; x += size) {
for (var y = 1; y <= 32; y += size) {
Delay(250);
Send(Out["BuildersClubPlaceRoomItem"], pageId, offerId, "", x, y, 0);
if (count++ >= amount)
return;
}
}
}
RunTask(() => {
SendEventLog("InterfaceExplorer", "interaction", "viewed.privacy.settings");
SendEventLog("InterfaceExplorer", "interaction", "viewed.identification.settings");
SendEventLog("InterfaceExplorer", "interaction", "go.tos");
SendEventLog("InterfaceExplorer", "select", "room.settings.doormode.seen");
SendEventLog("InterfaceExplorer", "hover", "room.settings.chat.scrollspeed.seen");
SendEventLog("InterfaceExplorer", "hover", "room.settings.chat.floodfilter.seen");
SendEventLog("Tutorial", "interaction", "avatar.move");
SendEventLog("Tutorial", "interaction", "viewed.room.settings");
SendEventLog("Tutorial", "interaction", "avatar.chat");
SendEventLog("Tutorial", "interaction", "furniture.move");
SendEventLog("Achievements", "interaction", "furniture.use");
});
OnIntercept((
In["IncomeRewardClaimResponse"],
In["CreditVaultStatus"],
In["IncomeRewardStatus"]), e => {
if (blockEarnings) e.Block();
});
CreateRoom("asdf", "", "model_5", RoomCategory.PersonalSpace, 50, TradePermissions.Allowed);
Delay(1000);
if (int.TryParse(Self.Name.Split('i').Last(), out int nameNum)) {
RunTask(() => {
AddFriend($"SlavaUkraini{nameNum - 1}");
Delay(1000);
AddFriend($"SlavaUkraini{nameNum + 1}");
});
}
Send(Out["ChangeUserName"], Self.Name);
var figure = Self.Figure;
GetProfile(Self.Id);
Send(Out["UpdateFigureData"], "F", figure);
Move(0, 0);
var icePatch = hockey.Offers.First(x => x.Products.Any(p => p.GetIdentifier() == "es_skating_ice"));
PlaceItems(hockey.Id, icePatch.Id);
Talk(":pickallbc");
Delay(1000);
var snowboardPatch = snowboard.Offers.First(x => x.Products.Any(p => p.GetIdentifier() == "snowb_slope"));
PlaceItems(snowboard.Id, snowboardPatch.Id);
Talk(":pickallbc");
Delay(1000);
var rollerPatch = rollerskate.Offers.First(x => x.Products.Any(p => p.GetIdentifier() == "val11_floor"));
PlaceItems(rollerskate.Id, rollerPatch.Id);
Talk(":pickallbc");
Send(Out["IncomeRewardClaim"], (byte)5);
Delay(550);
Send(Out["GiveStarGemToUser"], (int)63718370, 2);
var blockEnum = blocks.GetEnumerator();
for (var x = 1; x <= 32; x++) {
for (var y = 1; y <= 32; y++) {
if (!blockEnum.MoveNext() || FloorItems.Count() > 384) break;
Delay(250);
Send(Out["BuildersClubPlaceRoomItem"], blockEnum.Current.Item1, blockEnum.Current.Item2, "", x, y, 0);
}
}
Send(Out["UpdateFigureData"], "M", figure);
EnsureInventory();
if (Inventory.GetFloorItems().Count() == 0) {
var cata = GetCatalog();
var petAccessories = cata.First(x => x.Name == "baby_pet_accessories");
var milkBowl = GetCatalogPage(petAccessories.Id).Offers.First(x => x.Products.Any(p => p.GetIdentifier() == "milkbowl") && x.PriceInActivityPoints == 15);
Send(Out.PurchaseFromCatalog, petAccessories.Id, milkBowl.Id, "", 1);
}
var moveItem = FloorItems.First();
MoveFloorItem(moveItem.Id, moveItem.X, moveItem.Y, moveItem.Direction);
Delay(1000);
EnsureInventory();
PlaceFloorItem(Inventory.GetFloorItems().FirstOrDefault().Id * -1, 32, 32, 0);
Delay(1000);
Talk(":pickall");
Send(Out["IncomeRewardClaim"], (byte)1);
Delay(550);
Send(Out["IncomeRewardClaim"], (byte)2);
Delay(550);
//Send(Out["IncomeRewardClaim"], (byte)5);
System.Media.SystemSounds.Hand.Play();
blockEarnings = false;
/* start room raider */
OnIntercept((
In.Items, In["Objects"], In["Users"],
In["GetGuestRoomResult"], In["OpenConnection"],
In["Interstitial"], In["RoomReady"], In["RoomProperty"],
In["YouAreController"], In["YouAreOwner"], In["RoomRating"],
In["HabboGroupBadges"], In["RoomEntryTile"], In["HeightMap"],
In["FloorHeightMap"], In["RoomVisualizationSettings"],
In["RoomEntryInfo"], In["RoomEvent"], In["UserUpdate"]), e => e.Block());
var count = 0;
var progress = 0;
OnIntercept(In["Achievement"], e => {
var id = e.Packet.ReadInt();
var level = e.Packet.ReadInt();
var name = e.Packet.ReadString();
e.Packet.ReadInt();
e.Packet.ReadInt();
e.Packet.ReadInt();
e.Packet.ReadInt();
progress = e.Packet.ReadInt();
if (id == 8) Status(progress);
});
long[] ids = new long[0];
using (var wc = new System.Net.WebClient()) {
var raw = wc.DownloadString("https://gist.githubusercontent.com/scottstamp/0f15354cc90824d5d666d0c195742609/raw/b520c9e9f576714411b096399ce4ac3896b6dd6c/ids.txt");
ids = raw.Split('\n').Select(x => long.Parse(x)).ToArray();
}
while (progress < 4000) {
foreach (var id in ids.Reverse()) {
if (progress == 4000) break;
Send(Out["OpenFlatConnection"], (int)id, "", -1);
Delay(150);
Send(Out["GetHeightMap"]);
Delay(850);
count++;
if (count >= 3) {
Delay(2200);
count = 0;
}
}
}
System.Media.SystemSounds.Hand.Play();
Delay(1500);
System.Media.SystemSounds.Hand.Play();
Delay(2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment