Need example for how to properly use Uplink Events

Discussion of Inner Space

Moderators: Lavish Software Team, Moderators

Post Reply
mistahmikey
GamingTools Subscriber
Posts: 29
Joined: Wed Jun 30, 2010 7:48 am

Need example for how to properly use Uplink Events

Post by mistahmikey » Sat Mar 15, 2014 8:49 pm

Trying to use the subject events, but they are not firing for me. Tried doing this as follows:

atom(globalkeep) G_OnSessionConnected(string SessionName)
{
echo "Disconnected"
}

function main()
{
Event[OnSessionConnected]:AttachAtom[G_OnSessionConnected]

while TRUE
{
wait 5
}
}

Code: Select all


But nothing happens when I create a new session.

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Sun Mar 16, 2014 8:16 am

These events only fire within the Uplink. Run this script within the Uplink (main Inner Space program), launch a game instance, and it echoes "Disconnected". Tested fine. :)

mistahmikey
GamingTools Subscriber
Posts: 29
Joined: Wed Jun 30, 2010 7:48 am

Post by mistahmikey » Sun Mar 16, 2014 6:03 pm

Hmmm, I do not understand the sequence required here.

So, when you select Configuration from the innnerspace tray, the resulting GUI provides a number of places you can add commands to various points in the startup sequence:

1) On the General tab, under Startup Sequences, there is:

a) Uplink: Startup
b) Session: Pre-Startup, Startup

2) On the Game Configuration tab there is:

Pre-Startup, Startup

3) On the Game Configuration tab, if you select a game profile from the drop down, there is:

Pre-startup, Startup

I am unsure exactly when each of these actually run in relationship to creating the session, launching the game, etc.

What I want to do is to keep track of what Everquest2 toons are logged into what sessions so it is easy to send commands between sessions to specific toons using relay. I can achieve this by having a "SessionManager" script run in each session and periodically query all the other current sessions to create the desired "global toon state" (assuming ISXEq2 is initialized). But this requires continuous polling by multiple sessions, even though the "global toon state" will rarely change once all the sessions are created (only when sessions die, are created, or toons are logged out/logged in).

So would it be possible to run my "SessionManager" once from the tray console (I assume this is what you call "the Uplink"?) such that all the local session scripts are able to access the "global toon state"? And, maintain the "global toon state" using the various local/remote Session events, rather than polling? If this is possible, at what point in the startup sequence would it be best to run the "SessionManager"?

Lax
Owner
Posts: 6634
Joined: Fri Jun 18, 2004 6:08 pm

Post by Lax » Sun Mar 16, 2014 6:23 pm

Yes, the main program which you find in the system tray is referred to as the Uplink, and the window title when you have it up is "Inner Space Uplink", because all of the relay communication between instances goes through it.

I am telling you that you can have a script running in the Uplink, just like you have within the game. This is the only way you are going to access Uplink events (http://lavishsoft.com/wiki/index.php/IS:Uplink#Events), because they are executing only within the Uplink.

You can access the console via the default hotkey in the Uplink window, or of course by right clicking the tray icon. You can run a script that catches the events, including exactly the code you pasted.

If you put a runscript in the Uplink Startup, then it will run automatically within the Uplink when the Uplink is started.

mistahmikey
GamingTools Subscriber
Posts: 29
Joined: Wed Jun 30, 2010 7:48 am

Post by mistahmikey » Sun Mar 16, 2014 7:35 pm

Thanks very much for the reply. But just to clarify. I assume the uplink and sessions run in separate processes, and therefore, there is no way to use lavishscript to create global variables that are shareable across these processes?

Post Reply