Is there a way to send messages between sessions? What I would like to be able to do is query another session for information, and have that information returned. Something like the following:
**** From a script running in session is1:
OnSessionMessageReceived[MessageReceived]
...
Uplink Send is2 "My Information Request"
...
atom MessageReceived(string SendingSession,string Message)
{
<process Information Request Reply in ${Message}>
}
*** From a script running in is2:
OnSessionMessageReceived[MessageReceived]
...
atom MessageReceived(string SendingSession,string Message)
{
<process Information Request in ${Message}>
Uplink Send ${SendingSession} "My Information Request Reply"
}
Messaging between sessions?
Moderators: Lavish Software Team, Moderators
-
- GamingTools Subscriber
- Posts: 29
- Joined: Wed Jun 30, 2010 7:48 am
The command is "Relay" and does not need to be passed through Uplink.
The command is documented under the Uplink section but you do not need to pass it through Uplink.
https://www.lavishsoft.com/wiki/index.p ... Command%29
Code: Select all
relay is2 "My Information Request"
The command is documented under the Uplink section but you do not need to pass it through Uplink.
https://www.lavishsoft.com/wiki/index.p ... Command%29
-
- GamingTools Subscriber
- Posts: 29
- Joined: Wed Jun 30, 2010 7:48 am
Yep, I am aware of relay - use it a lot. So I realize I can use relay to run a script in another session that would perform the request. The problem I have is getting the response back to the calling script easily. I suppose I could use global variables in the requesting session and have the responding session use relay to call a script in the sending session that updates them, but the requesting script would then need to poll for the response event. I was just looking for a more direct way for the requesting script to receive the reply - something like the event callback I suggested (which would need to also be parameterized by the calling/responding script name, which I forgot to include).
-
- GamingTools Subscriber
- Posts: 29
- Joined: Wed Jun 30, 2010 7:48 am
Upon further reflection, using relay as I described above could be problematic if multiple sessions make the same request to a particular session, since only one instance of a script can run. So, since I assume the feature I suggested is not available, can you suggest an alternative approach to achieving the sort of inter-script communication I desire using existing features?
Have a script running already that handles it, and pass in the source session name.
and already running in is2 is a script with ....
Code: Select all
relay is2 somecommand "${Session}" "My information request"
Code: Select all
atom(global) somecommand(string command_source, string command_type)
{
echo Got a request '${command_type}' from source '${command_source}'
; respond to request
relay "${command_source}" somecommandresponse
}
-
- GamingTools Subscriber
- Posts: 29
- Joined: Wed Jun 30, 2010 7:48 am