It looks like you're new here. If you want to get involved, click one of these buttons!
When you set a new target using tab targeting, the server will send you target information (via IRE.Target.Set and IRE.Target.Info). You can inform the server that you have set a target (mimicing the behavior of tab targeting) by sending IRE.Target.Set. See http://nexus.ironrealms.com/GMCP#IRE.Target
if (args.gmcp_method == "Char.Vitals")
Ok, let me see if I can walk you through the basics of GMCP with the nexus client. Let's start with receiving GMCP data. To do so you need to create a function and name it onGMCP. The name is important and must be exactly "onGMCP". Now for this example we're going to use the "Char.Vitals" GMCP method to get whether you have balance and equilibrium, and store those in client variables for later use. Ready? Here's the code for the function: if (args.gmcp_method == "Char.Vitals")
What did this do? It set the client variables balance and equilibrium to equal to whether you have balance and equilibrium. You can now reliably use those variables in other code. For example, you could create an alias with the alias text "balance?" and the action "Show a Notice" and text for the notice "Balance: @balance Equilibrium: @equilibrium". Now when you type "balance?" in the client it will show a notice giving you the state of balance and equilibrium.
Now how about sending GMCP to the server. Let's say you want to use "IRE.Target.Set" to set the target in the client to a specific mob. In this case I'm going to create an alias to target a testing dummy that has the item number "12345". I'm going to call this guy "buford" and make it so when I type "buford" he's targeted. So first I use an alias "buford" with "exact match" as the matching type. Then in the actions I select "execute script". In the script section I put:send_GMCP("IRE.Target.Set", "12345");
Now I type in "buford" and . . . nothing seems to happen. Actually something did happen, but only behind the scenes. The game actually did change the target to buford. If I type "kick" and send that without a target, I do in fact kick poor buford (if he is in the room). But the nexus client has the wrong target name in it. This is because to set the target, there's a build in function called "set_current_target". It takes two variables, the target number (as a string) and a value indicating whether or not to tell the game (you want to tell the game. So we change the "execute script" portion to:
After saving, when we type in "buford" the nexus client updates to show buford (assuming he's in the room--otherwise it'll show none) and "kick" will kick poor buford.That, in a nutshell is how to use GMCP. If you have more questions, please feel free to ask
set_variable("health", args.gmcp_args["hp"]); set_variable("mana", args.gmcp_args["mp"]);
"On the battlefield I am a god. I love war. The steel, the smell, the corpses. I wish there were more. On the first day I drove the Northmen back alone at the ford. Alone! On the second I carried the bridge! Me! Yesterday I climbed the Heroes! I love war! I… I wish it wasn’t over."
How do I program something to be checked every tick? Would that be under OnGMCP or is there another trigger that can be created for it?I ask because GMCP coding is JS and I'm more comfortable with the simplified scripting on Nexus.