Code Monkey home page Code Monkey logo

steambot's People

Contributors

94m3k1n9 avatar blueraja avatar bottswana avatar cwhelchel avatar fjch1997 avatar gabrielmtzcarrillo avatar gamemaster1494 avatar geel9 avatar greggameplayer avatar igeligel avatar jessecar96 avatar kazhuravlev avatar kilpkonn avatar lagg avatar laggingpyro avatar lazy1 avatar madbender avatar mates1500 avatar noobgam avatar paulo-santana avatar philipp15b avatar scholtzm avatar sephirothsg avatar spideyfusion avatar stormreaper avatar teliosdev avatar thesandvichisaliar avatar waylaidwanderer avatar wildcard65 avatar yogurtfp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

steambot's Issues

Add Versioning

What do you guys think, should we add versioning to the SteamBot?

Instructions aren't correct

I am trying to follow the directions in the readme and have made it to
You mainly only need to edit the file TradeEnterTradeListener.cs, as it contains events for everything you need.

This file doesn't exist. Could the readme get updated to reflect what I should be doing?

Is the usage section accurate or has that changed as well? Unless my search-fu has broken, I can't seem to find the indicated functions in the code.

Canceled trades don't stop polling

When a trade is cancelled due to a timeout, it keeps getting polled. Therefore, the OnTimeout() function executes every 800 ms, causing the user who was trading with the bot to be spammed with "Sorry, but you were AFK and the trade was canceled." until the bot is shut down.

Can anyone duplicate this problem? I'm kind of new to C# (as in I started using it today), but I think that CurrentTrade should be set to null in the CancelTrade() function.

Thank you.

Improve Documentation

We need to improve the documentation readily available for people who want to use the SteamBot, especially for the TradeEnterTradeListener class.

Support for multiple item schemas

I was interested in using the bot for Dota 2 item trading. But, I assume the item details are different between the two games, and it is causing the bot to crash when a non-TF2 item is added to the trade window.

The errors given are:

ERROR: Error Polling Trade: System.NullReferenceException: Object reference not set to an instance of an object.
at .......\Trade.cs:line 541
at SteamBot.Bot.<.ctor>b__2() in c:\..........\Bot.cs:line 132

Logged on callback: invalidPassword

Opened up steambot.sln and ran the build, when I try to debug it however I get:

Launching bot 0
Connection Callback: OK
Logged on callback: invalidPassword
Login Failure: invalidPassword

to which the last 3 lines continue to repeat ad infinitum. And this is before I enter in any details or get any prompts. It seems to be coming from SteamKit2.SteamClient

When a trade is canceled, CancelTradeWebCmd fails

When canceling a trade, CancelTradeWebCmd returns false.

This leads to an infinite loop with this stack trace appearing in the console:

[Man in a Yellow Hat 06/11/2012 01:00:32] ERROR: Error Polling Trade:     SteamTrade.Exceptions.TradeException: The Web command to cancel the trade failed
   at SteamTrade.Trade.CancelTrade() in C:\Users\George\SteamBot\SteamTrade\Trade.cs:line 271
   at SteamTrade.Trade.Poll() in C:\Users\George\SteamBot\SteamTrade\Trade.cs:line 468
   at SteamBot.Bot.<.ctor>b__1() in C:\Users\George\SteamBot\SteamBot\Bot.cs:line 133

Not Recognizing Client Cancellation of Trade

When a player trading with the bot cancels the trade on their own, the bot doesn't seem to know this. It will send them a message when the AFK timer would have run out informing them that the trade was cancelled because they were AFK.

Disallow Overriding a Trade Session and Trade End Detection

Currently when the bot is in a trade and another user wants to trade with the bot, the current trade is overriden and the new one is used.

This has also to do with trade end detection as the bot is currently unable to stop polling a timed out or finished trade.

bot add friend with sql query

hello,

I'm having a little problem to cause the bot to add a friend.
I did a routine in Program.cs to consult the database, and if there vefificar a field with value '0 '.
find the value, adds the friend by your steam id or by e-mail.

I tried several ways but could not make it work.

perhaps erring on the class in which I am doing Bot.SteamFriend.addFreind ();

I'm adding in SimpleUserHandler.cs

Thanks, and sorry for anything

SteamKit2 inaccessible

Trying to compile the ExampleBot, I get the following error.

Error 5 'SteamKit2.WebHelpers' is inaccessible due to its protection level C:\Users\rannmann\Documents\GitHub\SteamBot\SteamBot\Bot.cs 351 25 ExampleBot

The line:

 sessionId = WebHelpers.EncodeBase64(callback.UniqueID.ToString());

I live in the web developer world and haven't really touched compiled languages since my college days, so it could be PEBKAC. Any information would be appreciated!

Purge friend list

Hello. Few weeks ago I add method to SteamKit (SteamFriends.cs) in order to remove all friends when bot log in.

public void RemoveAllFriends()
{
    var removeFriend = new ClientMsgProtobuf<CMsgClientRemoveFriend>( EMsg.ClientRemoveFriend );
    foreach (SteamID id in friendList)
    {
        removeFriend.Body.friendid = id;
        this.Client.Send( removeFriend );
    }
}

