Skip to content

Commit

Permalink
Adds the script to the tools folder
Browse files Browse the repository at this point in the history
  • Loading branch information
AffectedArc07 committed Jul 20, 2020
1 parent 0c28964 commit 09c7731
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tools/send2server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Script to send world/Topic announcements to a server via automated tooling
# Author: AffectedArc07
# Takes a message as command line argument
# Example: python send2server.py "This is a message that will be sent to the server"
import socket, struct, urllib.parse, sys

message = sys.argv[1]
commskey = "YOURKEYHERE"

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
cmd = "?hostannounce&key={}&message={}".format(urllib.parse.quote(commskey), urllib.parse.quote(message))
query = b"\x00\x83" + struct.pack('>H', len(cmd) + 6) + b"\x00\x00\x00\x00\x00" + cmd.encode() + b"\x00"
sock.connect(("localhost", 6666))
sock.sendall(query)

0 comments on commit 09c7731

Please sign in to comment.