<div><div align="center"><img src="http://puu.sh/kHuY8/73f4c20c3d.png"border="0" alt="" /><br /><u><i><b><font color="Red">If you find password / username / personal infos, please, remove them and contact me ! I'm pretty sure I left some...</font></b></i></u><br /></div><font size="6"><font color="#2E64FE">Description :</font><br /></font><br /><i>God... Another steambot ? Really ?</i><br />Yeah, but wait, there is more ! This one provide a simple interface but complete (okay, well, not yet, still in version 1.0) through TCP messages. So, the bot warn in <b>REAL-TIME</b> when something happen, as exemple : When someone finsih a trade with him ! You might want to give a close look at the "Features" section !<br /><br />But before continuing I would like to say this :<br />This bot is been made by Jessecar96 and I slighty modified it to provide such small features (like trades end handling and a speak module, I want to add more in the futur, but I need time). Also this bot is made in <font color="Lime"><font size="4"><b>C#</b></font></font>, so, Mac (heheehhe) and Linux (sorry D;) can already quit. <b>Except</b> if you find a way to run it on Wine or something else.<br /><br />Also it's a pre-release, many people pushed me to publish this as fast as possible. So, don't except a lot of features <b>YET</b>. But, the things who are already implemented are working fine :D !<br /><br /><i>So, why the f. should I use that thing ?</i><br />Because like I said 84134803214 times above, this thing have a (simple, okay ?) interface, where you can handle the trades, etc... to create things on your server, so now. Let's said I would like to display a nice message each time someone has finished to trade with the bot, well, you can, take a look at the template plugin (availables in the downloads.)<br /><br /><font size="6"><font color="#2E64FE">Commands:</font><br /></font><br /><i>No commands</i><br /><i>No Cvar</i><br />What did you excepted ? It's a steambot !<br /><br /><font size="6"><font color="#2E64FE">Installation :</font><br /></font><br />1) Download the zip archive (The sources are included inside, also the compilled binaries)<br />2) Go to "<b>SteamBot_ArkarrSteamBotInterfacebinDebug</b>" and edit <b>Serttings.json</b> with your favorite text editor.<br />3) Start the bot by double-clicking on the <b>SteamBotInterface.exe</b> executable file.<br />4) ???<br />5) Enjoy !<br /><br /><font size="6"><font color="#2E64FE">What I plan to do ?</font></font><br />- a hudge list of features. I don't want to write them down now, will take me all the after-noon.<br /><br /><font size="6"><font color="#2E64FE">Request :</font><br /></font><br />None for the moment... feel free to ask !<br /><br /><font size="6"><font color="#2E64FE">Screenshots</font><br /></font><br /><img src="http://puu.sh/kHuhY/5ab56d88f9.PNG" border="0" alt="" /><br /><br /><font size="6"><font color="#2E64FE">Template</font><br /></font><br /><br /><i>Template ?</i> Yeah, this is how you 'speak' with the bot, he send you event, and you handle them, actually, there is only 1 event you can handle, when a trade finish.<br /><br /><b>TRADEOFFER_ENDED</b> - Called when someone finish (confirm through his emails) the trade offer.<br />Exemple :<br /><b>TRADEOFFER_ENDED|5000|5000|5001/5002|STEAM_0:1:XXXXXXX</b><br />those numbers (5000, 5001, etc...) are item definition index. For exemple, here, it's scarp, reclaimed and raffined metal who are traded. The left part is the items that the BOT will have and on the right, it's the items that the USER will have.<br /><br />Here is a template about how to create, and communicate with the bot.<br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #FF8000">#include <sourcemod><br />#include <sdktools><br />#include <socket><br /><br />#define PLUGIN_AUTHOR "Arkarr"<br />#define PLUGIN_VERSION "1.00"<br /><br /></span><span style="color: #0000BB">Handle clientSocket</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">Handle CVAR_SteambotServerIP</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">Handle CVAR_SteambotServerPort</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">Handle CVAR_SteambotTCPPassword</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">Handle TimerReconnect</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">char steambotIP</span><span style="color: #007700">[</span><span style="color: #0000BB">100</span><span style="color: #007700">];<br /></span><span style="color: #0000BB">char steambotPort</span><span style="color: #007700">[</span><span style="color: #0000BB">10</span><span style="color: #007700">];<br /></span><span style="color: #0000BB">char steambotPassword</span><span style="color: #007700">[</span><span style="color: #0000BB">25</span><span style="color: #007700">];<br /><br /></span><span style="color: #0000BB">bool connected</span><span style="color: #007700">;<br /><br />public </span><span style="color: #0000BB">Plugin myinfo </span><span style="color: #007700">= <br />{<br /> </span><span style="color: #0000BB">name </span><span style="color: #007700">= </span><span style="color: #DD0000">"[ANY] TCP connection to Steambot"</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">author </span><span style="color: #007700">= </span><span style="color: #0000BB">PLUGIN_AUTHOR</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">description </span><span style="color: #007700">= </span><span style="color: #DD0000">"A template to create a simple TCP connection with the steambot"</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">version </span><span style="color: #007700">= </span><span style="color: #0000BB">PLUGIN_VERSION</span><span style="color: #007700">,<br /> </span><span style="color: #0000BB">url </span><span style="color: #007700">= </span><span style="color: #DD0000">"http://www.sourcemod.net"<br /></span><span style="color: #007700">};<br /><br />public </span><span style="color: #0000BB">void OnPluginStart</span><span style="color: #007700">()<br />{<br /> </span><span style="color: #0000BB">CVAR_SteambotServerIP </span><span style="color: #007700">= </span><span style="color: #0000BB">CreateConVar</span><span style="color: #007700">(</span><span style="color: #DD0000">"sm_steambot_server_ip"</span><span style="color: #007700">, </span><span style="color: #DD0000">"XXX.XXX.XXX.XXX"</span><span style="color: #007700">, </span><span style="color: #DD0000">"The ip of the server where the steambot is hosted."</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">CVAR_SteambotServerPort </span><span style="color: #007700">= </span><span style="color: #0000BB">CreateConVar</span><span style="color: #007700">(</span><span style="color: #DD0000">"sm_steambot_server_port"</span><span style="color: #007700">, </span><span style="color: #DD0000">"11000"</span><span style="color: #007700">, </span><span style="color: #DD0000">"The port of the server where the steambot is hosted, WATCH OUT ! In version 1.0 of the bot, the port is hardcoded and is 11000 !!"</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">CVAR_SteambotTCPPassword </span><span style="color: #007700">= </span><span style="color: #0000BB">CreateConVar</span><span style="color: #007700">(</span><span style="color: #DD0000">"sm_steambot_tcp_password"</span><span style="color: #007700">, </span><span style="color: #DD0000">"Pa</span><span style="color: #0000BB">$Sw0Rd</span><span style="color: #DD0000">"</span><span style="color: #007700">, </span><span style="color: #DD0000">"The password to allow TCP data to be read / send (TCPPassword in settings.json)"</span><span style="color: #007700">);<br /> <br /> </span><span style="color: #0000BB">AutoExecConfig</span><span style="color: #007700">(</span><span style="color: #0000BB">true</span><span style="color: #007700">, </span><span style="color: #DD0000">"Steambot_TEMPLATE"</span><span style="color: #007700">);<br /> <br /> </span><span style="color: #0000BB">GetConVarString</span><span style="color: #007700">(</span><span style="color: #0000BB">CVAR_SteambotServerIP</span><span style="color: #007700">, </span><span style="color: #0000BB">steambotIP</span><span style="color: #007700">, </span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">steambotIP</span><span style="color: #007700">));<br /> </span><span style="color: #0000BB">GetConVarString</span><span style="color: #007700">(</span><span style="color: #0000BB">CVAR_SteambotServerPort</span><span style="color: #007700">, </span><span style="color: #0000BB">steambotPort</span><span style="color: #007700">, </span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">steambotPort</span><span style="color: #007700">));<br /> </span><span style="color: #0000BB">GetConVarString</span><span style="color: #007700">(</span><span style="color: #0000BB">CVAR_SteambotTCPPassword</span><span style="color: #007700">, </span><span style="color: #0000BB">steambotPassword</span><span style="color: #007700">, </span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">steambotPassword</span><span style="color: #007700">));<br /> <br /> </span><span style="color: #0000BB">AttemptSteamBotConnection</span><span style="color: #007700">();<br />}<br /><br />public </span><span style="color: #0000BB">void AttemptSteamBotConnection</span><span style="color: #007700">()<br />{<br /> </span><span style="color: #0000BB">connected </span><span style="color: #007700">= </span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">clientSocket </span><span style="color: #007700">= </span><span style="color: #0000BB">SocketCreate</span><span style="color: #007700">(</span><span style="color: #0000BB">SOCKET_TCP</span><span style="color: #007700">, </span><span style="color: #0000BB">OnClientSocketError</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">PrintToServer</span><span style="color: #007700">(</span><span style="color: #DD0000">"Attempt to connect to %s:%i ..."</span><span style="color: #007700">, </span><span style="color: #0000BB">steambotIP</span><span style="color: #007700">, </span><span style="color: #0000BB">StringToInt</span><span style="color: #007700">(</span><span style="color: #0000BB">steambotPort</span><span style="color: #007700">));<br /> </span><span style="color: #0000BB">SocketConnect</span><span style="color: #007700">(</span><span style="color: #0000BB">clientSocket</span><span style="color: #007700">, </span><span style="color: #0000BB">OnClientSocketConnected</span><span style="color: #007700">, </span><span style="color: #0000BB">OnChildSocketReceive</span><span style="color: #007700">, </span><span style="color: #0000BB">OnChildSocketDisconnected</span><span style="color: #007700">, </span><span style="color: #0000BB">steambotIP</span><span style="color: #007700">, </span><span style="color: #0000BB">StringToInt</span><span style="color: #007700">(</span><span style="color: #0000BB">steambotPort</span><span style="color: #007700">));<br />}<br /><br />public </span><span style="color: #0000BB">OnClientSocketConnected</span><span style="color: #007700">(</span><span style="color: #0000BB">Handle socket</span><span style="color: #007700">, </span><span style="color: #0000BB">any arg</span><span style="color: #007700">)<br />{<br /> </span><span style="color: #FF8000">/* >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><br /> We NEED to send the data 'REQUEST_CONNECTION' ONCE and AT THE FIRST CONNECTION so the steambot register us in his client list.<br /> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<br /> */<br /> </span><span style="color: #0000BB">PrintToServer</span><span style="color: #007700">(</span><span style="color: #DD0000">">>> CONNECTED !"</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">char data</span><span style="color: #007700">[</span><span style="color: #0000BB">200</span><span style="color: #007700">];<br /> </span><span style="color: #0000BB">Format</span><span style="color: #007700">(</span><span style="color: #0000BB">data</span><span style="color: #007700">, </span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">data</span><span style="color: #007700">), </span><span style="color: #DD0000">"%sREQUEST_CONNECTION"</span><span style="color: #007700">, </span><span style="color: #0000BB">steambotPassword</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">SocketSend</span><span style="color: #007700">(</span><span style="color: #0000BB">clientSocket</span><span style="color: #007700">, </span><span style="color: #0000BB">data</span><span style="color: #007700">, </span><span style="color: #0000BB">sizeof</span><span style="color: #007700">(</span><span style="color: #0000BB">data</span><span style="color: #007700">));<br /> <br /> </span><span style="color: #FF8000">//Destroying the reconnect timer on failure :<br /> </span><span style="color: #007700">if(</span><span style="color: #0000BB">TimerReconnect </span><span style="color: #007700">!= </span><span style="color: #0000BB">INVALID_HANDLE</span><span style="color: #007700">)<br /> {<br /> </span><span style="color: #0000BB">KillTimer</span><span style="color: #007700">(</span><span style="color: #0000BB">TimerReconnect</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">TimerReconnect </span><span style="color: #007700">= </span><span style="color: #0000BB">INVALID_HANDLE</span><span style="color: #007700">;<br /> }<br />}<br /><br />public </span><span style="color: #0000BB">OnClientSocketError</span><span style="color: #007700">(</span><span style="color: #0000BB">Handle socket</span><span style="color: #007700">, const </span><span style="color: #0000BB">int errorType</span><span style="color: #007700">, const </span><span style="color: #0000BB">int errorNum</span><span style="color: #007700">, </span><span style="color: #0000BB">any ary</span><span style="color: #007700">)<br />{<br /> </span><span style="color: #0000BB">connected </span><span style="color: #007700">= </span><span style="color: #0000BB">false</span><span style="color: #007700">; </span><span style="color: #FF8000">//Client NOT connected anymore, this is very important.<br /> </span><span style="color: #0000BB">LogError</span><span style="color: #007700">(</span><span style="color: #DD0000">"socket error %d (errno %d)"</span><span style="color: #007700">, </span><span style="color: #0000BB">errorType</span><span style="color: #007700">, </span><span style="color: #0000BB">errorNum</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">CloseHandle</span><span style="color: #007700">(</span><span style="color: #0000BB">socket</span><span style="color: #007700">);<br />}<br /><br />public </span><span style="color: #0000BB">OnChildSocketReceive</span><span style="color: #007700">(</span><span style="color: #0000BB">Handle socket</span><span style="color: #007700">, </span><span style="color: #0000BB">char</span><span style="color: #007700">[] </span><span style="color: #0000BB">receiveData</span><span style="color: #007700">, const </span><span style="color: #0000BB">int dataSize</span><span style="color: #007700">, </span><span style="color: #0000BB">any hFile</span><span style="color: #007700">)<br />{<br /> </span><span style="color: #FF8000">//Data received by the bot, warning, password included (pretty dumb ?) !<br /> </span><span style="color: #0000BB">ReplaceString</span><span style="color: #007700">(</span><span style="color: #0000BB">receiveData</span><span style="color: #007700">, </span><span style="color: #0000BB">dataSize</span><span style="color: #007700">, </span><span style="color: #0000BB">steambotPassword</span><span style="color: #007700">, </span><span style="color: #DD0000">""</span><span style="color: #007700">);<br /> </span><span style="color: #FF8000">//Password removed, priting the message :<br /> </span><span style="color: #0000BB">PrintToServer</span><span style="color: #007700">(</span><span style="color: #DD0000">">>> %s"</span><span style="color: #007700">, </span><span style="color: #0000BB">receiveData</span><span style="color: #007700">);<br />}<br /><br />public </span><span style="color: #0000BB">OnChildSocketDisconnected</span><span style="color: #007700">(</span><span style="color: #0000BB">Handle socket</span><span style="color: #007700">, </span><span style="color: #0000BB">any hFile</span><span style="color: #007700">)<br />{<br /> </span><span style="color: #FF8000">//Connection to steam bot lost !<br /> </span><span style="color: #0000BB">PrintToServer</span><span style="color: #007700">(</span><span style="color: #DD0000">">>> DISCONNECTED !"</span><span style="color: #007700">);<br /> </span><span style="color: #0000BB">connected </span><span style="color: #007700">= </span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">CloseHandle</span><span style="color: #007700">(</span><span style="color: #0000BB">socket</span><span style="color: #007700">);<br /> <br /> </span><span style="color: #0000BB">TimerReconnect </span><span style="color: #007700">= </span><span style="color: #0000BB">CreateTimer</span><span style="color: #007700">(</span><span style="color: #0000BB">10.0</span><span style="color: #007700">, </span><span style="color: #0000BB">TMR_TryReconnection</span><span style="color: #007700">, </span><span style="color: #0000BB">_</span><span style="color: #007700">, </span><span style="color: #0000BB">TIMER_REPEAT</span><span style="color: #007700">);<br />}<br /><br />public </span><span style="color: #0000BB">Action TMR_TryReconnection</span><span style="color: #007700">(</span><span style="color: #0000BB">Handle timer</span><span style="color: #007700">, </span><span style="color: #0000BB">any none</span><span style="color: #007700">)<br />{<br /> </span><span style="color: #0000BB">AttemptSteamBotConnection</span><span style="color: #007700">();<br />}
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div><font size="6"><font color="#2E64FE">Download</font><br /></font><br /><br /><a href="http://tf2serverofar...Bot_Arkarr.zip"target="_blank">The ZIP archive (contain the compilled binaries as well.)</a><br /><a href="http://tf2serverofarkarr.no-ip.biz/arkarrbox/data/Steambot/TEMPLATE_TCPSBConnection.sp" target="_blank">The exemple template, same code as above</a><br /><br /><b>Logs </b> :<br /><b>1.0</b> : First public release.</div>
Wyświetl pełny artykuł
Witamy w Nieoficjalnym polskim support'cie AMX Mod X
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Guest Message by DevFuse

[ANY] Steambot
Temat rozp. Adminek AMXX.PL, 12.10.2015 13:35
Brak odpowiedzi do tego tematu
Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych