Register for your free account! | Forgot your password?

Go Back   elitepvpers > Silkroad Online > SRO Coding Corner
You last visited: Today at 18:29

  • Please register to post and access all features, it's quick, easy and FREE!


[Help] Trivia Event Bot

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2008
Posts: 2
Received Thanks: 0
Lightbulb [Help] Trivia Event Bot

Hello everyone,
The point of this topic is I want to create a Trivia Event Bot and make it public including source codes.

The steps of the bot is;
  1. Create proxy and redirect packets to it.
  2. Read packets and find packets with chatting opcode (0x3026).
  3. Check the type of the packet (It must be global chat).
  4. Check if the user is [Bot]System or counterpart.
  5. Try to find the question in saved questions.
  6. If bot has the question in its database, send the answer via PM to [Bot]System.

Creating question database, how to store questions in database (in a file or DB, table rows etc.), when to save/update database or searching for answer (hash questions to find faster or string comparison for all the questions) etc. is not mentioned above. This is just some kind of pseudo code.

The first of all, I did some digging in this forum and I have found pushedx's guides.
Firstly, I read [Guide]Simple Proxy Reference.
Quote:
Originally Posted by pushedx View Post
When the client connects to the proxy, the proxy then creates its own client to connect to the server. The reason for this is because the proxy must establish a connection to the server to be able to pass the data from the server back to the client and from the client to the server. The setup looks like this in ASCII art: Client <-> Proxy <-> Server.
As far as I understood, the logic is simply create a proxy then use it like a man-in-the-middle to sniff/drop/send packets.

My system is Windows 10 x64 and my IDE is Visual Studio 2015.

I downloaded the Silkroad Security API and tried to build his proxy in this guide. When I run the code with the parameters in this picture, it doesn't go any further after this line near 62.
Code:
//Check image for how did I set parameters.
//My parameters are,
//127.0.0.1 16000 37.156.246.19 15779
local_context.Socket = server.Accept();
So, I thought that this was a module of a bigger application and I was trying to run this application without hooking the .exe or something else. That is why I tried to run that mentioned in this topic, created by Devsome.
All I wanted to do with that application was to run it and see if it sends any message to the [BOT]System.
The application extracted the server IP wrong (I checked IP, port and division from mBot 1.12b), so I hardcoded the IP, port and division.

Code:
private void fMain_Load(object sender, EventArgs e)
{
        //The following 3 lines are my code.
        Framework.Global.ProxyGlobal.Server_Address = "37.156.246.19";
        Framework.Global.ProxyGlobal.Server_Gateway_Port = 15779;
        Framework.Global.ProxyGlobal.Server_Division = "DIV01";

        coBoLoginServer.Items.Insert(0, Framework.Global.ProxyGlobal.Server_Address);
        coBoLoginServer.SelectedIndex = 0;
        onLogMsg("* Successfully started VEGA");
        }
It did a fine job but couldn't do the part that I am interested. I was able to launch sro_client via GUI but I couldn't send PM to [BOT]System (The server has [BOT]System and it was online).
I opened it in debug mode and I found out that I had the similar problem with pushedx's program. The program doesn't go any further from the last line that is shown below.

Code:
//In Main.cs

ag_local_server = new TcpListener(IPAddress.Parse(Global.ProxyGlobal.Proxy_IPAddress), Global.ProxyGlobal.Proxy_Agent_Port);
//ag_local_server = new TcpListener(IPAddress.Any, Global.ProxyGlobal.Proxy_Agent_Port);
ag_local_server.Start();

Console.WriteLine("* Waiting for a connection... ");
OnLogMsg("* Waiting for a connection... ");

ag_local_client = ag_local_server.AcceptTcpClient(); //Line 433, doesn't go further after this line.
After two unsuccessful attempts, I gave up tweaking codes and downloaded edxSilkroadLoader5. I ran .exe, set the .pk2 and proxy as in this picture.

I have a strange error and have no idea about why this error occurs.


I checked the forum a little about this problem and saw . I gave it a shot.

I set the config file and ran it.
HTML Code:
[phConnector]

GatewayIP=37.156.246.19

GatewayPort=15779



BindPort=16000

BotBind=22580



DataMaxSize=16384
After that I ran edxSilkroadLoader5, set it and launched. I had no error and was able to login to the server.


Now I wonder what is wrong with the codes/programs that was unable to work fully functional. To more be specific,
  1. Why did pushedx's "Simplest Proxy" get stuck at that line?
  2. Why did Devsome's program get stuck at that line?
  3. Why did edxSilkroadLoader5 throw error?
  4. Why did my last attempt (phConnector + edxSilkroadLoader5) work?

Also, can I send/receive packets with proxy without injecting to sro_client and launch it?
For example, if I put these lines of code to Simplest Proxy and compile-and-run it, does it work when I connect to the game?
Or should I do some injection to the game and open it then use proxy?

Regards to Delirus.
Code:
if (packet.Opcode == 0x3026)
{
	int chat = packet.ReadUInt8();

	switch (chat)
	{
		case 6: //Global
			string name = packet.ReadAscii();
			string message = packet.ReadAscii();
			if(name == "XXX" && message.StartsWith("WTB"))
			{
				Packet pm = new Packet(0x7025);
				pm.WriteUInt16(02);
				pm.WriteAscii(name);
				pm.WriteAscii("AutoMessage");
				//Send(pm);
                                context.Security.Send(pm);
			}
			break;
	}
}
I am at the beginning of coding for injection, packet management and Silkroad, so everything about my steps and my ideas may be wrong.

Any kind of help is appreciated.



bilal_v is offline  
Old 02/02/2017, 13:02   #2
 
elite*gold: 0
Join Date: Apr 2008
Posts: 469
Received Thanks: 592
Quote:
1. Why did pushedx's "Simplest Proxy" get stuck at that line?
2. Why did Devsome's program get stuck at that line?
Because the client never connected to it. See 3.

Quote:
3.Why did edxSilkroadLoader5 throw error?

After two unsuccessful attempts, I gave up tweaking codes and downloaded edxSilkroadLoader5. I ran .exe, set the .pk2 and proxy as in this picture.

I have a strange error and have no idea about why this error occurs.
http://i.epvpimg.com/IWY6d.jpg
접속 실패(9) aka. Connection failure(9). This error occurs when the connection could not be established aka. no response from server.

Quote:
4. Why did my last attempt (phConnector + edxSilkroadLoader5) work?
These tools are well known to work fine with vSRO. It prooved that edxLoader's redirection works fine.
So its obivously a problem at your code.
I would guess, based on this line:
Code:
ag_local_server = new TcpListener(IPAddress.Parse(Global.ProxyGlobal.Proxy_IPAddress), Global.ProxyGlobal.Proxy_Agent_Port);
//ag_local_server = new TcpListener(IPAddress.Any, Global.ProxyGlobal.Proxy_Agent_Port);
ag_local_server.Start();
You're listening on the wrong IP. IPAddress.Any is fine, most of the time. What ever you are listening on, it needs to match the IP you put into edxLoader.


florian0 is offline  
Old 02/02/2017, 14:11   #3
 
elite*gold: 0
Join Date: Sep 2016
Posts: 30
Received Thanks: 12
Hey Bilal,
you could just use one of the previously released silkroad open source clientless bots to learn from it, or even upgrade it to fit your needs.
a simple example for this is an open source released here before (dunno whom the credits go to, but here is it anyways).
ps: you will need a working SilkroadSecurityApi to make it get to work again... (it can basically do anything including having an sql integration.)
Link:
press thanks if i helped. If you needed any help you could message me here.
"Abner" is offline  
Old 02/22/2017, 00:01   #4
 
elite*gold: 38
Join Date: Jul 2010
Posts: 480
Received Thanks: 306
Quote:
Originally Posted by "Abner" View Post
Hey Bilal,
you could just use one of the previously released silkroad open source clientless bots to learn from it, or even upgrade it to fit your needs.
a simple example for this is an open source released here before (dunno whom the credits go to, but here is it anyways).
ps: you will need a working SilkroadSecurityApi to make it get to work again... (it can basically do anything including having an sql integration.)
Link:
press thanks if i helped. If you needed any help you could message me here.
you're right but what if I wanted to send HWID in logging process?


Revolutionary-Network is offline  
Old 02/22/2017, 08:39   #5
 
elite*gold: 0
Join Date: Oct 2014
Posts: 34
Received Thanks: 14
Quote:
Originally Posted by Revolutionary-Network View Post
you're right but what if I wanted to send HWID in logging process?
feel free to implement it?!
mxii is offline  
Old 02/23/2017, 13:35   #6
 
elite*gold: 38
Join Date: Jul 2010
Posts: 480
Received Thanks: 306
Quote:
Originally Posted by mxii View Post
feel free to implement it?!
still trying to implement it when I have some free time, I'm still beginner dealing with those packets and such stuff.
Revolutionary-Network is offline  
Old 02/27/2017, 17:52   #7
 
elite*gold: 0
Join Date: Sep 2016
Posts: 30
Received Thanks: 12
you could completely bypass hwid on login with the selected usernames


best,
"Abner" is offline  
Old 03/03/2017, 12:17   #8
 
elite*gold: 46
Join Date: Mar 2017
Posts: 37
Received Thanks: 19
did u implement successfully ?
NyxOnline is offline  
Old 03/04/2017, 21:19   #9
 
elite*gold: 0
Join Date: Oct 2008
Posts: 2
Received Thanks: 0
Quote:
Originally Posted by NyxOnline View Post
did u implement successfully ?
I had no time to implement it from scratch, I used some tools that I mentioned above and I haven't try anything that isn't mentioned above.
I did every part except proxy thing. I'll try to make it work with additional tools (phConnector + edxLoader) later.
This link gave me that idea.

I also checked out this topic for proxy but couldn't achieve much.
I think I'm failing because of HWID limit .dll files, but I'm not sure.
bilal_v is offline  
Old 04/04/2017, 15:33   #10
 
elite*gold: 0
Join Date: Apr 2017
Posts: 37
Received Thanks: 0
feel free to implement it?!


LoLBoostie is offline  
Reply

Tags
c#, event bot, inject, proxy, trivia



« Mbot Log "Error during authorisation" | About Alchemy fusing time »

Similar Threads
A LoL Trivia Game!
12/04/2014 - League of Legends Main - Discussions / Questions - 3 Replies
Website: LEAGUEQUOTES The Game is simple, you are given quotes from a random champion in League of Legends and you must answer who that quote belongs to! Two Game Modes: 1) PvP Mode (Normal Mode) - Queue against other players and win to gain...
Trivia Rewards
06/07/2011 - EO PServer Hosting - 3 Replies
I was hoping someone might know where the data is stored that gives the rewards for trivia (wisdom pouch, exc). Even if someone doesn't know where the command is to change that, is there an easy way to change what the wisdom pouch rewards? On...
trivia contest
01/19/2011 - EO PServer Hosting - 14 Replies
Hi just wondering about the trivia contest and where to find it in the serverfiles? I wouldnt mind it in english. Any help I would apreaciate it. thnx :pimp:
Trivia questions
10/27/2009 - Eudemons Online - 3 Replies
is there a way i can get them? are they changing? i some times find the some questions getting repeated. Thanks ^^



All times are GMT +2. The time now is 18:29.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.