Jump to content

Recommended Posts

Posted

Hi, I would like to be able to make two bots communicate over a local area network.

Are they any existing udf files for this. Someone mentioned tcp/udp methods im searching for an example that i can use to help.

Can anyone point me in rightr direction .

Thanks.

Posted (edited)

Use the advanced search.

Search for TCP with "titles only".

That or search the helpfile, you're not gonna get much help until you show you made some work yourself.

Edited by AdmiralAlkex
Posted

Tcp would be a good way to go.

Here is an example Client:

$Startup = TCPStartup()
$Connect = TCPConnect("192.168.1.2", 31338)

 If $Connect = -1 Then
        MsgBox(0, "Error", "Error connecting to server")
    Else
        MsgBox(0, "Success", "Success connecting to server")
    EndIf

While 1
    ;Tcp recieve commands to get things the server sends
    ;Tcp send commands to send things to server
    Sleep(1)
WEnd

This will connect to a server (the server must already be running)

Server:

Global $Startup = TCPStartup()
Global $Listen = TCPListen("192.168.1.2", 31338)

While 1
    ;Accept new clients
    $Accept = TCPAccept($Listen)
    If $Accept > 0 Then
        MsgBox(0, "Server", "Connection present on socket " & $Accept)
    EndIf

    Sleep(1)
WEnd

This will help you start off.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...