Created
March 9, 2022 00:42
-
-
Save scottstamp/84059e93c3013078f4a5895e30d8db42 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @name BC Achievement Booster | |
/// @group Utility | |
/// @scripter 1.0.0-beta | |
var count = 0; | |
OnIntercept((In["Achievement"], In["BuildersClubFurniCount"]), e => { | |
if (count < 10) { | |
if (e.Packet.Header == In["Achievement"] && e.Packet.ReadInt() != 196) { | |
return; | |
} | |
e.Block(); | |
count++; | |
} | |
else { count = 0; } | |
}); | |
var settings = GetRoomSettings(Room.Id); | |
settings.Access = RoomAccess.Invisible; | |
SaveRoomSettings(settings); | |
var cata = GetBcCatalog(); | |
if (cata == null) { | |
Log("Error loading BC catalog"); | |
return; | |
} | |
var pg = cata.FirstOrDefault(x => x.Name == "wired_addons"); | |
var floorpage = GetBcCatalogPage(pg?.Id ?? -1); | |
if (floorpage == null) { | |
Log("Error loading BC page \"Add-ons\""); | |
return; | |
} | |
var flooritem = floorpage.Offers.FirstOrDefault(x => x.Products.Named("Pressure Plate").Count() > 0); | |
var floortile = Room.Heightmap.FirstOrDefault(x => x.IsFloor && x.IsFree); | |
var wallpage = GetBcCatalogPage(cata.FirstOrDefault(x => x.Name == "set_posters")?.Id ?? -1); | |
if (floorpage == null) { | |
Log("Error loading BC page \"Wall item\""); | |
return; | |
} | |
var wallitem = wallpage.Offers.FirstOrDefault(x => x.Products.Any(p => p.Kind == 4001 && p.Variant == "505")); | |
var wallloc = new WallLocation(-1, -1, -1, -1).ToString(); | |
if (floortile == null) { | |
Log("No open floor tiles found in this room or no room detected (try reloading room)"); | |
return; | |
} | |
RunTask(() => { | |
while (Run) { | |
Send(Out.BuildersClubPlaceRoomItem, floorpage.Id, flooritem.Id, "", floortile.X, floortile.Y, 0); | |
Delay(550); | |
} | |
}); | |
RunTask(() => { | |
while (Run) { | |
Send(Out.BuildersClubPlaceWallItem, wallpage.Id, wallitem.Id, "", wallloc); | |
Delay(550); | |
} | |
}); | |
Whisper(Self.Name, ":pickallbc"); | |
Delay(1000); | |
OnIntercept(( | |
In["CatalogIndex"], | |
In["CatalogPage"], | |
In["ItemRemove"], | |
In["ObjectRemove"], | |
In["NotificationDialog"], | |
In["RoomChatSettings"], | |
In["RoomVisualizationSettings"], | |
In["RoomInfoUpdated"], | |
In["HeightMapUpdate"], | |
In["ItemAdd"], | |
In["ObjectAdd"], | |
In["GetGuestRoomResult"]), e => e.Block()); | |
Delay(1000 * 11); | |
while (Run) { | |
Whisper(Self.Name, ":pickallbc"); | |
Delay(1000 * 12); | |
} | |
Wait(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment