Raised This Month: $32 Target: $400
 8% 

[TF2] MySQL Donation Bot


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RTWNick
AlliedModders Donor
Join Date: Mar 2014
Old 03-12-2015 , 17:20   [TF2] MySQL Donation Bot
Reply With Quote #1

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.

Code:
auth 0=code
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.
RTWNick is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 03-13-2015 , 15:21   Re: [TF2] MySQL Donation Bot
Reply With Quote #2

Is there source on a github?
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 03-13-2015 at 15:22.
friagram is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 03-13-2015 , 16:34   Re: [TF2] MySQL Donation Bot
Reply With Quote #3

Quote:
Originally Posted by friagram View Post
Is there source on a github?
zip contains source
__________________
WildCard65 is offline
Creampuffyness
Senior Member
Join Date: Jun 2009
Old 03-19-2015 , 23:42   Re: [TF2] MySQL Donation Bot
Reply With Quote #4

Anyone have this working? I need something like this to run on a Windows server, interface with sourcebans and/or Donations Control. Will pay for a completed system. PM me.
__________________
Creampuffyness is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 03-20-2015 , 08:12   Re: [TF2] MySQL Donation Bot
Reply With Quote #5

This may require extensive recoding to get into a workable state. Someone pointed out some errors in the original thread that I'm not sure are still applicable, but if you are recoding, look out for these:

Quote:
  • The keysadded variable is incremented when a key is added (L:119) but it is not decremented when a key is removed (It just impacts the message that is sent to the bot owner)
  • When the trade is finished, and items other than keys are added, the bot attemts to inform the trade partner, that the bot only accepts keys (L:211)
  • The bot runs the create table query on every successful trade (L:209 ) instead of only once when the bot is initialized. (L:26)
  • A new mysql connection is created everytime a trade is successful (L:179 ) but the connections are never closed
  • Only keys are recorded in the donation table, all other traded items are not recorded
As well, email trade confirmations may be a problem when using this bot. There is a high potential for someone to not confirm the trade if they know the bot will still go through with the donation handling.


I'm not sure if Jessecar's SteamBOT has been updated yet to handle this.
404UserNotFound is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 03-20-2015 , 09:43   Re: [TF2] MySQL Donation Bot
Reply With Quote #6

Quote:
Originally Posted by abrandnewday View Post
This may require extensive recoding to get into a workable state. Someone pointed out some errors in the original thread that I'm not sure are still applicable, but if you are recoding, look out for these:

[/LIST]As well, email trade confirmations may be a problem when using this bot. There is a high potential for someone to not confirm the trade if they know the bot will still go through with the donation handling.


I'm not sure if Jessecar's SteamBOT has been updated yet to handle this.
nope: https://github.com/Jessecar96/SteamBot/pull/732
__________________
WildCard65 is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 03-20-2015 , 10:04   Re: [TF2] MySQL Donation Bot
Reply With Quote #7

Quote:
Originally Posted by WildCard65 View Post
Well shit. Had a friend help me recode this for my server to handle donations, but since Valve decided it'd be smart to integrate email acceptance for trades, that really screwed things up for me.
404UserNotFound is offline
RTWNick
AlliedModders Donor
Join Date: Mar 2014
Old 03-20-2015 , 14:53   Re: [TF2] MySQL Donation Bot
Reply With Quote #8

I have plans on making an all purpose node.js bot sometime after I finish my current projects. Regarding the errors in the bot, I had no knowledge of it as I did not code this bot myself. If someone wants to contribute to this thread, they can post the fixed version of whatever code is broken.
RTWNick is offline
GMMAnonymus
New Member
Join Date: Jul 2013
Old 07-28-2015 , 18:51   Re: [TF2] MySQL Donation Bot
Reply With Quote #9

Hy!
Could you update the link for this plugin/bot if you still have it?
Thank you
GMMAnonymus is offline
RTWNick
AlliedModders Donor
Join Date: Mar 2014
Old 08-13-2015 , 01:16   Re: [TF2] MySQL Donation Bot
Reply With Quote #10

Anyone got a copy of the bot that they can upload? Silly old me deleted his own copy and can't find a backup.
RTWNick is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:59.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode