Jessecar96 / SteamBot

Automated bot software for interacting with Steam Trade
http://scrap.tf
MIT License
1.34k stars 910 forks source link

Some errors while running on Linux #214

Closed the-sharp-shooter closed 11 years ago

the-sharp-shooter commented 11 years ago

So I got SteamBot working perfectly well on a Lubuntu Virtual Machine (w/ gui) with "mono SteamBot.exe". So I procedded to get it working on a Debian VPS where I tried to "sudo apt-get install mono-complete". I can run "mono SteamBot.exe" but I get the errors:

WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v1.1.4322

** (SteamBot.exe:8616): WARNING **: The class System.ConsoleColor could not be loaded, used in mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

Unhandled Exception: System.TypeLoadException: A type load exception has occurred.

Not sure what to do now, I couldn't come with anything really usefull about this from googling and maybe you can give me a little help here. I can change the Distro to either CentOS or Ubuntu, if that matters

Thanks

waylaidwanderer commented 11 years ago

Compile the latest mono from source. The ones that come with ubuntu and debian repos are outdated.

the-sharp-shooter commented 11 years ago

Compiled mono 3.0.7 sucessfully after a few hours of scrolling checks and stuff... Now it starts just fine, at the first tries it asked for the SteamGuard code which I was able to insert but failed to authenticate after that, it always asked for the SteamGuard code, every time and not just the first. Now I restarted the VPS and don't even get the SteamGuard check anymore. The settings.json are copy/pasted from where it worked so there are no typos. What else can be causing this ?

bug-bot

waylaidwanderer commented 11 years ago

Urgh, I remember that error. I was never able to figure out what caused it either... Hopefully someone else will chime in.

Sharp notifications@github.com wrote:

Compiled mono 3.0.7 sucessfully after a few hours of scrolling checks and stuff... Now it starts just fine, at the first tries it asked for the SteamGuard code which I was able to insert but failed to authenticate after that, now I don't even get the SteamGuard check. What can be causing this ?

bug-bot


Reply to this email directly or view it on GitHub: https://github.com/Jessecar96/SteamBot/issues/214#issuecomment-15365623

teliosdev commented 11 years ago

Why not check the response for the authentication data, see what's causing it to fuck up?

the-sharp-shooter commented 11 years ago

I don't understand what I'm suposed to do to "check the response for the authentication data". Maybe you could guide me through that, please.

My log is:

[[BOT] 2013-03-24 23:06:49] DEBUG: Initializing Steam Bot...
[[BOT] 2013-03-24 23:06:49] INFO: Connecting...
[[BOT] 2013-03-24 23:06:49] SUCCESS: Done Loading Bot!
[[BOT] 2013-03-24 23:06:51] DEBUG: SteamKit2.SteamClient+ConnectedCallback
[[BOT] 2013-03-24 23:06:51] DEBUG: Connection Callback: OK
[[BOT] 2013-03-24 23:06:52] DEBUG: SteamKit2.SteamUser+LoggedOnCallback
[[BOT] 2013-03-24 23:06:52] DEBUG: Logged On Callback: AccountLogonDenied
[[BOT] 2013-03-24 23:06:52] ERROR: Login Error: AccountLogonDenied
[[BOT] 2013-03-24 23:06:52] INTERFACE: This account is protected by Steam Guard.  Enter the authentication code sent to the proper email: 
[[BOT] 2013-03-24 23:07:12] DEBUG: SteamKit2.SteamClient+DisconnectedCallback
[[BOT] 2013-03-24 23:07:12] WARN: Disconnected from Steam Network!
[[BOT] 2013-03-24 23:07:13] DEBUG: SteamKit2.SteamClient+ConnectedCallback
[[BOT] 2013-03-24 23:07:13] DEBUG: Connection Callback: OK
[[BOT] 2013-03-24 23:07:16] DEBUG: SteamKit2.SteamUser+LoginKeyCallback
[[BOT] 2013-03-24 23:07:18] WARN: Authentication failed, retrying in 2s...
[[BOT] 2013-03-24 23:07:20] WARN: Authentication failed, retrying in 2s...
[[BOT] 2013-03-24 23:07:22] WARN: Authentication failed, retrying in 2s...
waylaidwanderer commented 11 years ago

