GMCP Help!!!

I want to make a nexus script to take GMCP data and assign that to variables.
for example:
IRE.Target.Info
I want to make variables with the ID, short description, and hp percent that it gives me.
how would I do this???

Best Answer

  • Accepted Answer
    Hi there, I think this is what you're looking for - http://nexus.ironrealms.com/GMCP_Data

    It has a little snippet you can cut and paste into the onGMCP function that comes built-in under Reflexes in the nexus settings.

    For IRE.Target specifically, we get this array:
    IRE.Target.Info { "id": "1101", "short_desc": "a brawny goblin smith", "hpperc": "100%" }

    I just plugged in all the bits using the sample code provided on the GMCP Data page and voila, below. It worked in that it would print and update vars whenever I changed/set a target using the ST <target> alias provided by the game.

    I gotta say, the nexus client is a loooot nicer nowadays. Anyway, hope this helps! I'm no expert, but feel free to ask me if you're still confused.
    if (args.gmcp_method == "IRE.Target.Info") 
    {
       id = args.gmcp_args.id;
       desc = args.gmcp_args.short_desc;
       tarhp = args.gmcp_args.hpperc;
       
       client.print("ID: " + id + " Tar: " + desc + " HP: " + tarhp);
       client.set_variable('current-tar-id', id);
       client.set_variable('current-tar-desc', desc);
       client.set_variable('current-tar-hp', tarhp);
    };

Answers

  • Please read the Nexus and GMCP files before making more threads asking basic questions. 

  • Cooper said:
    Please read the Nexus and GMCP files before making more threads asking basic questions. 
    I have combed through them, and am confused. That is why I am asking.
  • Hi, some people aren't terribly helpful. If you have looked through the wiki for the Nexus, there are variables listed that are already assigned values here: http://nexus.ironrealms.com/Predefined_variables. There are also some notes on advanced scripting here: http://nexus.ironrealms.com/Advanced_Scripting. I know that's not much help as I am a dummy when it comes to this stuff, but it's probably a bit better than the nothing you received before.


  • Mariko said:
    Hi, some people aren't terribly helpful. If you have looked through the wiki for the Nexus, there are variables listed that are already assigned values here: http://nexus.ironrealms.com/Predefined_variables. There are also some notes on advanced scripting here: http://nexus.ironrealms.com/Advanced_Scripting. I know that's not much help as I am a dummy when it comes to this stuff, but it's probably a bit better than the nothing you received before.


    Thank you, that was more helpful.
    although, I have already looked at those, and am still confused...
Sign In or Register to comment.