Last active
July 11, 2022 23:32
-
-
Save GiuseppeChillemi/4416e9eb436dae38f8b0368fd12a0cd2 to your computer and use it in GitHub Desktop.
Mini script to send a command to a server. It's COMMANDS object is used
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do %../scripts/send-to.r | |
port-number: 55551 | |
server-address: "localhost" | |
Forever [ | |
prin "Insert a server command > " message: input | |
if message = "exit" [Print "!!! Exit Received, quitting !!!" break] | |
response: send-to server-address port-number message | |
print "" | |
print ["Type of result: " type?/word response] | |
print ["Length of result: " length? response] | |
Print "" | |
look-back: -200 | |
if not none? response [ | |
response: skip tail response look-back | |
] | |
print ["Server has answered > "] | |
print "" | |
probe response | |
print "" | |
Print ["If loadable content: "] | |
print "" | |
probe attempt [load response] | |
print "" | |
] | |
halt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment