Register for your free account! | Forgot your password?

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

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

Advertisement



Need help making my own bot. Where do I start?

Discussion on Need help making my own bot. Where do I start? within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2004
Posts: 53
Received Thanks: 0
Need help making my own bot. Where do I start?

Hello all. I know there are free bots and paid bots already. However, I would like to try to make my own bot to get better at programming and to put features that I want on my own bot. I know C++ and Java. Although, I prefer C++.

With that said, I was wondering where do I start to learn to make a bot using C++. How can I control the silkroad character through C++ code? I am guessing that it has to do something with packets. However, I have not dealt with network programming, all the programming I have done is local and not far into my Computer Science major yet.

Im reading and what is this thing about opcodes? What is this about?

I read some of Drew Benton's stuff. However, It was hard to follow because of all the new terms that was being used. In addition his other guides was talking about D3D and other things that I dont think is what I need to make a bot.

I look foward to some help. Thanks!
dropglock is offline  
Old 11/09/2010, 16:37   #2
 
elite*gold: 0
Join Date: Mar 2009
Posts: 2,693
Received Thanks: 3,160
opcode (operation code) it means every thing is received from the client have opcode those opcodes as far as i know must be inserted into the bot

but i don't have idea where to start making your own bot
LastThief is offline  
Thanks
1 User
Old 11/09/2010, 16:47   #3
 
Dr.Abdelfattah's Avatar
 
elite*gold: 7
Join Date: May 2010
Posts: 2,115
Received Thanks: 2,374
Quote:
Originally Posted by LastThief View Post
opcode (operation code) it means every thing is received from the client have opcode those opcodes as far as i know must be inserted into the bot

but i don't have idea where to start making your own bot
that's a point ,,
-------------------
i have an old source code of a bot (for old client silkroad) u can have some idea from it ..
i will upload & post it ...

Edit :
in attach the source code

its developed in AutoIt ,, u can download it from


have fun
Attached Files
File Type: rar silkroad bot source.rar (14.6 KB, 371 views)
Dr.Abdelfattah is offline  
Thanks
1 User
Old 11/09/2010, 17:09   #4
 
lesderid's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
The opcode is like an identifier of the packet. It explains what the data does.
Opcodes are (mostly) written in their hexadecimal representation.
For example, the opcode A101 (LoginServer).
It says that the data of the packet should contain a list of NameServers + a list of AgentServers, both with name and ID.

A normal silkroad packet is built like this:
[WORD] Data Length (len)
[WORD] Opcode
[BYTE] Security Count
[BYTE] Security CRC
[BYTE[len]] Data
lesderid is offline  
Old 11/09/2010, 21:59   #5
 
elite*gold: 0
Join Date: Jan 2008
Posts: 21
Received Thanks: 12
here my bot i have written some time ago -->

not the langue you are looking for (VB.Net) and outdated but still some usefull stuff in there if you are able to understand it (crapy code)
illstar is offline  
Thanks
1 User
Old 11/10/2010, 05:10   #6
 
elite*gold: 0
Join Date: Sep 2004
Posts: 53
Received Thanks: 0
thanks lesderid. What you just posted makes little sense to me. All i know is about data types, such as strings, integers, doubles, booleans. I have never dealt with WORD or BYTE. What would Data Length, Security Count, Security CRC and Data mean?

illstar, your link does not work. Im guessing you want me to click the link so I can give you more storage space.
dropglock is offline  
Old 11/10/2010, 05:57   #7
 
elite*gold: 0
Join Date: Sep 2004
Posts: 53
Received Thanks: 0
I just need a basic layout of how to create a bot. Then I can manage everything else on my own. How do I connect my C++ program to the client and to the servers in order to send commands such as to move to X,Y coordinate. Attack X monster. If i can get the base, I can use that to figure out the rest.
dropglock is offline  
Old 11/10/2010, 06:19   #8
 
elite*gold: 19
Join Date: Aug 2007
Posts: 2,731
Received Thanks: 1,801
Quote:
Originally Posted by dropglock View Post
I just need a basic layout of how to create a bot. Then I can manage everything else on my own. How do I connect my C++ program to the client and to the servers in order to send commands such as to move to X,Y coordinate. Attack X monster. If i can get the base, I can use that to figure out the rest.
The most simple bot i can think of (packetbased) Is Connecting to SrProxy with Winsock (Google)
I would help u more but im not a Coder (vb6 doesnt count)

Here's a small code for vb6:
Code:
Private Sub Form_Load()
Winsock1.Connect "127.0.0.1", 5000
End Sub

Public Function Send()
Dim Packet As String
Dim truePacket() As Byte
Packet = ChrB(&H1) & ChrB(&H0) & ChrB(&H4F) & ChrB(&H70) & ChrB(&H2) & ChrB(&H0) & ChrB(&H4)
truePacket = Packet
Form1.Winsock1.SendData truePacket
End Function
A Very well explained guide on how to use winsock in C++:

After that guide u won't need much more if you know some basics in C++...
HaGsTeR is offline  
Old 11/10/2010, 07:27   #9
 
lesderid's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
Quote:
Originally Posted by dropglock View Post
thanks lesderid. What you just posted makes little sense to me. All i know is about data types, such as strings, integers, doubles, booleans. I have never dealt with WORD or BYTE. What would Data Length, Security Count, Security CRC and Data mean?

illstar, your link does not work. Im guessing you want me to click the link so I can give you more storage space.
A byte is a number that can contain any number from 0 to 255. (2^8 numbers)
A word is a number that can contain any number from 0 to 65535. (2^16 numbers)

You can say that a word is two bytes, a dword is 2 words and a qword is 4 words.

Bytes and Words are often written hexadecimal.
For example, the highest number of byte is FF.
And the highest number of word is FF FF.

Data Length: How many bytes the Data contains.
Data: The actual data in the packet, the number of bytes is predefined by the Data Length.

About the Security stuff, I can't help you with that. I didn't really look into that (yet).
lesderid is offline  
Old 11/11/2010, 01:04   #10
 
bootdisk's Avatar
 
elite*gold: 0
Join Date: Sep 2010
Posts: 134
Received Thanks: 41
Start with what it makes you feel comfortable.
I never liked bots development because of the complexity of the packets and if I've to write one I'd write one for an FPS (like in 2001,2002 on CS days with botman's sdk).

I think if you're going to write a bot from scratch with C++ it would be suicide. Why don't you use C# or maybe Python, even VB? Higher level languages gives you exactly the same tools and less headaches.

Also, by writing a bot I don't think you get skills... there is a point in which what you've designed turns into a huge hardcoded and self-hacked software. I think improve skills is not equal to an SRO bot coding project just because if someone moves you out of SRO world you won't know anything else than that, and it's a huge world.... you could improve your skills by writing AI for other games, for example.

pushedx guides are great. He did the research and he wrote down in comprehensive words all that. At the end you will notice how right each word of his guides were and why they were there.

But well, these are just advices. Now It's up to you.
bootdisk is offline  
Old 11/11/2010, 03:42   #11
 
elite*gold: 0
Join Date: Sep 2004
Posts: 53
Received Thanks: 0
Quote:
Originally Posted by bootdisk View Post
Start with what it makes you feel comfortable.
I never liked bots development because of the complexity of the packets and if I've to write one I'd write one for an FPS (like in 2001,2002 on CS days with botman's sdk).

I think if you're going to write a bot from scratch with C++ it would be suicide. Why don't you use C# or maybe Python, even VB? Higher level languages gives you exactly the same tools and less headaches.

Also, by writing a bot I don't think you get skills... there is a point in which what you've designed turns into a huge hardcoded and self-hacked software. I think improve skills is not equal to an SRO bot coding project just because if someone moves you out of SRO world you won't know anything else than that, and it's a huge world.... you could improve your skills by writing AI for other games, for example.

pushedx guides are great. He did the research and he wrote down in comprehensive words all that. At the end you will notice how right each word of his guides were and why they were there.

But well, these are just advices. Now It's up to you.
I wouldnt mind trying it in C# since C++ and C# are so similar. I actually wrote a Tic Tac Toe program using C# once before with UI for my final project in my C++ class. Writing a SRO bot would actually help because it would teach me about relations between client, servers and packets. Everything that is online uses packets and to some degree I will learn something along with creating my own bot where I will be able to design it the way I want and I won't have to rely on other people.

The thing is I have no idea how to use the packets in relation to a program and how everything can be connected to make SRO move and attack monsters.
dropglock is offline  
Old 11/11/2010, 04:45   #12
 
bootdisk's Avatar
 
elite*gold: 0
Join Date: Sep 2010
Posts: 134
Received Thanks: 41
This kind of 'tools' are just to make players life easy.
A packet bot has limited functions, it's not the client itself and you're not writing a server either, on the other hand if you want to learn how to reverse then you might want to continue this way as there are many guides (besides of pushedx, you might also find some from bot90210 and many others).

When I've to discover sockets on a specific language I search for a simple Echo client/server example. Python's sockets are so similar to C and C++ and it gives you a lot of development speed and you can actually experiment a lot with it.

Packets are just arrays of bytes that are sent from client to server and from server to client, they contain OP codes and they've operands. Think about it as if it's an assembly language [instruction, operands, ...]. For example, if you have something like this:

0000500000 (all in hex)

you get this:

length 0000 (this contains the number of bytes that will follow the security bytes)
instruction (ok, i call it that way just to think as if it's asm but it's not xD) 5000
security bytes 0000 (when clients are initialized with the handshake process it might contain some kind of crc and it will add 0x80 to the length).

You might notice that I've changed the 0050 to 5000 and that's because of how the bytes are stored in memory (LE, BE...). But well, to sum up everything you need to know 2 things: 1st by calling recv you will get a bunch of bytes and sometimes it may contain more than 1 instruction so your job will be to read one by one, 2nd all the packets have that header which is:

unsigned short (WORD): length
unsigned short (WORD): op
unsigned short (WORD): security bytes

It's by far more easy to have an struct and cast the bytes to that struct.

Well, that's all I can remember... hope it helps.
bootdisk is offline  
Old 11/11/2010, 07:27   #13
 
lesderid's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 2,400
Received Thanks: 1,517
If you are really interested in this, I have a (very simple) client 'framework'.
It handles Endianness, String length prefixing, packet writer/reader class, server<->client connection etc.

It's not public but if you want, I could PM it.
lesderid is offline  
Old 11/12/2010, 19:08   #14
 
elite*gold: 0
Join Date: Mar 2008
Posts: 556
Received Thanks: 545
Well, if you want to get started and take the long process of learning any type of Microsoft coding, you had better search and get "Microsoft Visual Studio 2010" and then find an E-book (pirated), such as Visual Studio 2010 for Dummies and learn everything there is to know about that, and then find an E-book on Packet Logging, Packet Hacks, Packet Transfers, and Op-codes. Oh but wait, theirs more! You also need to learn about servers and data base. In other words, go to college for two years or self teach your self everything there is to know about the most popular programming languages.
Murgen is offline  
Old 12/09/2010, 10:28   #15
 
elite*gold: 0
Join Date: Sep 2004
Posts: 53
Received Thanks: 0
Thanks for help guys. Seems like a lot of work. However, I am willing to do it. Instead of starting with a big project such as a bot. I think I would rather make a packet-based auto buffer just for starters.

Quote:
Originally Posted by Murgen View Post
Well, if you want to get started and take the long process of learning any type of Microsoft coding, you had better search and get "Microsoft Visual Studio 2010" and then find an E-book (pirated), such as Visual Studio 2010 for Dummies and learn everything there is to know about that, and then find an E-book on Packet Logging, Packet Hacks, Packet Transfers, and Op-codes. Oh but wait, theirs more! You also need to learn about servers and data base. In other words, go to college for two years or self teach your self everything there is to know about the most popular programming languages.
You make it seem like a lot of work. However, I know that it will not take that much. I do not want to learn the whole thing. I have used Visual Studio for C++ and C#. For C#, the most complicated thing I have done is make a tic tac toe game with GUI, creating accounts, login, password, wins, loses.

Anyways, ya I am in college. Doing computer science, but they don't teach us about packets for the first semester or second semester. I have only been doing Java currently. Going over recursion, Trees, Lists, Queues etc..

In summation, I am not totally clueless and have some experience. Instead of making a bot. I want to try with a packet based auto buffer for starters.

What exactly do I need? I have already used Edxloader5 to grab the packets using the packet auto-parser to grab the packets where you select party member #2 and then buff "pain quota" skill from warrior. I have also grabbed the packets for member #3.

Code:
// choosing 2nd slot party member
[C -> S][7045]
1E 5F 62 01                                       ._b............. //this is party member #2
 
[S -> C][B045]
01                                                ................
1E 5F 62 01                                       ._b............. //this is party member #2
01                                                ................
05                                                ................
04                                                ................
// end of choice
Code:
// choosing 3rd slot party member
[C -> S][7045
33 1B 61 01                                       3.a............. //this is party member #3
 

[S -> C][B045]
01                                                ................
33 1B 61 01                                       3.a............. //this is party member #3
01                                                ................
05                                                ................
04                                                ................
// end of choice
This is party member #2.
1E 5F 62 01 ._b.............
This is party member #3.
33 1B 61 01 3.a.............

Now that I have these things, whats next? How do I apply these in a program using C++, C# or Java to make a program do this automatically?
dropglock is offline  
Reply


Similar Threads Similar Threads
Start Npc(also start Equiqment)und wie connectet man(Navicat)
05/02/2010 - WoW Private Server - 1 Replies
Hallo Elitepvpers, ich hoffe ich bin hier im richtigen Forum. Wie macht man einen Npc für start Equiqment? und wie connectet man in Navicat(for MySQL)? danke im vorraus:handsdown::handsdown:
How would I start making a speedhack and what tools ؟
12/05/2008 - CO2 Programming - 2 Replies
any one know how i can make it help me to make one and itemtype plz fast :D



All times are GMT +1. The time now is 16:30.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.