Jump to content

Send to/ from server


Mumms
 Share

Recommended Posts

Is it possible for this to happen:

User presses a hotkey and sends it to the server.

Then anyone who is running my program will get a message from the server.

For example: I press {F10}

Then Everyone who is running my program would get a msg saying: Hello From Server

Link to comment
Share on other sites

Is it possible for this to happen:

User presses a hotkey and sends it to the server.

Then anyone who is running my program will get a message from the server.

For example: I press {F10}

Then Everyone who is running my program would get a msg saying: Hello From Server

You could try something like this:

TCPStartup()
$ip = "90.90.90.12"
$port = 80
$MainSocket = TCPConnect($ip,$port)
HotKeySet("a","a")

Func a()
TCPSend($MainSocket,"a")
EndFunc

Or you can use cases if you're going to have many keys.

i > *

Link to comment
Share on other sites

You would have to use TCPSend to send the command to each of the clients. In the main client loop, you should have something to parse through the messages and execute them accordingly.

You can base your script off khui's basic example. You can use TCPRecv to receive the message on the client side.

Link to comment
Share on other sites

there are a TON of TCPmulticlient examples and scripts here on the forums... there are a couple in my sig... there is one that John2006, a UDF that Kip has made... there are lots more.. those are just off the top of my head

Link to comment
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
 Share

  • Recently Browsing   0 members

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