Actions

GMCP Data: Difference between revisions

From Iron Realms Nexus Client Documentation

No edit summary
No edit summary
Line 1: Line 1:
This sample code is called in the default onGMCP function in [[Reflexes]]. The onGMCP function is run every time the game receives a GMCP message from the server. This script has been added to that function.
This sample code is called in the default onGMCP function in [[Reflexes]]. The onGMCP function is run every time the game receives a GMCP message from the server. This script has been added to that function.


-------------


if (args.gmcp_method == "Char.Vitals")  
if (args.gmcp_method == "Char.Vitals")  
{
{
     left = args.gmcp_args.leftwield;
     left = args.gmcp_args.leftwield;
     right = args.gmcp_args.rightwield;
     right = args.gmcp_args.rightwield;
Line 12: Line 11:
     client.set_variable('wielded-right', right);
     client.set_variable('wielded-right', right);
     client.set_variable('wielded-left', left);
     client.set_variable('wielded-left', left);
};
};
 
-------------

Revision as of 18:12, 11 February 2016

This sample code is called in the default onGMCP function in Reflexes. The onGMCP function is run every time the game receives a GMCP message from the server. This script has been added to that function.


if (args.gmcp_method == "Char.Vitals") 
{
   left = args.gmcp_args.leftwield;
   right = args.gmcp_args.rightwield;
   
   client.print("Right: " + right);
   client.print("Left: " + left);
   client.set_variable('wielded-right', right);
   client.set_variable('wielded-left', left);
};