Then I called at the end of Authenticate() in Bot.cs. It worked. Since then, there were made some changes and it is not working anymore. Anyone have an idea where I could put it in order to purge friend list?

Better Logging

The bot should have better logging:

  • Prefix before each log message in the console with the bot name when using multiple bots
  • Log levels, such as error, trace and warn
  • Log to files
  • Maybe even send critical messages to admins if they are online?
  • Consistent logging; currently some things are logged and some are not

Bot crashes if trade cancelled right after it started.

Bot crashes if trade with bot is initiated and canceled before the bot can send welcome message.

The error log:

Unhandled Exception: SteamTrade.Exceptions.TradeException: The web command to send the trade message failed.
   at SteamTrade.Trade.SendMessage(String msg) in D:\dev\sb\SteamBot\SteamTrade\Trade.cs:line 426
   at SteamBot.AdminUserHandler.OnTradeInit() in D:\dev\sb\SteamBot\SteamBot\AdminUserHandler.cs:line 85
   at SteamBot.Bot.OpenTrade(SteamID other) in D:\dev\sb\SteamBot\SteamBot\Bot.cs:line 170
   at SteamBot.Bot.<HandleSteamMessage>b__b(SessionStartCallback callback) in D:\dev\sb\SteamBot\SteamBot\Bot.cs:line 305
   at SteamKit2.CallbackMsg.Handle[T](Action`1 handler) in D:\dev\sb\SteamBot\Lib\SteamKit2\SteamKit2\Steam3\SteamClient\CallbackMgr\CallbackMsg.cs:line 72
   at SteamBot.Bot.HandleSteamMessage(CallbackMsg msg) in D:\dev\sb\SteamBot\SteamBot\Bot.cs:line 303
   at SteamBot.Bot.<.ctor>b__1() in D:\dev\sb\SteamBot\SteamBot\Bot.cs:line 119
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

AddItemByDefindex not working correctly

If you try and add multiple items of the same defindex to the trade, it simply adds one and moves it around to subsequently requested slots instead of actually adding more than one item.

For example (5000 = scrap metal):

trade.AddItemByDefindex(5000, 0);
trade.AddItemByDefindex(5000, 1);

This code would result in a single scrap metal being added in slot 0, and then being moved to slot 1.

Thank you.

Private Backpacks

I see that the bot does a check to see if the user it is trading with has a private backpack. Is this needed? Can my custom class skip that step? I'm curious why it needs to see it when the items are presented to it in the trade.

Crafting

Is crafting a planned feature? I'm pretty sure it's possible, and it would make a great feature to make bots able to craft. Maybe start off with combining/smelting metal, since that's a pretty basic and predictable recipe.

I can't be of much help myself in this situation, as I have no experience with SteamKit.

Saving SteamGuard Authentication not working properly (Linux)

I have applied the latest Commit for the Bot.cs to save the SteamGuard Machine Code in Visual Studio 2010 and after compiling it, it's working just fine (creates a sentryfile and doesn't prompt again for the Auth-Code).

However, trying to port it onto Debian Squeez (with Mono 2.10.8.1 compiled from Sources) fails, as it's prompting again for the Auth Code everytime I start the Program.

Oddly enough, the sentryfile is getting created, but somehow everytime when I lauch the Program, a new Auth Code is generated and the existing one ignored.

Is this a known Issue on Linux and was somebody able to get it working there? (without prompting for the Code everytime)

Trading not working (latest clone)

MySteamId is null when FetchInventories() is called.

// Trade.cs line 88
public readonly SteamID MySteamId;

// constructor:
public Trade (SteamID me, SteamID other, string sessionId, string token, string apiKey, int maxTradeTime, int maxGapTime)
        {
            mySteamId = me;

what is the deal here?

Assigning MySteamId (note case) solves this for me, though. I'd post a patch or whatsit, but i'm not familiar with all those sort of tools yet.

Adding Items of Same Kind

When you input this:

 trade.AddItemByDefindex(4100,0);
 // here optional pause for ~1 sec eg. with Thread
 trade.AddItemByDefindex(4100,1);

To any event, it will move the same item from slot 0 to slot 1, instead of adding new item of same type to slot 1.

IO exception when multiple bots have the same log file name.

Found this out the hard way by copy-pasting configuration items in settings.json where logFile was the same value for each bot.

Also steam guard was on for the bot accounts and it was prompting for the code when this happened but I'm not sure if that's related.

Bot Times out On Steam Trade

I've received reports that the SteamBot times out when traded (everything up until then works perfectly fine). When you trade it, it gives the OnAfterInit message, but after that (no matter what you do as a client), it times out. I think it might have to do with it not polling correctly, but I haven't been able to test that.

This issue is in the source code up until c5bd85b, and I'm sure after that commit, as well.

Split Off Trading Into a Library

All the trading and SteamWeb stuff shouldn't be in the Bot repository. Trading should be a dedicated library (or maybe commit to SteamKit?).

Change TradeSystem to Trade

It would be much easier to read and maintain if a Trade was completely seperated from the "TradeSystem", so that you would have a Trade that you can interact with and a TradeSystem that handles all those events.

Keep Track of Occupied Slots In Trade

In order to effectively use AddItem, AddItemByDefindex, RemoveItem, and RemoveItemByDefindex, we should add a list of the slots items are occupying in the trade.

settings.json

instead of using settings.json.. is it possible to start the exe with parameters such as login name and password and classname.. so you can set batch file for different logins/ behaviour?

Errors while trading

Hi guys, nice work with bot, i making it for dota 2 trades, but i got some errors:

ERROR: Error Polling Trade: System.NullReferenceException - SteamBot.Bot.<.ctor>b__1() in SteamBot\SteamBot\Bot.cs:line 135

ERROR: Error Polling Trade: SteamTrade.Exceptions.TradeException: The web command to set trade ready state failed.
SteamTrade.Trade.SetReady(Boolean ready)  - SteamBot\SteamTrade\Trade.cs:line 374
SteamBot.SimpleUserHandler.OnTradeReady(Boolean ready)  - SteamBot\SteamBot\SimpleUserHandler.cs:line 69
SteamTrade.Trade.Poll() - SteamBot\SteamTrade\Trade.cs:line 496

I cannot fix it, haven't looked all your code yet. Sometimes trades goes succesfully without any errors, but sometimes i got this errors.

Error validating local copy of items In the trade

I use this method to add all the bot's weapons to a trade.

public int DumpWeapons()
{
    int count = 0;
    foreach (Inventory.Item invItem in Trade.MyInventory.Items)
    {
        Schema.Item schemaItem = Trade.CurrentSchema.GetItem(invItem.Defindex);
        if (schemaItem.CraftMaterialType == "weapon")
        {
            Trade.AddItem(invItem.Id);
            count++;
        }
    }
    return count;
}

Whenever this is executed, the bot throws this error (in Visual Studio's debug mode):

[SteamBot 2012-11-10 14:02:54] ERROR: Error Polling Trade: System.Exception: Error validating local copy of items in the trade!
   at SteamTrade.Trade.ValidateLocalTradeItems() in [redacted]\SteamBot\SteamTrade\Trade.cs:line 661
   at SteamTrade.Trade.Poll() in [redacted]\SteamBot\SteamTrade\Trade.cs:line 467
   at SteamBot.Bot.<>c__DisplayClass4.<.ctor>b__1() in [redacted]\SteamBot\SteamBot\Bot.cs:line 135

This also seems to happen when a user adds items the the trade quickly.
I think this may be caused when items are added faster than the trade polling interval, but I'm not sure.

AFK Cancel Failure

When idle time reaches the limit, the bot sends the appropriate message

Sorry, but you were AFK and the trade was canceled.

However, the trade is never actually cancelled. Because of this, the message is sent repeatedly until the user closes his/her trade session.

Friends List Overflow

The bot might eventually end up with too many friends on its friend list; we should probably prevent that from happening by removing friends.

Rafflebot

Are you going to fix the raffle bot to working status like the current bot? I could write the front end for you in ajax + j query with steam log in and user dashboard if your willing to fix it.

Steam Trade AddItem Not working properly

I am using an array to grab chosen item ids by the other user from my backpack and then using the array to represent the "itemid" variable in Trade.AddItem. I noticed it was a bool so I also tested it in a if statement with it sending a message over trade when the bool returns true.

Please excuse my noobyness to C# in general and GitHub Markdown, but this is an example of my code:

if (message == "1")
{
//I have some other stuff in here cant remember at the moment, i'm at school.
if (Trade.AddItem(hatidchoices[1]))
{
Trade.SendMessage("I shouldve added my item.");
}
}

And at first I had:

if (message == "1")
{
//I have some other stuff in here cant remember at the moment, i'm at school.
Trade.AddItem(hatidchoices[1]);
Trade.SendMessage("I shouldve added my item.");
ItemsIHaveAdded++;
}

I logs nothing pertaining to the adding of the item, but does send the string "i shouldve added my..." in trade chat. Before this if statement is a foreach statement that helps my grab my inventory and add the craft hat ids to this array "hatidchoices". It also lists the items to the other user with a number associated to it(the location of the id in the array) so the user can choose the hat they want.

So, it gives no error, adds no item, but runs through the command anyways. Is there something i'm doing wrong? Thanks.

SteamGuard is required for trades

Since 12/12/2012 Steam Trade system will not work on accounts with disabled SteamGuard. Is any possibility to store once entered and linked SteamGuard confirmation code?

Bot.OpenTrade() Issue

On line 170 - GetUserHandler (other).OnTradeInit ();
This line should be removed because sometimes it runs before trade is actually setup and may add some errors (for example message from SimpleUserHandler throws error). Also at previous line there are already subscription for this event.

Btw Bot.OpenTrade() don't works for me at all even after this fix, just doing nothing and throwing AFK error after 2-3 minutes. An second issue caused by such fail:

Bot try to send "Cancel Trade" request because of "AFK", but the trade wasn't actually started and this throws error. You should add some checks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.