Created
March 20, 2013 09:20
-
-
Save waylaidwanderer/5203387 to your computer and use it in GitHub Desktop.
This bot does nothing except for: accept your trade request, click ready when you do, and accept the trade when you do.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using SteamKit2; | |
using System.Collections.Generic; | |
using SteamTrade; | |
namespace SteamBot | |
{ | |
public class ReallySimpleUserHandler : UserHandler | |
{ | |
public SimpleUserHandler (Bot bot, SteamID sid) : base(bot, sid) {} | |
public override bool OnFriendAdd () | |
{ | |
return true; | |
} | |
public override void OnFriendRemove () {} | |
public override void OnMessage (string message, EChatEntryType type) | |
{ | |
Bot.SteamFriends.SendChatMessage(OtherSID, type, Bot.ChatResponse); | |
} | |
public override bool OnTradeRequest() | |
{ | |
return true; | |
} | |
public override void OnTradeError (string error) | |
{ | |
Bot.SteamFriends.SendChatMessage (OtherSID, | |
EChatEntryType.ChatMsg, | |
"Oh, there was an error: " + error + "." | |
); | |
Bot.log.Warn (error); | |
} | |
public override void OnTradeTimeout () | |
{ | |
Bot.SteamFriends.SendChatMessage (OtherSID, EChatEntryType.ChatMsg, | |
"Sorry, but you were AFK and the trade was canceled."); | |
Bot.log.Info ("User was kicked because he was AFK."); | |
} | |
public override void OnTradeInit() | |
{ | |
Trade.SendMessage ("Success. Please put up your items."); | |
} | |
public override void OnTradeAddItem (Schema.Item schemaItem, Inventory.Item inventoryItem) {} | |
public override void OnTradeRemoveItem (Schema.Item schemaItem, Inventory.Item inventoryItem) {} | |
public override void OnTradeMessage (string message) {} | |
public override void OnTradeReady (bool ready) | |
{ | |
if (!ready) | |
{ | |
Trade.SetReady (false); | |
} | |
else | |
{ | |
Trade.SetReady (true); | |
} | |
} | |
public override void OnTradeAccept() | |
{ | |
bool success = Trade.AcceptTrade(); | |
if (success) | |
{ | |
Log.Success ("Trade was Successful!"); | |
} | |
else | |
{ | |
Log.Warn ("Trade might have failed."); | |
} | |
OnTradeClose (); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This isn't working anymore either 😢