Skip to content

Instantly share code, notes, and snippets.

@GiuseppeChillemi
Last active July 11, 2022 23:32
Show Gist options
  • Save GiuseppeChillemi/4416e9eb436dae38f8b0368fd12a0cd2 to your computer and use it in GitHub Desktop.
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
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