C# MySQL Donation Bot
WARNING! THIS BOT IS OLD. YOU CAN STILL USE IT BUT IT MIGHT NEED TO BE UPDATED.
Introduction: I have seen many people on this forum requesting trade bots to do whatever function they want, but most want it to handle donations. So far, most people have not been successful in obtaining one. I have decided to release this MySQL Donation bot for AlliedModders Donors Only. I released it initially on the donor forums only, but now I'm moving it to public.
Fuctions- Logs any trades to a MySQL Database
- Accepts any items, but keys are logged into the database.
- Defined strings which give a key its value in donor days.
- Sends the set SteamID a message when a trade is recieved. (Must edit source code to change this)
Setting Up The Bot
Head to Bin/Release/settings.json
Code:
{
"Admins":["Your SteamID 32 Here"],
"ApiKey":"Your API Key Here",
"mainLog": "syslog.log",
"UseSeparateProcesses": "false",
"AutoStartAllBots": "true",
"Bots": [
{
"Username":"Place Username Here",
"Password":"Place Password Here",
"DisplayName":"Donation Bot",
"ChatResponse":"Hi. I am a bot!",
"logFile": "TestBot.log",
"BotControlClass": "SteamBot.Donations",
"MaximumTradeTime":180,
"MaximumActionGap":30,
"DisplayNamePrefix":"Bot ",
"TradePollingInterval":800,
"LogLevel":"Success",
"AutoStart": "true",
"conString": "SERVER="Server";PORT=3306;DATABASE="derp_mcherp";UID="SQL User";PASSWORD="password1";",
"_1":"10",
"_2":"20",
"_3":"30",
"_4":"45",
"_5":"55",
"_6":"70",
"_7":"80",
"_8":"100",
"_9":"120"
}
]
}
Edit the strings above ("_3":"30") = (3 Keys: 30 Days)
Once your bot is complete, you will need to do put in your steam guard code for the profile.
Last step is to connect your bot to your MySQL Database
Code:
"conString": "SERVER="Server";PORT=3306;DATABASE="derp_mcherp";UID="SQL User";PASSWORD="password1";",
To change the notification user. (Please change it, I no wants spams)
Head to SteamBot/Donations.cs
Code:
Bot.SteamFriends.SendChatMessage(YourSteamID32Here, EChatEntryType.ChatMsg, idname + "<" + currentid + "> donated " + keysadded + "key<s>.");
And you're done.
Running The Bot
Head to Bin/Release/SteamBot.exe
Click on it, it will log your bot in and you will need to input your steamguard code. Use the format above (auth 0=code)
Notice
All this bot does is record the trades. It does not add donators or remove them. To do that, you will need to make a system of your own.
Credits
Bone - Created this bot (He stopped making bots awhile ago)
Download Link
Click Me - File was to big to add as a attachment.