E1M1 Posted August 20, 2009 Posted August 20, 2009 (edited) Hello, I am trying to make my char say "k" but for some reason it don't work.If you look and compare pictures I attached you will see that packets were same, weren't? but I still cant understand what I did wrong. Game is diablo II expandcollapse popup#include <GUIConstantsEx.au3> Opt('MustDeclareVars', 1) Dim $Hex,$Str ;============================================== ;============================================== ;CLIENT! Start Me after starting the SERVER!!!!!!!!!!!!!!! ;============================================== ;============================================== Example() Func Example() ; Set Some reusable info ;-------------------------- Local $ConnectedSocket, $szData ; Set $szIPADDRESS to wherever the SERVER is. We will change a PC name into an IP Address ; Local $szServerPC = @ComputerName ; Local $szIPADDRESS = TCPNameToIP($szServerPC) Local $szIPADDRESS = "213.248.106.48" Local $nPORT = 4000 ; Start The TCP Services ;============================================== TCPStartup() ; Initialize a variable to represent a connection ;============================================== $ConnectedSocket = -1 ;Attempt to connect to SERVER at its IP and PORT 33891 ;======================================================= $ConnectedSocket = TCPConnect($szIPADDRESS, $nPORT) ; If there is an error... show it If @error Then MsgBox(4112, "Error", "TCPConnect failed with WSA error: " & @error) ; If there is no error loop an inputbox for data ; to send to the SERVER. Else ;Loop forever asking for data to send to the SERVER $Hex = "15 01 00 6B 00 00 00" $Str = StringSplit($Hex," ") $Hex = '' For $x = 1 to $Str[0] If $Str[$x] Then $Hex &= Chr((Dec($Str[$x]))) EndIf Next TCPSend($ConnectedSocket, Binary($hex)) EndIf EndFunc ;==>Example Edited August 21, 2009 by E1M1 edited
E1M1 Posted August 21, 2009 Author Posted August 21, 2009 I got it, The problem Is It Creates new connection. The question is: how to use existing connection? TCPConnect() returns main socket identifier but how to use an existing main socket identifier? edited
jvanegmond Posted August 21, 2009 Posted August 21, 2009 You can't attach to an existing connection with all native AutoIt code. As far as I am aware, there are no libraries available for AutoIt to use a existing connection and send packets that way. Most programs that are able to do this use winpcap.dll, there is no AutoIt UDF available to do this. github.com/jvanegmond
E1M1 Posted August 21, 2009 Author Posted August 21, 2009 but do you think how hard would it be to code UDF? and can I do it with out using DLL or not? edited
jvanegmond Posted August 21, 2009 Posted August 21, 2009 Yes, it will be hard. Several people have tried to write a winpcap.dll UDF and failed. You can not do it without using a dll or COM (this is always true if it's not native AutoIt). github.com/jvanegmond
E1M1 Posted August 21, 2009 Author Posted August 21, 2009 offtopic: where can I download winpcap.dll I googled like crazy for it, and where I can find it's functions? edited
AdmiralAlkex Posted August 21, 2009 Posted August 21, 2009 offtopic: where can I download winpcap.dll I googled like crazy for it, and where I can find it's functions?Google WinPcap and it's the first result. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
E1M1 Posted August 21, 2009 Author Posted August 21, 2009 (edited) I found UDFMy linkBut how doe it help me to send packets? Edited August 21, 2009 by E1M1 edited
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now