Sign in to follow this  
Followers 0
E1M1

Why My script don't make my char speak? [UDF found]

8 posts in this topic

#1 ·  Posted (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

#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 by E1M1

edited

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

but do you think how hard would it be to code UDF? and can I do it with out using DLL or not?


edited

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites

offtopic: where can I download winpcap.dll I googled like crazy for it, and where I can find it's functions?


edited

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I found UDF

My link

But how doe it help me to send packets?

Edited by E1M1

edited

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0