[ANY] ASteambot - Create your own modules !
ASteambot - Developper Introduction So... About a year ago, I made a steambot wich turned out to not be that usefull nor well made. I reprogrammed it, from scratch and ASteambot was "born". It's still an ugly undevelopped fetus, but it somehow work already [CLICK] . But the interesting part about it is that I want to create a simple interface so anybody with basic knowledge about sourcepawn will be able to do his own plugins using ASteambot. I have already mode two plugins using the interface and it works pretty well, I must say. ASteambot Donation ASteambot Chat The point of this thread is to explain how my interface work and also to get returns from you, about what stops you from doing plugins with the interface, what could be improved or if I should keep it alive or not. How does it work ? Well, ASteambot have a TCP endpoint, where you can send some queries through it. Wich means, Socket extension [CLICK] is required. Enough speech, more actions First of all, you will need the include file, you can grab it on Github [CLICK]. Let's take a look at it. ASteambot.inc (06.06.2019) PHP Code:
This one should NEVER be usued by you. It's ASteambot_Core who use it and he should be the only one. When ASteambot receive this type of message it will give the server an ID. It's like : Server : "Hey, ASteambot, I want to connect to ya" ASteambot : "Wait mate, I'll give you a number so I don't forget who you are, OK ?" Server : "Okay, yeah." AS_HOOK_CHAT This message type means that you want to send everything that his written in the game server chat to the steambot. If you receive this message, a friend of ASteambot have written "HOOKCHAT" in steamchat. If you send a message with this message type, ASteambot will try to forward this message to all steam friends who are hooking this server chat. AS_UNHOOK_CHAT If you receive this message, a friend of ASteambot have written "STOPHOOK" in steamchat. If you send a message with this message type, ASteambot will do nothing. AS_SIMPLE If you receive this message, ASteambot is trying to send you a message composed like this : Arkarr : this is a test text If you send a message with this message type, ASteambot will try to send a message through steam to the specified steamID. Message you send must me composed like this : ASteambot_SendMesssage(AS_SIMPLE, "STEAM_0:1:42047781/Hello world!"); AS_TRADEOFFER_SUCCESS If you receive this message, ASteambot is trying to send you a message composed like this : STEAM_0:1:42047781/523523634/45.10 This message can be subdivised in 3 parts. STEAM_0:1:42047781 is the first part and the steam ID of the player who completed a trade offer. 523523634 is the trade ID. 45.10 is how much $ the trade was worth. In this exemple, I traded for 45.10$ worth of steam items. It means a trade have successfully ended. If you send a message with this message type, ASteambot will do nothing. AS_TRADEOFFER_DECLINED If you receive this message, ASteambot is trying to send you a message composed like this : STEAM_0:1:42047781/523523634/45.10 This message can be subdivised in 3 parts. STEAM_0:1:42047781 is the first part and the steam ID of the player who completed a trade offer. 523523634 is the trade ID. 45.10 is how much $ the trade was worth. In this exemple, I traded for 45.10$ worth of steam items. It means a trade have been declined ended. If you send a message with this message type, ASteambot will do nothing. AS_SCAN_INVENTORY If you receive this message, ASteambot is trying to send you a message composed like this : STEAM_0:1:42047781/[TF2 items]/[CSGO items]/[DOTA 2 items] Obviously, the first part is the steamID of the player's inventory. [TF2 items], [CSGO items] and [DOTA 2 items] contains all the inventory that have a value in steam market higher than 0.00. It's compossed like this : item_id=item_name=item_value,item2_id=item2_n ame=item2_value,... If you send a message with this message type, ASteambot will return AS_SCAN_INVENTORY as message type and will return the inventory as well, as explained just above. Message you send must me composed like this : ASteambot_SendMesssage(AS_SCAN_INVENTORY, "STEAM_0:1:42047781"); AS_CREATE_TRADEOFFER You don't use it, because the message is a pain in the @S* to explain. Instend, you use the approriate function for that, check below. You will receive this kind of message once a trade offer has been created. It return the trade offer id. AS_NOT_FRIENDS If you receive this message, it means that you tried to do something that require ASteambot and the player to be friend. For exemple, you need to be friend to send a trade offer (or use a token, but it's not implemented yet in ASteambot TCP interface). The message is composed like this : STEAM_0:1:42047781 It just contain the steamID of the one who tried to do something that is not allowed. If you send that message to ASteambot, nothing happens. AS_TRADE_TOKEN Does nothing when you send, you will never receive it. AS_FRIEND_INVITE You will never receive this message type. Ask ASteambot to add the following steamID to his friends through steam request. Usage : ASteambot_SendMesssage(AS_FRIEND_INVITE, "STEAM_0:1:42047781"); AS_INVITE_GROUP Ask ASteambot to add the following steamID to the steam group. Usage : ASteambot_SendMesssage(AS_INVITE_GROUP, "STEAM_0:1:42047781/GROUP_ID"); GROUP_ID can be found here : http://steamcommunity.com/groups/YOU...listxml/?xml=1 it's the number in <groupID64>'s tag, for exemple : http://steamcommunity.com/groups/ark...listxml/?xml=1 group's id is 103582791460339322 Keep in mind that the ASteambot need the right to invite people in the group... If you receive this message, it means that someone have been invited to the steam group. The message is composed like this : STEAM_0:1:42047781 ASteambot_RegisterModule() PHP Code:
ASteambot_RemoveModule() PHP Code:
ASteambot_IsConnected() PHP Code:
ASteambot_SendMesssage(int MessageType, const char[] message) PHP Code:
You should ALWAYS (do as I say, not as I do :crab:) check if the server is connected to ASteambot before trying to send him anything. ASteambot_CreateTradeOffer(int client, int gameID, Handle ArrayAssetID) PHP Code:
TF2 = 440 CSGO = 730 DOTA2 = 570 ArrayAssetID is a arry wich contains valid assetID, assetID can be retrieved from ASteambot using the message type AS_SCAN_INVENTORY. PHP Code:
Alright, that was boring. If you have any other questions, or want to request anything else, just do it :wink: ! |
Re: [ANY] ASteambot - Create your own modules !
I made several updates since I wrote that post.
I need to do updates but firstly, I want to know if it has helped someone or not at all. If not, then I won't continue updating this post. Just send me a PM or leave a reply here. |
Re: [ANY] ASteambot - Create your own modules !
yeah this post was for me very helpfull then you documented it well
|
Re: [ANY] ASteambot - Create your own modules !
Quote:
|
Re: [ANY] ASteambot - Create your own modules !
I managed to setup the bot and all but I when I want to send a message, it simply doesn't work
AS_NOT_FRIENDS is not triggered and no message it sent. ASteambot_Message isn't even called The debug option from the core plugin shows the TCP password and the message but nothing happens the bot claims to be connected is Arkarr's API key needed? the main thread claims not, and the website isn't available |
Re: [ANY] ASteambot - Create your own modules !
Found a solution for my problem
First of all, my "hostip" cvar wasn't set to anything, so I rewrote a part of ASteambot_Core to add a cvar to manually write the IP of my server Then, the password I chose was 30 characters, and the max amount of characters we can enter is 24 (string size 25). For some reason, the TCP password on the website has no limits so it didn't work |
Re: [ANY] ASteambot - Create your own modules !
Quote:
Also, I'd like to add you on Steam in order to discuss about those things, as I plan to actively continue ASteambot and release a somewhat developper-friendly version, with more debug features and more logging. Also, fix huge mess inside ASteambot (+ ASteambot Core AM Plugin), WebSocket communication (instead of simple TCP socket) and much more connectivity feature. Also get ride of MarketScan dependencies, as people don't seem to understand why they require an API key for my server. |
Re: [ANY] ASteambot - Create your own modules !
Quote:
I'm using the +ip parameter, maybe it does the same job as the "hostip" convar? Quote:
Discord: azalty#9721 |
All times are GMT -4. The time now is 02:06. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.