|
You last visited: Today at 02:51
Advertisement
sro_client.exe auto flag pick
Discussion on sro_client.exe auto flag pick within the SRO Coding Corner forum part of the Silkroad Online category.
12/03/2019, 19:07
|
#1
|
elite*gold: 0
Join Date: Dec 2019
Posts: 8
Received Thanks: 1
|
sro_client.exe auto flag pick
hello, I would like to edit my sro_client.exe in a way that when it receives a certain packet (flag dropped), it sends a pick packet, I already know both of the packets and how to send and receive them but that's via phconnector but I would like to implement them inside the sro_client since it would be a lot quicker
so what I'm basically trying to do is send packets through the sro_client directly without the need for a proxy like phconnector, any tips would be appreciated
|
|
|
12/03/2019, 19:24
|
#2
|
elite*gold: 0
Join Date: Nov 2019
Posts: 13
Received Thanks: 5
|
I believe what you're looking for is dll injection.
- A hook on object spawn to trigger the pickup.
- A hook on send packet to send the pickup packet.
- Or a hook on the pickup hotkey "G" to pickup items close by.
But that won't work on clients that are protected.
You are better of using phConnector for easier time.
|
|
|
12/03/2019, 19:35
|
#3
|
elite*gold: 0
Join Date: Dec 2019
Posts: 8
Received Thanks: 1
|
the client I'm trying to edit isn't protected and I already got this running in phconnector but apparently someone coded it in their sro_client and they're faster than the one I made so I'm looking for improvements
oh also it's coded in autoit, would it be much quicker if I coded it in C instead?
|
|
|
12/03/2019, 20:19
|
#4
|
elite*gold: 0
Join Date: Nov 2019
Posts: 13
Received Thanks: 5
|
Autoit is just fine for sending pickup packet but...
Depends on how you code your pickup and the rest of your coding logics... if you send the pickup as soon as the object/item spawns then that should be the quickest way... after that it only depends now on the latency you have to the server.
If the other guy have lower latency then he would be faster than you and nothing you can do about it except physically moving closer to the server.
|
|
|
12/03/2019, 21:07
|
#5
|
elite*gold: 0
Join Date: Dec 2019
Posts: 8
Received Thanks: 1
|
well I'm sending packets like this for example
TCPStartup()
$socket = TCPConnect("127.0.0.1", 16000)
$data = "0x03007470030001045E27000000"
TCPSend($socket, $data)
would treating it like raw strings make it any slower? also if you've ever coded something in C can you show me a code example where you can send a packet like the code above? thanks
|
|
|
12/03/2019, 21:47
|
#6
|
elite*gold: 0
Join Date: Nov 2019
Posts: 13
Received Thanks: 5
|
0300 7470 03 00 01 04 5E270000 00
The sample packet doesn't seem to be a pickup packet.
0300 - data length / should be 0700
7470 - opcode for action/cast ?
03 - direction to server?
00 - not encrypted
01 - has action
04 - action type / 04 cast skill
5E270000 - skill id
00 - no target
Anyway, for pickup you would need to have the item unique id so you need to parse the object spawn packet and grab the item unique id.
For C/C++/C#, you would need to have a class/struct like...
I.E. phConnector uses StreamUtility.
StreamUtility writer;
writer.Write<uint8_t>(1); // has action
writer.Write<uint8_t>(2); // action type / 02 pickup
writer.Write<uint8_t>(1); // has target
writer.Write<uint32_t>(uniqueid); // item unique id
Joymax.Inject(0x7074, writer); // send opcode and the pickup packet
|
|
|
12/03/2019, 22:16
|
#7
|
elite*gold: 0
Join Date: Dec 2019
Posts: 8
Received Thanks: 1
|
it's a skill packet yea I don't wanna give away the pickup packet for others to use in case they stumble across this thread
thanks, but would coding it in C actually make it a lot faster? like at least 50ms faster? I feel like this really could just be an internet latency issue
|
|
|
12/03/2019, 22:32
|
#8
|
elite*gold: 0
Join Date: Nov 2019
Posts: 13
Received Thanks: 5
|
Well, autoit is mainly a scripting/interpreter language... it might be doing more stuff on the backend that causes more delays in executing the code but that won't cause major delays on what you want to achieve.
If you compare it to C++, yes it would be faster but i doubt it will have a big impact on the pickup delay.
Try pinging the server address and see whats your responds time.
Most private servers close by me have 100ms.
Other side of the world I would get around 200ms - 500ms ping.
|
|
|
12/03/2019, 22:56
|
#9
|
elite*gold: 0
Join Date: Sep 2018
Posts: 419
Received Thanks: 941
|
Quote:
Originally Posted by kepner15
If you compare it to C++, yes it would be faster but i doubt it will have a big impact on the pickup delay.
|
Agree. The only way to making it faster as possible it's by sending it on spawn packet, everything else is up to the latency, should be worry for the last one more than else.
|
|
|
12/04/2019, 08:46
|
#10
|
elite*gold: 0
Join Date: Dec 2019
Posts: 8
Received Thanks: 1
|
well what if I run my phconnector and the autoit script on a remote server so that it's the server that listens to packets and then send the pick packet, how can I connect to a phconnector that's running on a remote server if it's on 127.0.0.1 port 16000 maybe
connect to remote serverIP port 16000 or do I need port forwarding or any of that sort?
[EDIT]
Actually just tested how much it takes for my script to receive and send the packet and it was 0.0563 milliseconds, I guess that's 56.3 microseconds (used TimerInit() and TimerDiff to calculate the time)
I think this is relatively fast but I have no sense of what's fast and what's not so do you think that this is actually quick enough and I should just consider the remote server idea or there's room for improvements?
|
|
|
12/04/2019, 17:10
|
#11
|
elite*gold: 166
Join Date: Apr 2009
Posts: 2,339
Received Thanks: 2,661
|
Check Singlespawn (0x3015). Since it's single and not groupspawn, you don't have to parse everything, that's really fortunate because otherwise it's very painy.
Code:
UInt32 RefObjID = p.ReadUInt32();
if (RefObjID == 23921) // if NPC_EVENT_FLAGWAR_MASTERKEY
{
UInt32 KeyUniqueID = p.ReadUInt32();
}
Then send a pickpacket with the unique id you just got. Tada done.
You can use  as a DLL base, it'll provide you everything you need. (Capturing packets - sending packets)
|
|
|
12/04/2019, 20:33
|
#12
|
elite*gold: 0
Join Date: Dec 2019
Posts: 8
Received Thanks: 1
|
Thanks, that was actually helpful but I guess I realized there's no room for improvements here, apparently my script takes less than one millisecond to execute (I thought it was 100ms cause I thought the autoit function TimerDiff's output was in seconds) so the only improving I need to do here is ping latency
thanks for helping everyone
|
|
|
03/09/2020, 10:06
|
#13
|
elite*gold: 0
Join Date: Jul 2010
Posts: 3
Received Thanks: 2
|
Quote:
Originally Posted by aastrothunder
well what if I run my phconnector and the autoit script on a remote server so that it's the server that listens to packets and then send the pick packet, how can I connect to a phconnector that's running on a remote server if it's on 127.0.0.1 port 16000 maybe
connect to remote serverIP port 16000 or do I need port forwarding or any of that sort?
|
Well Jay, Because I knew you were going to share the program with friends [After I've your word to not do that], I didn't code it to you as well as it should have been.
And in trying to try it through a server, it is useless.
You will have to encode another program, which you will not be able to monetize on your own and will not match others as well, and I have mentioned the reason for that earlier.
Another reason is that other users buy similar programs in #C language which is better than AutoIt.
#3omda 
PS: I really regret my trust in you.
|
|
|
07/13/2020, 18:12
|
#14
|
elite*gold: 290
Join Date: Oct 2013
Posts: 266
Received Thanks: 191
|
Solved
|
|
|
05/05/2021, 04:20
|
#15
|
elite*gold: 0
Join Date: Apr 2021
Posts: 4
Received Thanks: 0
|
hello i dont understand anything is that edit on media pk2?
|
|
|
All times are GMT +1. The time now is 02:52.
|
|