-2

I have checked the source for SteamBot but I don't seem to understand it very well due to that I am a new coder. If someone could help me, it would be great! Thanks in advance.

I found a way on SteamBot (https://github.com/Jessecar96/SteamBot/blob/master/SteamTrade/TradeOffer/OfferSession.cs#L30)

But I don't seem to understand it.

Heres something that could help (https://www.reddit.com/r/SteamBot/comments/3a6rp6/who_to_accept_traiding_offers_with_c_steam/.compact)

John Doe
  • 399
  • 1
  • 4
  • 23
  • what exactly do you need help with? – Daemedeor Oct 20 '15 at 00:30
  • @Daemedeor accepting a steam offer using SteamKit2 or in any other possible way. in C# – John Doe Oct 20 '15 at 00:33
  • this package: https://github.com/SteamRE/SteamKit? – Daemedeor Oct 20 '15 at 00:35
  • @Daemedeor yes. But I think that one cant do that. So i need a way to accept them.. SteamBot on github has a way but I dont understand it. – John Doe Oct 20 '15 at 00:37
  • could you update your description to include this information and specifically which piece of the code, so anyone coming here doesn't have to scan the comments – Daemedeor Oct 20 '15 at 00:39
  • "I don't understand it" is functionally equivalent to "It doesn't work." **What** don't you understand? In **what** code? – BradleyDotNET Oct 20 '15 at 00:40
  • I'm a newbie coder to C# @BradleyDotNET. I updated the description – John Doe Oct 20 '15 at 00:42
  • @TheNewGuy I understand that. Newness is not an excuse for not providing enough information for us to answer. If something is broken, you need to include the error (and the code to reproduce). If you don't understand a code snippet, you need to specify what you don't understand about it and the snippet itself (which you still have not done). Saying "I don't understand it" is just going to get a "You don't understand **what**?" comment and downvotes until you are more specific. – BradleyDotNET Oct 20 '15 at 00:45

1 Answers1

1

In your code you want reference the class

//at the top of the file
using SteamTrade.TradeOffer;

//the later on in the file
Offersession newSteamSession = new OfferSession('yourApiKey', 'steamweb');

string convertedStringtradeId = String.Empty;
var isAccepted = newSteamSession.Accept(tradeOfferId, convertedStringtradeId);

if(isAccepted) 
{
    //do more logic here if the offer was good
    //you can use the convertedStringtradeId if you need something


}else
{
  //what happens when things go wrong
}
Daemedeor
  • 1,013
  • 10
  • 22
  • How will it know which api key to use? – John Doe Oct 20 '15 at 00:47
  • @TheNewGuy see the update... – Daemedeor Oct 20 '15 at 00:47
  • Offersession newSteamSession = new OfferSession('yourApiKey', 'steamweb'); argument 1 & 2 = error (not supposted to be strings?) – John Doe Oct 20 '15 at 00:58
  • Im going to try this: webApi = new TradeOfferWebAPI(apiKey, steamWeb); 22 session = new OfferSession(webApi, steamWeb); – John Doe Oct 20 '15 at 00:59
  • well if you copy my code directly of course not ... you'll have to actually give the apikey which is provided by steam and the steamWeb object... which i'm not quite sure where its coming from – Daemedeor Oct 20 '15 at 01:00
  • What should I put here: var isAccepted = newSteamSession.Accept(tradeOfferId, HERE); – John Doe Oct 20 '15 at 01:07
  • @TheNewGuy a string that you want to be a representation of the tradeID like how i have my code – Daemedeor Oct 20 '15 at 01:15
  • Ok so I tried and it said this: (403) Forbidden. – John Doe Oct 20 '15 at 01:17
  • that makes sense if you copied straight and your apikey is incorrect.... unfortunately, i can't help you at that level because its a permissions thing (hence the forbidden) you'll need to find out what's up with the TradeOfferWebApi object itself, best by debugging – Daemedeor Oct 20 '15 at 01:26
  • Isnt there any other way to do it? :( – John Doe Oct 20 '15 at 01:31
  • @TheNewGuy are you really sure you want to be a developer or start out at this level? I can't give you an api key for steam all you need to do is request one from them and then fill it in instead of "" i mean we all start somewhere but instead of starting at this level, maybe start on smaller projects? – Daemedeor Oct 20 '15 at 01:34
  • I got the api key im just not gona show it public.. and I kinda understand how this goes.. Im just not good with the http requests or whatever they are. – John Doe Oct 20 '15 at 01:36