Basically go to the authentication function, and at the part just after the response is sent, type "Console.WriteLine(response)" or whatever the variable is.

Sharp notifications@github.com wrote:

I don't understang what I'm suposed to do to "check the response for the authentication data". Maybe you could guide me through that, please.

My log is: [[BOT] 2013-03-24 23:06:49] DEBUG: Initializing Steam Bot... [[BOT] 2013-03-24 23:06:49] INFO: Connecting... [[BOT] 2013-03-24 23:06:49] SUCCESS: Done Loading Bot! [[BOT] 2013-03-24 23:06:51] DEBUG: SteamKit2.SteamClient+ConnectedCallback [[BOT] 2013-03-24 23:06:51] DEBUG: Connection Callback: OK [[BOT] 2013-03-24 23:06:52] DEBUG: SteamKit2.SteamUser+LoggedOnCallback [[BOT] 2013-03-24 23:06:52] DEBUG: Logged On Callback: AccountLogonDenied [[BOT] 2013-03-24 23:06:52] ERROR: Login Error: AccountLogonDenied [[BOT] 2013-03-24 23:06:52] INTERFACE: This account is protected by Steam Guard. Enter the authentication code sent to the proper email: [[BOT] 2013-03-24 23:07:12] DEBUG: SteamKit2.SteamClient+DisconnectedCallback [[BOT] 2013-03-24 23:07:12] WARN: Disconnected from Steam Network! [[BOT] 2013-03-24 23:07:13] DEBUG: SteamKit2.SteamClient+ConnectedCallback [[BOT] 2013-03-24 23:07:13] DEBUG: Connection Callback: OK [[BOT] 2013-03-24 23:07:16] DEBUG: SteamKit2.SteamUser+LoginKeyCallback [[BOT] 2013-03-24 23:07:18] WARN: Authentication failed, retrying in 2s... [[BOT] 2013-03-24 23:07:20] WARN: Authentication failed, retrying in 2s... [[BOT] 2013-03-24 23:07:22] WARN: Authentication failed, retrying in 2s...


Reply to this email directly or view it on GitHub: https://github.com/Jessecar96/SteamBot/issues/214#issuecomment-15366288

the-sharp-shooter commented 11 years ago

I found "log.Warn ("Authentication failed, retrying in 2s...");" under "void HandleSteamMessage (CallbackMsg msg)" in SteamBot\Bot.cs. Where exacly am I suposed to add "Console.WriteLine(response)" ?

waylaidwanderer commented 11 years ago

SteamTrade project, in SteamWeb.cs

Sharp notifications@github.com wrote:

I found "log.Warn ("Authentication failed, retrying in 2s...");" under "void HandleSteamMessage (CallbackMsg msg)" in SteamBot\Bot.cs. Where exacly am I suposed to add "Console.WriteLine(response)" ?


Reply to this email directly or view it on GitHub: https://github.com/Jessecar96/SteamBot/issues/214#issuecomment-15366912

the-sharp-shooter commented 11 years ago

I've tried to put the line in several places in SteamWeb.cs until it compiled without errors. When I tried it the bot actually started and came online but had the "not online" bug when trying to trade. Now it fails to authenticate when starting again, either with the sabe Debug or Release build... thats weird...

Sorry for being such a newbie but it would be easier to know exactly in which line to add "Console.WriteLine(response)"

waylaidwanderer commented 11 years ago

Actually upon looking at the function it's not as straightforward...

However, I'm pretty sure this is where things are getting screwed up:

    try
    {
        authResult = userAuth.AuthenticateUser (
            steamid: client.SteamID.ConvertToUInt64 (),
            sessionkey: HttpUtility.UrlEncode (cryptedSessionKey),
            encrypted_loginkey: HttpUtility.UrlEncode (cryptedLoginKey),
            method: "POST"
            );
    }
    catch (Exception)
    {
        token = null;
        return false;
    }

Something is going wrong and the token is returning null. I had the same issue; see https://github.com/Jessecar96/SteamBot/issues/191

Try changing

    catch (Exception)
    {
        token = null;
        return false;
    }

to

    catch (Exception ex)
    {
        Console.WriteLine(ex);
        token = null;
        return false;
    }

so that we can see what the error is.

the-sharp-shooter commented 11 years ago

Thanks. here we go...

bot2

I have absolutely no clue what those errors mean, so please help me out :$

the-sharp-shooter commented 11 years ago

I made a debug build with Xamarin that actually logs in sucessfully but just sometimes... if that matters.

elipsitz commented 11 years ago

Having this problem too, unfortunately.

the-sharp-shooter commented 11 years ago

Can anyone give us a help here ?

the-sharp-shooter commented 11 years ago

No mercy for Linux :(

waylaidwanderer commented 11 years ago

I just bought a new VPS (running Debian 6) yesterday. Compiled latest mono from source (3.0.10) and it worked fine. No authentication errors.

Try getting the latest SteamBot build off of this repo, and also update mono just in case.

cwhelchel commented 11 years ago

@waylaidwanderer Could you write what you've done up for linux in a wiki page? I would but I haven't had the time to setup a Linux VM.

waylaidwanderer commented 11 years ago

@cwhelchel I'll do it tomorrow, when I have time. The thing about linux installs is that there are sometimes different methods/steps you have to take, so atm I can only really write a guide for Debian/Ubuntu since they are similar.

cwhelchel commented 11 years ago

@waylaidwanderer Thanks. Anything is better than nothing.

waylaidwanderer commented 11 years ago

@cwhelchel Just finished writing it. You can find it in the wiki page here.

cwhelchel commented 11 years ago

@waylaidwanderer Looks great. Linked it from the wiki "home" page. I'm gonna try running your shell script on my Ubuntu VM and see how it goes.

Does your guide assume that you built SteamBot.exe in windows? I'll look into setting up MonoDevelop on my VM to build. I only bring this up b/c the guide doesn't mention building SteamBot in Linux.

waylaidwanderer commented 11 years ago

@cwhelchel The guide assumes SteamBot.exe already exists, yeah. Building SteamBot on Linux is easy though - you just need to install Monodevelop or Xamarin first. If you'd like, I can add a section on that too.

the-sharp-shooter commented 11 years ago

Thanks again. I will reinstall the VPS totally and rebuild SteamBot from the latest version.

oojava commented 11 years ago

I would like to see that section as I found it difficult to get it working.

On Mon, Apr 15, 2013 at 11:56 AM, Sharp notifications@github.com wrote:

Thanks again. I will reinstall the VPS totally and rebuild SteamBot from the latest version.

— Reply to this email directly or view it on GitHubhttps://github.com/Jessecar96/SteamBot/issues/214#issuecomment-16404534 .

waylaidwanderer commented 11 years ago

Click on the wiki tab near the top.

oopython notifications@github.com wrote:

I would like to see that section as I found it difficult to get it working.

On Mon, Apr 15, 2013 at 11:56 AM, Sharp notifications@github.com wrote:

Thanks again. I will reinstall the VPS totally and rebuild SteamBot from the latest version.

— Reply to this email directly or view it on GitHubhttps://github.com/Jessecar96/SteamBot/issues/214#issuecomment-16404534 .


Reply to this email directly or view it on GitHub: https://github.com/Jessecar96/SteamBot/issues/214#issuecomment-16408334

waylaidwanderer commented 11 years ago

@the-sharp-shooter Can this be closed now?

ysmael85 commented 11 years ago

After hours trying to set up the bot i get this any help? captura

iMagooo commented 11 years ago

Read the Wiki/Readme.