Closed ResidentEvil91 closed 11 years ago
https://github.com/Jessecar96/SteamBotExamples/blob/master/examples/ScrapUserHandler.cs Should i try this? It seems very clear to read.
Also what code to make bot remove resent user when user says bye/thanks/ty/remove?
And where do i find what ID number item uses? IF for ex. scrap = 5000
Hello and welcome.
To check specific items you need to know their defindex. Here you can find the defindex of the items.
Now for example if you want to do something with Haunted Rump-O'-Lantern you must have something like:
if (item.Defindex == 869 && item.Quality == "Haunted")
{
do something
}
Note: i didn't try the code that's just what i'm thinking. Never worked with quality.
To interact with bot check the adminhandler
to get some ideas and see how the commands work. you can just copy and modify from there :)
I set
"BotControlClass": "SteamBot.AdminUserHandler",
And bot only says it have add command and remove command did not work.
Add/remove works like:
add 5021 5
the bot will give you 5 keys.
add metal
the bot will give you all metal
you can add/remove anything if you know the defindex. or you can specify your own type like the metal.
@ResidentEvil91 did u encounter the problem that whenever u typed add cmd, the trade window will become loading and then closed?
@hohisonfire No, but bot refuses to trade again after canceling trade and one time i said hi to the bot at the same time opening trade, it crashed the bot :P
@ResidentEvil91 damn, why I am the only one who encounters the "loading" issue. Btw, as for your purpose, it's nothing but digging hard into the code
@hohisonfire Yes :) I have got very much useful info here ^^
To check quality, you'll need to check the quality of the item the user offers, not the schema item.
In OnTradeAddItem()
the variable is inventoryItem
, and you can get the quality by doing inventoryItem.ItemQuality
, I believe. It is returned as a string number,
A unique item will have a quality of 6, so check if inventoryItem.ItemQuality == "6"
, for example. You can find a list of quality indexes if you use Google.
Just wondering, if there's any way to distinguish crates by their series number?
It's weird they all share the same defindex "5041", "5045" or "5022"
@pearhk Yep. Here's the code snippet for doing that.
var currentItem = Trade.CurrentSchema.GetItem(item.Defindex);
if (currentItem.CraftMaterialType == "supply_crate")
{
int crateNum = 0;
for (int count = 0; count < item.Attributes.Length; count++)
{
crateNum = item.Attributes[count].FloatValue;
// FloatValue will give you the crate's series number
}
Console.WriteLine("The crate's series number is #" + crateNum);
}
item
is a variable of type Inventory.Item
. In OnUserAddItem
it would be called inventoryItem.Defindex
for example.
Note that this doesn't attempt to match defindexes, but rather it checks the CraftMaterialType
of the item, since all crates will share the same property of supply_crate
.
@waylaidwanderer
Did not realize steam store the crate series number inside "attributes"
Thanks for the notes :)
P.S. Just found out that "float_value" is always 0 for all the crates, the one that makes difference is from "value", which is exactly the same as the series number
Ah, you're right. Sorry, I wrote the snippet off the top of my head and got them confused.
I found that crateNum = inventoryItem.Attributes[count].FloatValue; gave the correct series number and Value gave a really high number
Weird for me, i can only get 3 values from crate attribute property
name:set supply crate series class:supply_crate_series value:57
Did i do fetching data from the wrong source?
Turns out that i fetch the data from the wrong place, i am getting the list from item schema instead of the actual inventory list, which yields me the crate number of the current crate drop list :|
So yeah, waylaidwanderer & X33RO are right! The float_value is the right place to look at, Thanks again!
Anyone else notice that the add command seriously mucks up if you use it several times? try loading it with crates then going "add crates 3" wait for it to add "add crates 3" wait for it to add "add crates 3" and on the third one it adds 4 crates?
@X33RO i modified and used the code in AdminHandler
without problems... I've seen the bot adding 30 items or so without glitching . I just tried to replicate what you said added 24 crates 3 by 3 and added them correctly.
hmm is this something to do with the amount of crates in storage then maybe? I have 12. How many did you try it with?
I'm not sure over 20 i think
Ok, ill try this with more crates later. Bloody internet keeps cutting out :P
Can this issue be closed now? Seems resolved.
can someone put an example of this? Like if your trading partner puts a key, the bot gives him 2 ref. And if the partner puts 2.33 ref, the bots gives him a key?
Read #427 & #527.
If you want to make fast profit with this bot without any knowledge it's not a way to go. In world you get money for skills (writing bot's handler) and/or hard work (selling keys yourself). So if you don't know how to do it either learn C# or choose the hard work's way.
how would you find a steam gift id
Hello all!
I have no experience in C# or C++ but i can still understand some of it. I don't know how to add custom code, but when i know how it works, i can copy and edit it :)
I am trying to figure out: How to make bot accept specific items (Ex: Haunted Rump-O'-Lantern for 1,33ref) How to make bot sell specific items (Ex: Strange Tomislav for 0,33ref) Also interact bot with chat like i have seen done, tell bot: Add "item", bot adds item and says how much it is worth.
I think easiest way would be make Sell&buy file where you could but item information and prices.
Can someone help me or push me atleast to right direction?
/offtopic I have intended to programmer engineer school as i am very interested into programming and will know at July if i get in :)