I have the Mikrotik Wireless Wire Cube Pro (https://mikrotik.com/product/wireless_wire_cube_pro) and wanted to make a script which I run on one of the devices which checks whether it can communicate with the other one. Then if it can, it will send it a textual message, say ‘hello world’. This will then be displayed in the terminal window of the second device. I tried doing it with a http post request but get a 501 error. Could anyone help? What I have so far is the below:
:if ([/ping $targetIP count=1] = 0) do={
:log info "Target IP ($targetIP) is not reachable."
} else={
:log info "Target IP ($targetIP) is reachable. Sending message…"
/tool mac-telnet send message=$messageToSend
}
"
/system scheduler
add name=check-and-send interval=1m on-event=“/system script run send-message”
Ask where you got that sh–ty script, probably from ChatGPT.
Just an idiot would invent the not-actually-existent “send” command from mac-telnet.
ChatGPT (and similar) is just s–t in your face, don’t use it.
He made it up just to please you.
ChatGPT is a program for chatting, it must give you satisfaction when you use it, it must get you used to it,
so it will always respond to you with a solution, even an invented one, just to please you.
So basically ChatGPT is a wh–e.
Problem One is ChatGPT is bad at RouterOS script. It does better with stuff like Dockerfile and BIND9, but just makes up too much stuff for RouterOS script.
FWIW, the hallucination is this one:
That isn’t a valid command is Problem Two.
Problem Three is you can’t send a message to the terminal using a script with some different/valid command either. The terminal does have a “chat” by using a “#”, but that only works at the CLI terminal - not in scripts. Scripts, include those run by ssh, will treat some chat “# hello world” as a comment.