public static void SetStyle(Bot bot, uint item_id, uint style) { var msg = new ClientGCMsg <MsgSetItemStyle>(); msg.Write(item_id); msg.Write(style); bot.SteamGC.Send(msg, 570); }
/// <summary> /// Permanently deletes the specified item /// </summary> /// <param name="bot">The current Bot</param> /// <param name="item">The 64-bit Item ID to delete</param> public static void DeleteItem(Bot bot, ulong item) { var deleteMsg = new ClientGCMsg <MsgDelete>(); deleteMsg.Write((ulong)item); bot.SteamGC.Send(deleteMsg, 570); }
public static void SortItems(Bot bot, byte sortType) { if (bot.CurrentGame != 440) throw new Exception("SteamBot is not ingame with AppID 440; current AppID is " + bot.CurrentGame); var setPosMsg = new ClientGCMsg<MsgSort>(); setPosMsg.Body.sortType = sortType; bot.SteamGameCoordinator.Send(setPosMsg, 440); }
/// <summary> /// Permanently deletes the specified item /// </summary> /// <param name="bot">The current Bot</param> /// <param name="item">The 64-bit Item ID to delete</param> /// <remarks> /// You must have set the current game to 440 for this to do anything. /// </remarks> public static void DeleteItem(Bot bot, ulong item) { if (bot.CurrentGame != 440) throw new Exception("SteamBot is not ingame with AppID 440; current AppID is " + bot.CurrentGame); var deleteMsg = new ClientGCMsg<MsgDelete>(); deleteMsg.Write((ulong)item); bot.SteamGameCoordinator.Send(deleteMsg, 440); }
public static void SetItemPosition(Bot bot, ulong id, uint position) { if (bot.CurrentGame != 440) throw new Exception("SteamBot is not ingame with AppID 440; current AppID is " + bot.CurrentGame); var setPosMsg = new ClientGCMsg<MsgSetItemPosition>(); setPosMsg.Body.id = id; setPosMsg.Body.position = position; bot.SteamGameCoordinator.Send(setPosMsg, 440); }
/// <summary> /// Permanently deletes the specified item /// </summary> /// <param name="bot">The current Bot</param> /// <param name="item">The 64-bit Item ID to delete</param> /// <remarks> /// You must have set the current game to 440 for this to do anything. /// </remarks> public static void DeleteItem(Bot bot, ulong item) { if (bot.CurrentGame != 440) { throw new Exception("SteamBot is not ingame with AppID 440; current AppID is " + bot.CurrentGame); } var deleteMsg = new ClientGCMsg <MsgDelete>(); deleteMsg.Write((ulong)item); bot.SteamGameCoordinator.Send(deleteMsg, 440); }
void OnGCCraftResponse(IPacketGCMsg packetMsg) { var msg = new ClientGCMsg <CMsgCraftResponse>(packetMsg); if (msg.Body.Blueprint == CMsgCraft.UnknownBlueprint) { var s = "Could not craft items successfully."; SendMessage(s); return; } SendMessage("Items were crafted."); }
public static void CraftItems(Bot bot, short recipe, params ulong[] items) { if (bot.CurrentGame != 440) throw new Exception("SteamBot is not ingame with AppID 440; current AppID is " + bot.CurrentGame); var craftMsg = new ClientGCMsg<MsgCraft>(); craftMsg.Body.NumItems = (short)items.Length; craftMsg.Body.Recipe = recipe; foreach (ulong id in items) craftMsg.Write(id); bot.SteamGameCoordinator.Send(craftMsg, 440); }
void CraftItems(List <ulong> items) { var craftMsg = new ClientGCMsg <CMsgCraft>(); craftMsg.Body.Blueprint = 0xFF; craftMsg.Body.ItemCount = (ushort)items.Count; craftMsg.Body.Items = new ulong[items.Count]; for (int i = 0; i < items.Count; ++i) { craftMsg.Body.Items[i] = items[i]; } Logger.WriteLine("Crafting {0} items", craftMsg.Body.ItemCount); SteamGC.Send(craftMsg, TF2App); }
public static void SetItemPosition(Bot bot, SteamTrade.Inventory.Item item, short position) { byte[] bPos = BitConverter.GetBytes(position); byte[] bClass = BitConverter.GetBytes(item.InventoryToken); byte[] nInv = new byte[] { bPos[0], bPos[1], bClass[2], bClass[3] }; uint newInventoryDescriptor = BitConverter.ToUInt32(nInv, 0); var aMsg = new ClientGCMsg <MsgSetItemPosition>(); aMsg.Write((long)item.Id); aMsg.Write((uint)newInventoryDescriptor); bot.SteamGC.Send(aMsg, 570); }
public static void CraftItems(Bot bot, short recipe, params ulong[] items) { if (bot.CurrentGame != 440) { throw new Exception("SteamBot is not ingame with AppID 440; current AppID is " + bot.CurrentGame); } var craftMsg = new ClientGCMsg <MsgCraft>(); craftMsg.Body.NumItems = (short)items.Length; craftMsg.Body.Recipe = recipe; foreach (ulong id in items) { craftMsg.Write(id); } bot.SteamGameCoordinator.Send(craftMsg, 440); }
/// <summary> /// Sets an item's 1-based position in the backpack /// </summary> /// <param name="bot">The current Bot</param> /// <param name="item">The 64-bit Item ID to move</param> /// <param name="position">The 1-based integer position of the item</param> /// <remarks> /// You must have set the current game to 440 for this to do anything. /// </remarks> public static void SetItemPosition(Bot bot, SteamTrade.Inventory.Item item, short position) { if (bot.CurrentGame != 440) { throw new Exception("SteamBot is not ingame with AppID 440; current AppID is " + bot.CurrentGame); } byte[] bPos = BitConverter.GetBytes(position); byte[] bClass = BitConverter.GetBytes(item.ClassesEquipped); byte[] nInv = new byte[] { bPos[0], bPos[1], bClass[0], bClass[1] }; uint newInventoryDescriptor = BitConverter.ToUInt32(nInv, 0); var aMsg = new ClientGCMsg <MsgSetItemPosition>(); aMsg.Write((long)item.Id); aMsg.Write((uint)newInventoryDescriptor); bot.SteamGameCoordinator.Send(aMsg, 440); }
void HandlePaintCommand(string msg, SteamID sender) { UpdateBackpack(); string[] args = msg.Split(' '); if (args.Length != 2) { SteamFriends.SendChatMessage(sender, EChatEntryType.ChatMsg, "Invalid arguments."); return; } var items = new List <ulong>(); foreach (var arg in msg.Split(' ')) { ulong item; if (!ulong.TryParse(arg, out item)) { continue; } items.Add(item); } if (items.Count != 2) { SteamFriends.SendChatMessage(sender, EChatEntryType.ChatMsg, "Invalid arguments."); return; } var paintMsg = new ClientGCMsg <CMsgPaint>(); paintMsg.Body.ItemId = items[0]; paintMsg.Body.PaintId = items[1]; SteamGC.Send(paintMsg, TF2App); }
static void doCraft() { Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine(); log("Excluding special items, none of the following items will be crafted:"); foreach (MsgTF.CSOEconItem item in inventory) { SchemaItem si = schema.get((int)item.def_index); if (si != null) { bool failed = false; if (item.quality != 6) { if (!failed) { Console.WriteLine("\n#" + item.id + " (" + si.name + "):"); si.addUncraftable(); failed = true; } Console.WriteLine("\tquality(" + getQualityName(item.quality) + ")"); } if (item.def_index == 474) { if (!failed) { Console.WriteLine("\n#" + item.id + " (" + si.name + "):"); si.addUncraftable(); failed = true; } Console.WriteLine("\tblackslist(sign)"); } foreach (var a in item.attribute) { if (!failed) { Console.WriteLine("\n#" + item.id + " (" + si.name + "):"); si.addUncraftable(); failed = true; } Console.WriteLine("\tattr(" + schema.getAttr((int)a.def_index) + ")"); } if (item.origin != 0) { if (!failed) { Console.WriteLine("\n#" + item.id + " (" + si.name + "):"); si.addUncraftable(); failed = true; } Console.WriteLine("\torigin(" + getOriginName(item.origin) + ")"); Console.ForegroundColor = ConsoleColor.Red; if (item.origin == 1) { Console.WriteLine("\tNOTE: ITEM NOT TRADABLE."); } else if (item.origin == 2) { Console.WriteLine("\tNOTE: ITEM NOT CRAFTABLE."); } Console.ForegroundColor = ConsoleColor.Gray; } if (!failed) { si.addCraftable(item.id); } } } Console.WriteLine(); log("Listing craftables, the following items will be crafted:"); Console.WriteLine(); var craftables = schema.getAllCraftables(); for (int i = 0; i < 10; i++) { Console.WriteLine(getClassName(i) + ":"); var itemset = craftables[i]; foreach (SchemaItem item in itemset) { Console.WriteLine("\t" + item.getCraftableCount() + " X " + item.name); } if (itemset.Count == 0) { Console.WriteLine("\tNone"); } } Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine(); Console.WriteLine("Ready to craft. Please confirm that you want to craft these items. Make sure"); Console.WriteLine("your valuable items are in the exclude section, or that their types are not"); Console.WriteLine("listed in the crafting section. I have tried to filter out your valuable items,"); Console.WriteLine("but I will take no responsibility for lost items."); Console.WriteLine(); Console.WriteLine("Blastfurnace has not been tested against:"); Console.WriteLine("\t- Australium weapons"); Console.WriteLine("\t- Killstreak weapons"); Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("I WILL TAKE NO RESPONSIBILITY FOR LOST ITEMS."); Console.WriteLine("ARE YOU SURE YOU WANT TO CRAFT THE ABOVE ITEMS?"); confirm(); Console.ForegroundColor = ConsoleColor.Magenta; Console.WriteLine(); Console.WriteLine("CRAFTING!"); Console.WriteLine(); for (int i = 1; i < 10; i++) { var itemset = craftables[i]; while (true) { string type1 = null; ulong id1 = 0; foreach (SchemaItem item in itemset) { if (item.getCraftableCount() != 0) { id1 = item.popCraftable(); type1 = item.name; break; } } if (type1 == null) { break; } string type2 = null; ulong id2 = 0; foreach (SchemaItem item in itemset) { if (item.getCraftableCount() != 0) { id2 = item.popCraftable(); type2 = item.name; break; } } if (type2 == null) { break; } Console.WriteLine("CRAFT:"); Console.WriteLine("\t+" + type1 + "#" + id1); Console.WriteLine("\t+" + type2 + "#" + id2); ClientGCMsg <GCMsgCraftItem> msg = new ClientGCMsg <GCMsgCraftItem>(); msg.Body.recipe = 3; msg.Body.items.Add(id1); msg.Body.items.Add(id2); if (!gc.sendMsg(msg, false)) { Console.WriteLine("\tFailed to send craft msg!"); } Thread.Sleep(1000); } } Console.WriteLine("Done."); Console.ReadKey(); }
void CraftItems(List<ulong> items) { var craftMsg = new ClientGCMsg<CMsgCraft>(); craftMsg.Body.Blueprint = 0xFF; craftMsg.Body.ItemCount = (ushort)items.Count; craftMsg.Body.Items = new ulong[items.Count]; for (int i = 0; i < items.Count; ++i) craftMsg.Body.Items[i] = items[i]; Logger.WriteLine("Crafting {0} items", craftMsg.Body.ItemCount); SteamGC.Send(craftMsg, TF2App); }
void OnGCCraftResponse(IPacketGCMsg packetMsg) { var msg = new ClientGCMsg<CMsgCraftResponse>(packetMsg); if (msg.Body.Blueprint == CMsgCraft.UnknownBlueprint) { var s = "Could not craft items successfully."; SendMessage(s); return; } SendMessage("Items were crafted."); }